Skip to content

Commit 6694391

Browse files
committed
Update gcctestsuite
I updated the tests/gcctestsuite.sh a bit. before: 3329 test(s) ok. 210 test(s) skipped. 168 test(s) failed. 28 test(s) exe failed. after: 3331 test(s) ok. 299 test(s) skipped. 79 test(s) failed. 26 test(s) exe failed. I found some small problems: include/tccdefs.h: Add alloca definition for i386 and x86_64 lib/alloca.S/lib/alloca-bt.S: align i386 alloca to 16 bytes. i386_gen.c vla code and gcc do the same. x86_64-gen.c: fix typo in comment
1 parent 80bef61 commit 6694391

File tree

5 files changed

+57
-41
lines changed

5 files changed

+57
-41
lines changed

include/tccdefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@
310310
__MAYBE_REDIR(void, free, (void*))
311311
#if defined __i386__ || defined __x86_64__
312312
__BOTH(void*, alloca, (__SIZE_TYPE__))
313+
void *alloca(__SIZE_TYPE__);
313314
#else
314315
__BUILTIN(void*, alloca, (__SIZE_TYPE__))
315316
#endif

lib/alloca-bt.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ _(__bound_alloca):
1515
pop %edx
1616
pop %eax
1717
mov %eax, %ecx
18-
add $3+1,%eax
19-
and $-4,%eax
18+
add $15+1,%eax
19+
and $-16,%eax
20+
sub $4,%eax
2021
jz p6
2122

2223
#ifdef _WIN32

lib/alloca.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ _(__alloca):
1616
push %ebp
1717
mov %esp,%ebp
1818
mov 8(%ebp),%eax
19-
add $3,%eax
20-
and $-4,%eax
19+
add $15,%eax
20+
and $-16,%eax
21+
sub $4,%eax
2122
#ifdef _WIN32
2223
jmp .+16 #p2
2324
p1:

tests/gcctestsuite.sh

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -68,31 +68,39 @@ nb_exe_failed="0"
6868
old_pwd="`pwd`"
6969
cd "$TESTSUITE_PATH"
7070

71-
skip_builtin="`grep "_builtin_" compile/*.c execute/*.c execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f2 | sort -u `"
72-
skip_ieee="`grep "_builtin_" execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f3 | sort -u `"
73-
skip_complex="`grep -i "_Complex" compile/*.c execute/*.c execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f2 | sort -u `"
71+
skip_builtin="`grep '_builtin_' compile/*.c execute/*.c execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f2 | sort -u `"
72+
skip_ieee="`grep '_builtin_' execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f3 | sort -u `"
73+
skip_complex="`grep -i '_Complex' compile/*.c execute/*.c execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f2 | sort -u `"
74+
skip_int128="`grep -Eiw '__int128_t|__uint128_t' compile/*.c execute/*.c execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f2 | sort -u `"
75+
skip_vector="`grep -Eiw 'vector|vector_size|__vector_size__' compile/*.c execute/*.c execute/ieee/*.c | cut -d ':' -f1 | cut -d '/' -f2 | sort -u `"
7476
skip_misc="20000120-2.c mipscop-1.c mipscop-2.c mipscop-3.c mipscop-4.c
7577
fp-cmp-4f.c fp-cmp-4l.c fp-cmp-8f.c fp-cmp-8l.c pr38016.c "
7678

7779
cd "$old_pwd"
7880

