Skip to content

Commit c0e2637

Browse files
committed
Add tests for calling valist and vararg functions
1 parent 8719c84 commit c0e2637

39 files changed

+7256
-22
lines changed

.github/scripts/config.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -x # echo on
55
set -o pipefail # fail of any command in pipeline is an error
66

77
BINUTILS_BRANCH=${BINUTILS_BRANCH:-woarm64-cygwin}
8-
GCC_BRANCH=${GCC_BRANCH:-woarm64-cygwin}
8+
GCC_BRANCH=${GCC_BRANCH:-fix-va-list-ucrt}
99
MINGW_BRANCH=${MINGW_BRANCH:-woarm64-cygwin}
1010
CYGWIN_BRANCH=${CYGWIN_BRANCH:-woarm64}
1111
CYGWIN_PACKAGES_BRANCH=${CYGWIN_PACKAGES_BRANCH:-main}
@@ -14,7 +14,7 @@ COCOM_BRANCH=${COCOM_BRANCH:-master}
1414
ARCH=${ARCH:-aarch64}
1515
PLATFORM=${PLATFORM:-w64-mingw32}
1616
if [[ "$PLATFORM" =~ (mingw|cygwin) ]]; then
17-
CRT=${CRT:-msvcrt}
17+
CRT=${CRT:-ucrt}
1818
else
1919
CRT=${CRT:-libc}
2020
fi
@@ -72,10 +72,10 @@ else
7272
fi
7373

7474
DEBUG=${DEBUG:-1} # Enable debug build.
75-
CCACHE=${CCACHE:-0} # Enable usage of ccache.
76-
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-0} # Bootstrap dependencies during the build.
77-
UPDATE_SOURCES=${UPDATE_SOURCES:-0} # Update source code repositories.
78-
RESET_SOURCES=${RESET_SOURCES:-0} # Reset source code repositories before update.
75+
CCACHE=${CCACHE:-1} # Enable usage of ccache.
76+
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-1} # Bootstrap dependencies during the build.
77+
UPDATE_SOURCES=${UPDATE_SOURCES:-1} # Update source code repositories.
78+
RESET_SOURCES=${RESET_SOURCES:-1} # Reset source code repositories before update.
7979
RUN_CONFIG=${RUN_CONFIG:-1} # Run configuration step.
8080
RUN_INSTALL=${RUN_INSTALL:-1} # Run installation step.
8181
DELETE_BUILD=${DELETE_BUILD:-0} # Delete build folders after successful builds.

.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/types.h

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#pragma once
2+
3+
// https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#definitions
4+
struct short_vector_8_bytes
5+
{
6+
int a;
7+
int b;
8+
};
9+
10+
struct not_short_vector_12_bytes
11+
{
12+
int a;
13+
int b;
14+
int c;
15+
};
16+
17+
struct short_vector_16_bytes
18+
{
19+
int a;
20+
int b;
21+
int c;
22+
int d;
23+
};
24+
25+
struct hfa_2_floats
26+
{
27+
float a;
28+
float b;
29+
};
30+
31+
struct hfa_4_floats
32+
{
33+
float a;
34+
float b;
35+
float c;
36+
float d;
37+
};
38+
39+
struct hfa_2_doubles
40+
{
41+
double a;
42+
double b;
43+
};
44+
45+
struct hfa_4_doubles
46+
{
47+
double a;
48+
double b;
49+
double c;
50+
double d;
51+
};
52+
53+
struct hva_2_short_vector_8_bytes
54+
{
55+
struct short_vector_8_bytes a;
56+
struct short_vector_8_bytes b;
57+
};
58+
59+
struct hva_4_short_vector_8_bytes
60+
{
61+
struct short_vector_8_bytes a;
62+
struct short_vector_8_bytes b;
63+
struct short_vector_8_bytes c;
64+
struct short_vector_8_bytes d;
65+
};
66+
67+
struct hva_2_short_vector_16_bytes
68+
{
69+
struct short_vector_16_bytes a;
70+
struct short_vector_16_bytes b;
71+
};
72+
73+
struct hva_4_short_vector_16_bytes
74+
{
75+
struct short_vector_16_bytes a;
76+
struct short_vector_16_bytes b;
77+
struct short_vector_16_bytes c;
78+
struct short_vector_16_bytes d;
79+
};
80+
81+
struct composite
82+
{
83+
char a;
84+
int b;
85+
const char *c;
86+
double d;
87+
long e;
88+
float f;
89+
char g;
90+
int h;
91+
const char *i;
92+
double j;
93+
long k;
94+
float l;
95+
};

0 commit comments

Comments
 (0)