1 # Copyright
(C
) 2002-2018 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
3 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 GCC
; see the file COPYING3.
If not see
15 #
<http
://www.gnu.org
/licenses
/>.
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
37 global compat_have_dfp
39 #
Load procedures from common libraries.
43 #
Load the language
-dependent compatibility support procedures.
46 #
Load the language
-independent compabibility support procedures.
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.
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
66 if [info exists ALT_CC_UNDER_TEST
] then {
68 if [string match
"same" $ALT_CC_UNDER_TEST] then {
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 {
82 compat
-execute $src $sid $compat_use_alt
85 # Restore the original compiler under test.
86 compat
-use
-tst
-compiler