Skip to content

Commit 639ec1e

Browse files
committed
Add tests for calling valist and vararg functions
1 parent 11be0e7 commit 639ec1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+11425
-21
lines changed

.github/scripts/config.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BINUTILS_REPO=${BINUTILS_REPO:-Windows-on-ARM-Experiments/binutils-woarm64}
99
BINUTILS_BRANCH=${BINUTILS_BRANCH:-woarm64-cygwin}
1010

1111
GCC_REPO=${GCC_REPO:-Windows-on-ARM-Experiments/gcc-woarm64}
12-
GCC_BRANCH=${GCC_BRANCH:-woarm64-cygwin}
12+
GCC_BRANCH=${GCC_BRANCH:-fix-va-list-ucrt}
1313

1414
MINGW_REPO=${MINGW_REPO:-Windows-on-ARM-Experiments/mingw-woarm64}
1515
MINGW_BRANCH=${MINGW_BRANCH:-woarm64-cygwin}
@@ -34,7 +34,7 @@ COCOM_BASE_BRANCH=master
3434
ARCH=${ARCH:-aarch64}
3535
PLATFORM=${PLATFORM:-w64-mingw32}
3636
if [[ "$PLATFORM" =~ (mingw|cygwin) ]]; then
37-
CRT=${CRT:-msvcrt}
37+
CRT=${CRT:-ucrt}
3838
else
3939
CRT=${CRT:-libc}
4040
fi
@@ -105,9 +105,9 @@ else
105105
fi
106106

107107
DEBUG=${DEBUG:-1} # Enable debug build.
108-
CCACHE=${CCACHE:-0} # Enable usage of ccache.
108+
CCACHE=${CCACHE:-1} # Enable usage of ccache.
109109
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-0} # Bootstrap dependencies during the build.
110-
UPDATE_SOURCES=${UPDATE_SOURCES:-0} # Update source code repositories.
110+
UPDATE_SOURCES=${UPDATE_SOURCES:-1} # Update source code repositories.
111111
UPDATE_LIBRARIES=${UPDATE_LIBRARIES:-0} # Update also source code of tested libraries repositories.
112112
FLAT_CLONE=${FLAT_CLONE:-1} # Whether the clone of source codes should be full or flat.
113113
RESET_SOURCES=${RESET_SOURCES:-0} # Reset source code repositories before update.

.github/scripts/toolchain/build-gcc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$GCC_BUILD_PATH/Makefile" ]]; then
123123
--host=$HOST \
124124
--target=$TARGET \
125125
--enable-static \
126-
--enable-languages=c,c++,d,fortran,lto,m2,objc,obj-c++ \
126+
--enable-languages=c,c++,lto \
127127
--disable-bootstrap \
128128
--disable-multilib \
129129
--with-gnu-as \

.github/scripts/toolchain/execute-gcc-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ echo "::group::Execute GCC tests"
3535
make $BUILD_MAKE_OPTIONS -k $MAKE_TARGET \
3636
RUNTESTFLAGS="$FILTER $HOST_BOARD $TARGET_BOARD" \
3737
DEJAGNU="$DEJAGNU_FILE" \
38-
CHECK_TEST_FRAMEWORK=1 \
38+
CHECK_TEST_FRAMEWORK=0 \
3939
|| echo "Error"
4040

4141
mkdir -p $TEST_RESULTS_PATH

compare-test-results.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
.github/scripts/toolchain/compare-gcc-results.sh va-list-before va-list-after

