Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / compat / compat.exp
blob0d07877a520582c61ffe5a6fa2e7760ac3de3f00
1 # Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # This file was written by Janis Johnson, <janis187@us.ibm.com>
20 # Test interoperability of two compilers that follow the same ABI.
22 # Break simple tests into two pieces and see that they work when linked
23 # together. If an alternate compiler is specified then the two main
24 # pieces of each test are compiled with different compilers. The
25 # alternate compiler must be installed, and is specified by defining
26 # ALT_CC_UNDER_TEST in the environment.
28 if $tracelevel then {
29 strace $tracelevel
32 global GCC_UNDER_TEST
33 global ALT_CC_UNDER_TEST
34 global compat_save_gcc_under_test
35 global compat_use_alt
36 global compat_same_alt
37 global compat_have_dfp
39 # Load procedures from common libraries.
40 load_lib standard.exp
41 load_lib gcc.exp
43 # Load the language-dependent compatibility support procedures.
44 load_lib c-compat.exp
46 # Load the language-independent compabibility support procedures.
47 load_lib compat.exp
49 gcc_init
51 # Save variables for the C compiler under test, which each test will
52 # change a couple of times. This must be done after calling gcc-init.
53 set compat_save_gcc_under_test $GCC_UNDER_TEST
55 # Define an identifier for use with this suite to avoid name conflicts
56 # with other compat tests running at the same time.
57 set sid "c_compat"
59 # Find out whether there is an alternate compiler to test. If the
60 # variable is defined but is set to "same", that means we use the same
61 # compiler twice, which is meaningful if the two parts of COMPAT_OPTIONS
62 # are different.
63 set compat_use_alt 0
64 set compat_same_alt 0
66 if [info exists ALT_CC_UNDER_TEST] then {
67 set compat_use_alt 1
68 if [string match "same" $ALT_CC_UNDER_TEST] then {
69 set compat_same_alt 1
73 compat_setup_dfp
75 # Main loop.
76 foreach src [lsort [find $srcdir/$subdir *_main.c]] {
77 # If we're only testing specific files and this isn't one of them, skip it.
78 if ![runtest_file_p $runtests $src] then {
79 continue
82 compat-execute $src $sid $compat_use_alt
85 # Restore the original compiler under test.
86 compat-use-tst-compiler