mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-20 03:44:19 +08:00
195 lines
6.7 KiB
YAML
195 lines
6.7 KiB
YAML
name: build and test
|
|
|
|
on:
|
|
push:
|
|
branches: [ mob ]
|
|
|
|
jobs:
|
|
test-x86_64-linux:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 2
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: make & test tcc (x86_64-linux)
|
|
run: ./configure && make && make test -k
|
|
|
|
test-x86_64-osx:
|
|
runs-on: macos-15-intel
|
|
timeout-minutes: 2
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: make & test tcc (x86_64-osx)
|
|
run: ./configure && make && make test -k
|
|
|
|
test-aarch64-osx:
|
|
runs-on: macos-15
|
|
timeout-minutes: 2
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: make & test tcc (aarch64-osx)
|
|
run: ./configure && make && make test -k
|
|
|
|
test-x86_64-win32:
|
|
runs-on: windows-2025
|
|
timeout-minutes: 6
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: make & test tcc (x86_64-win32)
|
|
shell: cmd
|
|
run: |
|
|
echo ::group:: setup msys mingw64-gcc
|
|
set MSYS2_PATH_TYPE=inherit
|
|
set MSYSTEM=MINGW64
|
|
set CHERE_INVOKING=yes
|
|
C:\msys64\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-gcc"
|
|
echo ::endgroup::
|
|
C:\msys64\usr\bin\bash -l -c "./configure && make && make test -k"
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: amd64
|
|
- name: build with MSVC (x86_64-win32)
|
|
shell: cmd
|
|
run: |
|
|
echo ::group:: run build-tcc.bat
|
|
cd win32
|
|
call build-tcc.bat -t 64 -c cl
|
|
echo ::endgroup::
|
|
.\tcc -I.. libtcc.dll -v ../tests/libtcc_test.c -o libtest.exe && .\libtest.exe
|
|
.\tcc -I.. libtcc.dll -run ../tests/libtcc_test.c
|
|
|
|
test-i386-win32:
|
|
runs-on: windows-2025
|
|
timeout-minutes: 6
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: make & test tcc (i386-win32)
|
|
shell: cmd
|
|
run: |
|
|
echo ::group:: setup msys mingw32-gcc
|
|
set MSYS2_PATH_TYPE=inherit
|
|
set MSYSTEM=MINGW32
|
|
set CHERE_INVOKING=yes
|
|
C:\msys64\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-i686-gcc"
|
|
echo ::endgroup::
|
|
C:\msys64\usr\bin\bash -l -c "./configure && make && make test -k"
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: x86
|
|
- name: build with MSVC (i386-win32)
|
|
shell: cmd
|
|
run: |
|
|
echo ::group:: run build-tcc.bat
|
|
cd win32
|
|
call build-tcc.bat -t 32 -c cl
|
|
echo ::endgroup::
|
|
.\tcc -I.. libtcc.dll -v ../tests/libtcc_test.c -o libtest.exe && .\libtest.exe
|
|
.\tcc -I.. libtcc.dll -run ../tests/libtcc_test.c
|
|
|
|
test-aarch64-win32:
|
|
runs-on: windows-11-arm
|
|
timeout-minutes: 6
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: arm64
|
|
- name: build & test tcc (aarch64-win32)
|
|
shell: cmd
|
|
run: |
|
|
echo ::group:: build with clang
|
|
cd win32
|
|
call build-tcc.bat -t arm64 -c clang
|
|
echo ::endgroup::
|
|
.\tcc -B. -v
|
|
.\tcc -B. ..\win32\test_arm64.c -o test_arm64.exe && .\test_arm64.exe
|
|
.\tcc -B. -run ..\examples\ex1.c
|
|
.\tcc -B. ..\win32\test_arm64_inline_asm.c -o test_inline_asm.exe && .\test_inline_asm.exe > test_inline_asm.out
|
|
> test_inline_asm.expect echo inline asm ok
|
|
fc /n test_inline_asm.out test_inline_asm.expect
|
|
.\tcc -B. -DTEST_GOTO ..\win32\test_arm64_inline_asm.c -o test_inline_goto.exe && .\test_inline_goto.exe > test_inline_goto.out
|
|
> test_inline_goto.expect echo asm goto ok
|
|
fc /n test_inline_goto.out test_inline_goto.expect
|
|
.\tcc -B. -DTEST_OPERANDS ..\win32\test_arm64_inline_asm.c -c -o test_inline_operands.obj > test_inline_operands.out 2>&1
|
|
if not errorlevel 1 exit /b 1
|
|
type test_inline_operands.out
|
|
findstr /c:"ARM64 extended inline asm is not implemented" test_inline_operands.out
|
|
.\tcc -B. -DTEST_CLOBBERS ..\win32\test_arm64_inline_asm.c -c -o test_inline_clobbers.obj > test_inline_clobbers.out 2>&1
|
|
if not errorlevel 1 exit /b 1
|
|
type test_inline_clobbers.out
|
|
findstr /c:"ARM64 extended inline asm is not implemented" test_inline_clobbers.out
|
|
> test_rstdin.txt echo arm64 stdin
|
|
.\tcc -B. -rstdin test_rstdin.txt -run ..\win32\test_rstdin.c > test_rstdin.out
|
|
type test_rstdin.out
|
|
fc /n test_rstdin.out test_rstdin.txt
|
|
.\tcc -B. ..\tests\tests2\49_bracket_evaluation.c -o test49.exe && .\test49.exe > test49.out
|
|
fc /n test49.out ..\tests\tests2\49_bracket_evaluation.expect
|
|
.\tcc -B. ..\tests\tests2\133_old_func.c -o test133.exe && .\test133.exe > test133.out
|
|
fc /n test133.out ..\tests\tests2\133_old_func.expect
|
|
.\tcc -B. -b ..\tests\tests2\115_bound_setjmp.c -o test115.exe && .\test115.exe > test115.out
|
|
for %%I in (test115.out) do if not %%~zI==0 ( type test115.out & exit /b 1 )
|
|
.\tcc -B. -b ..\tests\tests2\116_bound_setjmp2.c -o test116.exe && .\test116.exe > test116.out
|
|
for %%I in (test116.out) do if not %%~zI==0 ( type test116.out & exit /b 1 )
|
|
.\tcc -B. -b ..\win32\test_arm64_backtrace.c -o test_bt.exe
|
|
.\test_bt.exe > test_bt.out 2>&1
|
|
if not errorlevel 1 exit /b 1
|
|
type test_bt.out
|
|
findstr crash4 test_bt.out
|
|
findstr crash3 test_bt.out
|
|
findstr crash2 test_bt.out
|
|
findstr crash1 test_bt.out
|
|
findstr main test_bt.out
|
|
|
|
test-armv7-linux:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 8
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: uraimo/run-on-arch-action@v3
|
|
name: make & test tcc (armv7-linux)
|
|
with:
|
|
arch: armv7
|
|
distro: ubuntu22.04
|
|
githubToken: ${{ github.token }}
|
|
install: |
|
|
apt-get update -q -y
|
|
apt-get install -q -y gcc make
|
|
run: |
|
|
echo "::endgroup::" # flatten 'run container'
|
|
./configure && make && make test -k
|
|
|
|
test-aarch64-linux:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 8
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: uraimo/run-on-arch-action@v3
|
|
name: make & test tcc (aarch64-linux)
|
|
with:
|
|
arch: aarch64
|
|
distro: ubuntu24.04
|
|
githubToken: ${{ github.token }}
|
|
install: |
|
|
apt-get update -q -y
|
|
apt-get install -q -y gcc make
|
|
run: |
|
|
echo "::endgroup::" # flatten 'run container'
|
|
./configure && make && make test -k
|
|
|
|
test-riscv64-linux:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 8
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: uraimo/run-on-arch-action@v3
|
|
name: make & test tcc (riscv64-linux)
|
|
with:
|
|
arch: riscv64
|
|
distro: ubuntu22.04
|
|
githubToken: ${{ github.token }}
|
|
install: |
|
|
apt-get update -q -y
|
|
apt-get install -q -y gcc make
|
|
run: |
|
|
echo "::endgroup::" # flatten 'run container'
|
|
./configure && make && make test -k
|