Skip to content

Commit 67f615d

Browse files
committed
Add tests for calling valist and vararg functions
1 parent 8a02a61 commit 67f615d

40 files changed

+7152
-22
lines changed

.github/scripts/config.sh

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

77
# Branches that will be used for build when UPDATE_SOURCES=1.
88
BINUTILS_BRANCH=${BINUTILS_BRANCH:-woarm64-cygwin}
9-
GCC_BRANCH=${GCC_BRANCH:-woarm64-cygwin}
9+
GCC_BRANCH=${GCC_BRANCH:-fix-va-list-ucrt}
1010
MINGW_BRANCH=${MINGW_BRANCH:-woarm64-cygwin}
1111
CYGWIN_BRANCH=${CYGWIN_BRANCH:-woarm64}
1212
CYGWIN_PACKAGES_BRANCH=${CYGWIN_PACKAGES_BRANCH:-main}
@@ -23,7 +23,7 @@ COCOM_BASE_BRANCH=master
2323
ARCH=${ARCH:-aarch64}
2424
PLATFORM=${PLATFORM:-w64-mingw32}
2525
if [[ "$PLATFORM" =~ (mingw|cygwin) ]]; then
26-
CRT=${CRT:-msvcrt}
26+
CRT=${CRT:-ucrt}
2727
else
2828
CRT=${CRT:-libc}
2929
fi
@@ -81,10 +81,10 @@ else
8181
fi
8282

8383
DEBUG=${DEBUG:-1} # Enable debug build.
84-
CCACHE=${CCACHE:-0} # Enable usage of ccache.
84+
CCACHE=${CCACHE:-1} # Enable usage of ccache.
8585
RUN_BOOTSTRAP=${RUN_BOOTSTRAP:-0} # Bootstrap dependencies during the build.
86-
UPDATE_SOURCES=${UPDATE_SOURCES:-0} # Update source code repositories.
87-
FLAT_CLONE=${FLAT_CLONE:-1} # Whether the clone of source codes should be full or flat.
86+
UPDATE_SOURCES=${UPDATE_SOURCES:-1} # Update source code repositories.
87+
FLAT_CLONE=${FLAT_CLONE:-0} # Whether the clone of source codes should be full or flat.
8888
RESET_SOURCES=${RESET_SOURCES:-0} # Reset source code repositories before update.
8989
REBASE_SOURCES=${REBASE_SOURCES:-0} # Together with the update, rebase repositories
9090
# to the baseline branches and push the result.