execute-valist-tests.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
FILTER="va-*\ *-va-*\ va_*\ *_va_*\ *var_copy*\ *varg*\ *vaarg*\ *vararg*\ *stdar*\ *printf*"
4+
5+
.github/scripts/toolchain/execute-gcc-tests.sh gcc-tests-va-list-after "" "\
6+
aapcs.exp=$FILTER \
7+
aapcs64.exp=$FILTER \
8+
aarch64-sve-pcs.exp=$FILTER \
9+
aarch64.exp=$FILTER \
10+
analyzer.exp=$FILTER \
11+
compile.exp=$FILTER \
12+
dfp.exp=$FILTER \
13+
dg.exp=$FILTER \
14+
fixed-point.exp=$FILTER \
15+
execute.exp=$FILTER \
16+
noncompile.exp=$FILTER \
17+
stackalign.exp=$FILTER \
18+
torture.exp=$FILTER \
19+
tree-prof.exp=$FILTER \
20+
tree-ssa.exp=$FILTER \
21+
vmx.exp=$FILTER \
22+
format.exp"
23+
.github/scripts/toolchain/create-gcc-summary.sh artifact/gcc-tests-va-list-after > artifact/gcc-tests-va-list-after/summary.md
24+
25+
#gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-1.C
26+
#gcc/testsuite/gcc.dg/torture/c23-stdarg-split-1b.c
27+
#gcc/gcc/testsuite/gcc.dg/torture/va-arg-25.c
28+
#gcc/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c

tests/valist/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.bin
2+
*.cod
3+
*.dll
4+
*.exe
5+
*.exp
6+
*.gimple
7+
*.ilk
8+
*.lib
9+
*.pdb
10+
*.o
11+
*.obj
12+
*.so
13+
valist-all-*.s

tests/valist/compile.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %3
2+
3+
@echo on
4+
5+
set "dir=%1"
6+
set "name=%2"
7+
8+
call set dir=%%dir:\\wsl.localhost\Ubuntu-22.04=W:%%
9+
cd /D "%dir%"
10+
11+
cl /c /Zi /Od /FAcs /GS- %name%-dll.c /Fo%name%-dll-msvc.obj
12+
cl /c /Zi /Od /FAcs /GS- %name%-use-dll.c /Fo%name%-use-dll-msvc.obj

tests/valist/link-dll.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %3
2+
3+
@echo on
4+
5+
set "dir=%1"
6+
set "name=%2"
7+
8+
call set dir=%%dir:\\wsl.localhost\Ubuntu-22.04=W:%%
9+
cd /D "%dir%"
10+
11+
link /INCREMENTAL:NO /DLL /DEBUG /OUT:%name%-dll-msvc.dll /IMPLIB:%name%-dll-msvc.lib %name%-dll-msvc.obj
12+
if %errorlevel% neq 0 exit /b %errorlevel%

tests/valist/link-exe.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %3
2+
3+
@echo on
4+
5+
set "dir=%1"
6+
set "name=%2"
7+
8+
call set dir=%%dir:\\wsl.localhost\Ubuntu-22.04=W:%%
9+
cd /D "%dir%"
10+
11+
link /INCREMENTAL:NO /DEBUG /OUT:%name%-msvc.exe %name%-use-dll-msvc.obj %name%-dll-msvc.lib
12+
if %errorlevel% neq 0 exit /b %errorlevel%
13+
link /INCREMENTAL:NO /DEBUG /OUT:%name%-msvc-gcc.exe %name%-use-dll-msvc.obj %name%-dll-gcc.lib
14+
if %errorlevel% neq 0 exit /b %errorlevel%
15+
if exist "%name%-dll-gcc-fixed.s" (
16+
link /INCREMENTAL:NO /DEBUG /OUT:%name%-msvc-gcc-fixed.exe %name%-use-dll-msvc.obj %name%-dll-gcc-fixed.lib
17+
if %errorlevel% neq 0 exit /b %errorlevel%
18+
)

tests/valist/link-gcc-exe.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %3
2+
3+
@echo on
4+
5+
set "dir=%1"
6+
set "name=%2"
7+
8+
call set dir=%%dir:\\wsl.localhost\Ubuntu-22.04=W:%%
9+
cd /D "%dir%"
10+
11+
link /INCREMENTAL:NO /ENTRY:main /DEBUG /OUT:%name%-gcc-msvc.exe %name%-use-dll-gcc.o %name%-dll-msvc.lib
12+
if %errorlevel% neq 0 exit /b %errorlevel%
13+
if exist "%name%-dll-gcc-fixed.s" (
14+
link /INCREMENTAL:NO /DEBUG /OUT:%name%-gcc-fixed-msvc.exe %name%-use-dll-gcc-fixed.o %name%-dll-msvc.lib
15+
if %errorlevel% neq 0 exit /b %errorlevel%
16+
)

0 commit comments

Comments
 (0)