1 # This harness is for testing builtin support. Each test has two files:
3 # - foo.c defines the main testing function, main_test().
4 # - foo-lib.c implements the library functions that foo.c is testing.
6 # The functions in foo-lib.c will often want to abort on certain inputs.
7 # They can use the global variable inside_main to see whether they are
8 # being called from the test program or part of the common runtime.
10 # In many cases, the library functions will behave as normal at -O0
11 # and abort when optimisation is enabled. Such implementations should
12 # go into the lib/ directory so that they can be included by any test
13 # that needs them. They shouldn't call any external functions in case
14 # those functions were overridden too.
16 load_lib c-torture.exp
18 set additional_flags ""
19 if [istarget "powerpc-*-darwin*"] {
20 lappend additional_flags "-Wl,-multiply_defined,suppress"
23 foreach src [lsort [find $srcdir/$subdir *.c]] {
24 if {![string match *-lib.c $src] && [runtest_file_p $runtests $src]} {
25 c-torture-execute [list $src \
26 [file root $src]-lib.c \
27 $srcdir/$subdir/lib/main.c] \