1 # Copyright (C) 1997-2021 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 for ARMv8-M Security Extensions using the `dg.exp' driver.
22 # Exit immediately if the target does not support -mcmse.
23 if ![check_effective_target_arm_cmse_ok] then {
27 # If a testcase doesn't have special options, use these.
29 if ![info exists DEFAULT_CFLAGS] then {
30 set DEFAULT_CFLAGS " -ansi -pedantic-errors"
36 set saved-dg-do-what-default ${dg-do-what-default}
37 set dg-do-what-default "assemble"
39 set saved-lto_torture_options ${LTO_TORTURE_OPTIONS}
40 set LTO_TORTURE_OPTIONS ""
42 # These are for both baseline and mainline.
43 gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] \
46 if {[check_effective_target_arm_arch_v8m_base_ok]} then {
48 set BASELINE_FLAGS [add_options_for_arm_arch_v8m_base ""]
49 gcc-dg-runtest [lsort [glob $srcdir/$subdir/baseline/*.c]] \
50 "$BASELINE_FLAGS" $DEFAULT_CFLAGS
53 if {[check_effective_target_arm_arch_v8m_main_ok]} then {
54 set MAINLINE_8M_FLAGS [add_options_for_arm_arch_v8m_main ""]
55 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8m/*.c]] \
56 "$MAINLINE_8M_FLAGS" $DEFAULT_CFLAGS
57 # Mainline -mfloat-abi=soft
58 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8m/soft/*.c]] \
59 "$MAINLINE_8M_FLAGS -mfloat-abi=soft" $DEFAULT_CFLAGS
60 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8m/softfp/*.c]] \
61 "$MAINLINE_8M_FLAGS" $DEFAULT_CFLAGS
62 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8m/softfp-sp/*.c]] \
63 "$MAINLINE_8M_FLAGS" $DEFAULT_CFLAGS
64 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8m/hard/*.c]] \
65 "$MAINLINE_8M_FLAGS" $DEFAULT_CFLAGS
66 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8m/hard-sp/*.c]] \
67 "$MAINLINE_8M_FLAGS" $DEFAULT_CFLAGS
70 if {[check_effective_target_arm_arch_v8_1m_main_ok]} then {
71 set MAINLINE_8_1M_FLAGS [add_options_for_arm_arch_v8_1m_main ""]
72 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8_1m/*.c]] \
73 "$MAINLINE_8_1M_FLAGS" $DEFAULT_CFLAGS
74 # Mainline -mfloat-abi=soft
75 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8_1m/soft/*.c]] \
76 "$MAINLINE_8_1M_FLAGS -mfloat-abi=soft" $DEFAULT_CFLAGS
77 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8_1m/softfp/*.c]] \
78 "$MAINLINE_8_1M_FLAGS" $DEFAULT_CFLAGS
79 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8_1m/softfp-sp/*.c]] \
80 "$MAINLINE_8_1M_FLAGS" $DEFAULT_CFLAGS
81 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8_1m/hard/*.c]] \
82 "$MAINLINE_8_1M_FLAGS" $DEFAULT_CFLAGS
83 gcc-dg-runtest [lsort [glob $srcdir/$subdir/mainline/8_1m/hard-sp/*.c]] \
84 "$MAINLINE_8_1M_FLAGS" $DEFAULT_CFLAGS
87 set LTO_TORTURE_OPTIONS ${saved-lto_torture_options}
88 set dg-do-what-default ${saved-dg-do-what-default}