]>
Commit | Line | Data |
---|---|---|
23a5b65a | 1 | # Copyright (C) 2003-2014 Free Software Foundation, Inc. |
ad41bd84 JM |
2 | # |
3 | # This file is part of GCC. | |
4 | # | |
5 | # GCC is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 3, or (at your option) | |
8 | # any later version. | |
9 | # | |
10 | # GCC is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with GCC; see the file COPYING3. If not see | |
17 | # <http://www.gnu.org/licenses/>. | |
18 | ||
e1112e60 RS |
19 | # This harness is for testing builtin support. Each test has two files: |
20 | # | |
21 | # - foo.c defines the main testing function, main_test(). | |
22 | # - foo-lib.c implements the library functions that foo.c is testing. | |
23 | # | |
24 | # The functions in foo-lib.c will often want to abort on certain inputs. | |
25 | # They can use the global variable inside_main to see whether they are | |
26 | # being called from the test program or part of the common runtime. | |
27 | # | |
28 | # In many cases, the library functions will behave as normal at -O0 | |
29 | # and abort when optimisation is enabled. Such implementations should | |
30 | # go into the lib/ directory so that they can be included by any test | |
31 | # that needs them. They shouldn't call any external functions in case | |
32 | # those functions were overridden too. | |
33 | ||
91a5b394 | 34 | load_lib torture-options.exp |
e1112e60 RS |
35 | load_lib c-torture.exp |
36 | ||
91a5b394 | 37 | torture-init |
d7f09764 | 38 | set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS |
91a5b394 | 39 | |
b6dd5261 | 40 | set additional_flags "-fno-tree-loop-distribute-patterns" |
3dba25eb AT |
41 | if [istarget "powerpc-*-darwin*"] { |
42 | lappend additional_flags "-Wl,-multiply_defined,suppress" | |
43 | } | |
934144c0 | 44 | if { [istarget *-*-eabi*] |
d4b0c416 | 45 | || [istarget *-*-elf] |
17a02b06 SH |
46 | || [istarget *-*-mingw*] |
47 | || [istarget *-*-rtems*] } { | |
934144c0 JJ |
48 | lappend additional_flags "-Wl,--allow-multiple-definition" |
49 | } | |
3dba25eb | 50 | |
e1112e60 RS |
51 | foreach src [lsort [find $srcdir/$subdir *.c]] { |
52 | if {![string match *-lib.c $src] && [runtest_file_p $runtests $src]} { | |
53 | c-torture-execute [list $src \ | |
54 | [file root $src]-lib.c \ | |
3dba25eb AT |
55 | $srcdir/$subdir/lib/main.c] \ |
56 | $additional_flags | |
e1112e60 RS |
57 | } |
58 | } | |
91a5b394 JJ |
59 | |
60 | torture-finish |