1 # Copyright
(C
) 2007-2024 Free Software Foundation
, Inc.
3 # This file is part of GCC.
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
)
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.
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
/>.
19 # Run compatibility tests in which the
"alt" compiler tries to force
22 # We can only guarantee MIPS16 runtime support
for certain targets.
23 if { ![istarget mipsisa
*-*-elf
*] && ![istarget mips64vr
*-*-elf
*] } {
29 # Check whether the flags are compatible with MIPS16 code generation.
30 if { ![check_effective_target_mips16_attribute
] } {
34 # Save the old value of CFLAGS_FOR_TARGET
, if any.
35 global saved_CFLAGS_FOR_TARGET
36 if { [info exists CFLAGS_FOR_TARGET
] } {
37 set saved_CFLAGS_FOR_TARGET $CFLAGS_FOR_TARGET
39 unset
-nocomplain saved_CFLAGS_FOR_TARGET
42 # The
"alt" compiler is the normal compiler with an extra "-mips16" argument.
43 proc compat
-use
-alt
-compiler
{ } {
44 global saved_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET
46 if { [info exists saved_CFLAGS_FOR_TARGET
] } {
47 set CFLAGS_FOR_TARGET
[concat $saved_CFLAGS_FOR_TARGET
"-mips16"]
49 set CFLAGS_FOR_TARGET
"-mips16"
53 # Make the compiler under test the default.
54 proc compat
-use
-tst
-compiler
{ } {
55 global saved_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET
57 if { [info exists saved_CFLAGS_FOR_TARGET
] } {
58 set CFLAGS_FOR_TARGET $saved_CFLAGS_FOR_TARGET
60 unset
-nocomplain CFLAGS_FOR_TARGET
67 foreach src
[lsort
[find $srcdir
/$subdir mips16_
*_main.c
]] {
68 if { [runtest_file_p $runtests $src
] } {
69 compat
-execute $src
"mips16_inter" 1
72 compat
-use
-tst
-compiler