3 if [ -z "$TESTSUITE_PATH" ]
5 if [ -d "$HOME/gcc/gcc-3.2/gcc/testsuite/gcc.c-torture" ]
7 TESTSUITE_PATH
="$HOME/gcc/gcc-3.2/gcc/testsuite/gcc.c-torture"
11 if [ -z "$TESTSUITE_PATH" ]
13 echo "gcc testsuite not found."
14 echo "define TESTSUITE_PATH to point to the gcc.c-torture directory"
18 if [ -z "$TCC_SOURCE_PATH" ]
20 if [ -f "include/tccdefs.h" ]
23 elif [ -f "../include/tccdefs.h" ]
26 elif [ -f "../tinycc/include/tccdefs.h" ]
28 TCC_SOURCE_PATH
="../tinycc"
32 if [ -z "$RUNTIME_DIR" ]
34 RUNTIME_DIR
=$XDG_RUNTIME_DIR
36 if [ -z "$RUNTIME_DIR" ]
43 if [ -z "$TCC_SOURCE_PATH" ]
46 echo "define TCC_SOURCE_PATH to point to the tcc source path"
50 TCC
="./tcc -B. -I$TCC_SOURCE_PATH/ -I$TCC_SOURCE_PATH/include -DNO_TRAMPOLINES"
52 TCC
="$CC -O1 -Wno-implicit-int $CFLAGS"
55 rm -f tcc.
sum tcc.fail
61 # skip some failed tests not implemented in tcc
62 # builtin: gcc "__builtins_*"
63 # ieee: gcc "__builtins_*" in the ieee directory
64 # complex: C99 "_Complex" and gcc "__complex__"
65 # misc: stdc features, other arch, gcc extensions (example: gnu_inline in c89)
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_misc
="20000120-2.c mipscop-1.c mipscop-2.c mipscop-3.c mipscop-4.c
75 fp-cmp-4f.c fp-cmp-4l.c fp-cmp-8f.c fp-cmp-8l.c pr38016.c "
79 for src
in $TESTSUITE_PATH/compile
/*.c
; do
80 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
84 nb_ok
=$
(( $nb_ok + 1 ))
86 base
=`basename "$src"`
87 skip_me
="`echo $skip_builtin $skip_ieee $skip_complex $skip_misc | grep -w $base`"
92 nb_skipped
=$
(( $nb_skipped + 1 ))
95 nb_failed
=$
(( $nb_failed + 1 ))
98 echo "$result: $src" >> tcc.
sum
101 if [ -f "$RUNTIME_DIR/tst.o" ]
103 rm -f "$RUNTIME_DIR/tst.o"
106 for src
in $TESTSUITE_PATH/execute
/*.c
$TESTSUITE_PATH/execute
/ieee
/*.c
; do
107 echo $TCC $src -o $RUNTIME_DIR/tst
-lm
108 $TCC $src -o $RUNTIME_DIR/tst
-lm >> tcc.fail
2>&1
109 if [ "$?" = "0" ] ; then
111 if $RUNTIME_DIR/tst
>> tcc.fail
2>&1
114 nb_ok
=$
(( $nb_ok + 1 ))
117 nb_exe_failed
=$
(( $nb_exe_failed + 1 ))
120 base
=`basename "$src"`
121 skip_me
="`echo $skip_builtin $skip_ieee $skip_complex $skip_misc | grep -w $base`"
126 nb_skipped
=$
(( $nb_skipped + 1 ))
129 nb_failed
=$
(( $nb_failed + 1 ))
132 echo "$result: $src" >> tcc.
sum
135 if [ -f "$RUNTIME_DIR/tst.o" ]
137 rm -f "$RUNTIME_DIR/tst.o"
139 if [ -f "$RUNTIME_DIR/tst" ]
141 rm -f "$RUNTIME_DIR/tst"
144 echo "$nb_ok test(s) ok." >> tcc.
sum
145 echo "$nb_ok test(s) ok."
146 echo "$nb_skipped test(s) skipped." >> tcc.
sum
147 echo "$nb_skipped test(s) skipped."
148 echo "$nb_failed test(s) failed." >> tcc.
sum
149 echo "$nb_failed test(s) failed."
150 echo "$nb_exe_failed test(s) exe failed." >> tcc.
sum
151 echo "$nb_exe_failed test(s) exe failed."