7981
for src in $TESTSUITE_PATH/compile/*.c ; do
8082
echo $TCC -o $RUNTIME_DIR/tst.o -c $src
81-
$TCC -o $RUNTIME_DIR/tst.o -c $src >> tcc.fail 2>&1
82-
if [ "$?" = "0" ] ; then
83-
result="PASS"
84-
nb_ok=$(( $nb_ok + 1 ))
83+
if $TCC -o $RUNTIME_DIR/tst.o -c $src 2>&1 | grep 'cannot use local functions' >/dev/null 2>&1
84+
then
85+
result="SKIP"
86+
nb_skipped=$(( $nb_skipped + 1 ))
8587
else
86-
base=`basename "$src"`
87-
skip_me="`echo $skip_builtin $skip_ieee $skip_complex $skip_misc | grep -w $base`"
88-
89-
if [ -n "$skip_me" ]
90-
then
91-
result="SKIP"
92-
nb_skipped=$(( $nb_skipped + 1 ))
88+
$TCC -o $RUNTIME_DIR/tst.o -c $src >> tcc.fail 2>&1
89+
if [ "$?" = "0" ] ; then
90+
result="PASS"
91+
nb_ok=$(( $nb_ok + 1 ))
9392
else
94-
result="FAIL"
95-
nb_failed=$(( $nb_failed + 1 ))
93+
base=`basename "$src"`
94+
skip_me="`echo $skip_builtin $skip_ieee $skip_complex $skip_int128 $skip_misc $skip_vector | grep -w $base`"
95+
96+
if [ -n "$skip_me" ]
97+
then
98+
result="SKIP"
99+
nb_skipped=$(( $nb_skipped + 1 ))
100+
else
101+
result="FAIL"
102+
nb_failed=$(( $nb_failed + 1 ))
103+
fi
96104
fi
97105
fi
98106
echo "$result: $src" >> tcc.sum
@@ -105,28 +113,33 @@ fi
105113

106114
for src in $TESTSUITE_PATH/execute/*.c $TESTSUITE_PATH/execute/ieee/*.c ; do
107115
echo $TCC $src -o $RUNTIME_DIR/tst -lm
108-
$TCC $src -o $RUNTIME_DIR/tst -lm >> tcc.fail 2>&1
109-
if [ "$?" = "0" ] ; then
110-
result="PASS"
111-
if $RUNTIME_DIR/tst >> tcc.fail 2>&1
112-
then
113-
result="PASS"
114-
nb_ok=$(( $nb_ok + 1 ))
115-
else
116-
result="FAILEXE"
117-
nb_exe_failed=$(( $nb_exe_failed + 1 ))
118-
fi
116+
if $TCC $src -o $RUNTIME_DIR/tst -lm 2>&1 | grep 'cannot use local functions' >/dev/null 2>&1
117+
then
118+
result="SKIP"
119+
nb_skipped=$(( $nb_skipped + 1 ))
119120
else
120-
base=`basename "$src"`
121-
skip_me="`echo $skip_builtin $skip_ieee $skip_complex $skip_misc | grep -w $base`"
122-
123-
if [ -n "$skip_me" ]
124-
then
125-
result="SKIP"
126-
nb_skipped=$(( $nb_skipped + 1 ))
121+
$TCC $src -o $RUNTIME_DIR/tst -lm >> tcc.fail 2>&1
122+
if [ "$?" = "0" ] ; then
123+
if $RUNTIME_DIR/tst >> tcc.fail 2>&1
124+
then
125+
result="PASS"
126+
nb_ok=$(( $nb_ok + 1 ))
127+
else
128+
result="FAILEXE"
129+
nb_exe_failed=$(( $nb_exe_failed + 1 ))
130+
fi
127131
else
128-
result="FAIL"
129-
nb_failed=$(( $nb_failed + 1 ))
132+
base=`basename "$src"`
133+
skip_me="`echo $skip_builtin $skip_ieee $skip_complex $skip_int128 $skip_misc $skip_vector | grep -w $base`"
134+
135+
if [ -n "$skip_me" ]
136+
then
137+
result="SKIP"
138+
nb_skipped=$(( $nb_skipped + 1 ))
139+
else
140+
result="FAIL"
141+
nb_failed=$(( $nb_failed + 1 ))
142+
fi
130143
fi
131144
fi
132145
echo "$result: $src" >> tcc.sum

x86_64-gen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ void gfunc_prolog(Sym *func_sym)
15031503
gen_le32(seen_stack_size);
15041504
/* movq %r11, -0x10(%rbp) */
15051505
o(0xf05d894c);
1506-
/* leaq $-192(%rbp), %r11 */
1506+
/* leaq $-200(%rbp), %r11 */
15071507
o(0x9d8d4c);
15081508
gen_le32(-176 - 24);
15091509
/* movq %r11, -0x8(%rbp) */

0 commit comments

Comments
 (0)