.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/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+
};
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
EXPORTS
2+
use_va_args_no_arguments
3+
use_va_list_no_arguments
4+
use_va_args_few_longs
5+
use_va_list_few_longs
6+
use_va_args_several_longs
7+
use_va_list_several_longs
8+
use_va_args_many_longs
9+
use_va_list_many_longs
10+
use_va_args_few_ints
11+
use_va_list_few_ints
12+
use_va_args_several_ints
13+
use_va_list_several_ints
14+
use_va_args_many_ints
15+
use_va_list_many_ints
16+
use_va_args_few_doubles
17+
use_va_list_few_doubles
18+
use_va_args_several_doubles
19+
use_va_list_several_doubles
20+
use_va_args_many_doubles
21+
use_va_list_many_doubles
22+
use_va_args_few_floats
23+
use_va_list_few_floats
24+
use_va_args_several_floats
25+
use_va_list_several_floats
26+
use_va_args_many_floats
27+
use_va_list_many_floats
28+
use_va_args_few_composites
29+
use_va_list_few_composites
30+
use_va_args_several_composites
31+
use_va_list_several_composites
32+
use_va_args_many_composites
33+
use_va_list_many_composites
34+
use_va_args_few_short_vector_8_bytes
35+
use_va_list_few_short_vector_8_bytes
36+
use_va_args_several_short_vector_8_bytes
37+
use_va_list_several_short_vector_8_bytes
38+
use_va_args_many_short_vector_8_bytes
39+
use_va_list_many_short_vector_8_bytes
40+
use_va_args_few_not_short_vector_12_bytes
41+
use_va_list_few_not_short_vector_12_bytes
42+
use_va_args_several_not_short_vector_12_bytes
43+
use_va_list_several_not_short_vector_12_bytes
44+
use_va_args_many_not_short_vector_12_bytes
45+
use_va_list_many_not_short_vector_12_bytes
46+
use_va_args_few_short_vector_16_bytes
47+
use_va_list_few_short_vector_16_bytes
48+
use_va_args_several_short_vector_16_bytes
49+
use_va_list_several_short_vector_16_bytes
50+
use_va_args_many_short_vector_16_bytes
51+
use_va_list_many_short_vector_16_bytes
52+
use_va_args_few_hfa_2_floats
53+
use_va_list_few_hfa_2_floats
54+
use_va_args_several_hfa_2_floats
55+
use_va_list_several_hfa_2_floats
56+
use_va_args_many_hfa_2_floats
57+
use_va_list_many_hfa_2_floats
58+
use_va_args_few_hfa_4_floats
59+
use_va_list_few_hfa_4_floats
60+
use_va_args_several_hfa_4_floats
61+
use_va_list_several_hfa_4_floats
62+
use_va_args_many_hfa_4_floats
63+
use_va_list_many_hfa_4_floats
64+
use_va_args_few_hfa_2_doubles
65+
use_va_list_few_hfa_2_doubles
66+
use_va_args_several_hfa_2_doubles
67+
use_va_list_several_hfa_2_doubles
68+
use_va_args_many_hfa_2_doubles
69+
use_va_list_many_hfa_2_doubles
70+
use_va_args_few_hfa_4_doubles
71+
use_va_list_few_hfa_4_doubles
72+
use_va_args_several_hfa_4_doubles
73+
use_va_list_several_hfa_4_doubles
74+
use_va_args_many_hfa_4_doubles
75+
use_va_list_many_hfa_4_doubles
76+
use_va_args_few_hva_2_short_vector_8_bytes
77+
use_va_list_few_hva_2_short_vector_8_bytes
78+
use_va_args_several_hva_2_short_vector_8_bytes
79+
use_va_list_several_hva_2_short_vector_8_bytes
80+
use_va_args_many_hva_2_short_vector_8_bytes
81+
use_va_list_many_hva_2_short_vector_8_bytes
82+
use_va_args_few_hva_4_short_vector_8_bytes
83+
use_va_list_few_hva_4_short_vector_8_bytes
84+
use_va_args_several_hva_4_short_vector_8_bytes
85+
use_va_list_several_hva_4_short_vector_8_bytes
86+
use_va_args_many_hva_4_short_vector_8_bytes
87+
use_va_list_many_hva_4_short_vector_8_bytes
88+
use_va_args_few_hva_2_short_vector_16_bytes
89+
use_va_list_few_hva_2_short_vector_16_bytes
90+
use_va_args_several_hva_2_short_vector_16_bytes
91+
use_va_list_several_hva_2_short_vector_16_bytes
92+
use_va_args_many_hva_2_short_vector_16_bytes
93+
use_va_list_many_hva_2_short_vector_16_bytes
94+
use_va_args_few_hva_4_short_vector_16_bytes
95+
use_va_list_few_hva_4_short_vector_16_bytes
96+
use_va_args_several_hva_4_short_vector_16_bytes
97+
use_va_list_several_hva_4_short_vector_16_bytes
98+
use_va_args_many_hva_4_short_vector_16_bytes
99+
use_va_list_many_hva_4_short_vector_16_bytes
100+
use_va_args_ints_and_composites
101+
use_va_list_ints_and_composites
102+
use_va_args_ints_and_floats
103+
use_va_list_ints_and_floats
104+
use_va_args_ints_floats_and_composites
105+
use_va_list_ints_floats_and_composites

0 commit comments

Comments
 (0)