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.
33 global ALT_CC_UNDER_TEST
34 global compat_save_gcc_under_test
36 global compat_same_alt
38 # Load procedures from common libraries.
42 # Load the language-dependent compatibility support procedures.
45 # Load the language-independent compabibility support procedures.
50 # Save variables for the C compiler under test, which each test will
51 # change a couple of times. This must be done after calling gcc-init.
52 set compat_save_gcc_under_test $GCC_UNDER_TEST
54 # Define an identifier for use with this suite to avoid name conflicts
55 # with other compat tests running at the same time.
58 # Find out whether there is an alternate compiler to test. If the
59 # variable is defined but is set to "same", that means we use the same
60 # compiler twice, which is meaningful if the two parts of COMPAT_OPTIONS
65 if [info exists ALT_CC_UNDER_TEST] then {
67 if [string match "same" $ALT_CC_UNDER_TEST] then {
73 foreach src [lsort [find $srcdir/$subdir *_main.c]] {
74 # If we're only testing specific files and this isn't one of them, skip it.
75 if ![runtest_file_p $runtests $src] then {
79 compat-execute $src $sid $compat_use_alt
82 # Restore the original compiler under test.
83 compat-use-tst-compiler