1 # Copyright (C) 2007-2024 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 {
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__)
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__)
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__)
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__)
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__)
72 proc check_cl { flags } {
73 return [check_no_compiler_messages check_$flags assembly {
75 #error Extra mcpu options
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" ] } {
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
97 #return 1 if we have code density option on.
98 proc check_effective_target_codedensity { } {
99 return [check_no_compiler_messages codedensity assembly {
100 #if !defined(__ARC_CODE_DENSITY__)
101 #error No code density option for this config
107 #return 1 if we use ARCv2 Accumulator registers
108 proc check_effective_target_accregs { } {
109 return [check_no_compiler_messages accregs assembly {
110 #if !defined(__ARC_MPY_DMPY__) \
111 && !defined(__ARC_MPY_MACD__) && !defined(__ARC_MPY_QMACW__)
112 #error No accumulator available for this config
117 proc check_effective_target_dpfp { } {
118 return [check_no_compiler_messages dpfp assembly {
119 #if !defined(__ARC_FPX_DP__) && !defined(__ARC_FPU_ASSIST__)
120 #error No FPX available for this config
125 # Return 1 if this is a compiler supporting LL64 option.
126 proc check_effective_target_ll64 { } {
127 return [check_no_compiler_messages ll64 assembly {
128 #if !defined(__ARC_LL64__)
134 # If a testcase doesn't have special options, use these.
135 global DEFAULT_CFLAGS
136 if ![info exists DEFAULT_CFLAGS] then {
137 set DEFAULT_CFLAGS " -ansi -pedantic-errors"
144 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{\[cS\],cpp}]] \