Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / arc / arc.exp
blob6038cb8316315689d866430c740103ee31750b5f
1 # Copyright (C) 2007-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 # GCC testsuite that uses the `dg.exp' driver.
19 # Exit immediately if this isn't an arc target.
20 if ![istarget arc*-*-*] then {
21 return
24 # Load support procs.
25 load_lib gcc-dg.exp
27 # Return 1 if this is a compiler supporting ARCv2 EM as default processor
28 proc check_effective_target_arcem { } {
29 return [check_no_compiler_messages arcem assembly {
30 #if !defined(__ARCEM__)
31 #error No ARC EM
32 #endif
36 # Return 1 if we compile for ARC700
37 proc check_effective_target_arc700 { } {
38 return [check_no_compiler_messages arc700 assembly {
39 #if !defined(__ARC700__)
40 #error No ARC 700
41 #endif
45 # Return 1 if we compile for ARC6xx
46 proc check_effective_target_arc6xx { } {
47 return [check_no_compiler_messages arc6xx assembly {
48 #if !defined(__ARC600__) && !defined(__ARC601__)
49 #error No ARC 6xx
50 #endif
54 # Return 1 if we have mpy
55 proc check_effective_target_arcmpy { } {
56 return [check_no_compiler_messages arcmpy assembly {
57 #if !defined(__ARC_MPY__)
58 #error No MPY
59 #endif
63 # Return 1 if this is a compiler supporting ARC HS as default processor
64 proc check_effective_target_archs { } {
65 return [check_no_compiler_messages archs assembly {
66 #if !defined(__ARCHS__)
67 #error No ARC HS
68 #endif
72 proc check_cl { flags } {
73 return [check_no_compiler_messages check_$flags assembly {
74 #if !defined(__arc__)
75 #error Extra mcpu options
76 #endif
77 } "$flags"]
80 # Return 1 if there are no extra mcpu options given via command line
81 proc check_effective_target_clmcpu { } {
82 if { [check_cl "-mcpu=arc700"]
83 && [check_cl "-mcpu=arcem" ] } {
84 return 1
86 return 0
89 proc check_effective_target_barrelshifter { } {
90 return [check_no_compiler_messages barrelshifter assembly {
91 #if !defined(__ARC_BARREL_SHIFTER__)
92 #error No barrel shifter for this confi
93 #endif
97 # If a testcase doesn't have special options, use these.
98 global DEFAULT_CFLAGS
99 if ![info exists DEFAULT_CFLAGS] then {
100 set DEFAULT_CFLAGS " -ansi -pedantic-errors"
103 # Initialize `dg'.
104 dg-init
106 # Main loop.
107 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{\[cS\],cpp}]] \
108 "" $DEFAULT_CFLAGS
110 # All done.
111 dg-finish