1 # Regression driver for SLS mitigation on AArch64.
2 # Copyright (C) 2020-2023 Free Software Foundation, Inc.
3 # Contributed by ARM Ltd.
5 # This file is part of GCC.
7 # GCC is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
12 # GCC is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GCC; see the file COPYING3. If not see
19 # <http://www.gnu.org/licenses/>. */
21 # Exit immediately if this isn't an AArch64 target.
22 if {![istarget aarch64*-*-*] } then {
28 load_lib torture-options.exp
30 # If a testcase doesn't have special options, use these.
32 if ![info exists DEFAULT_CFLAGS] then {
33 set DEFAULT_CFLAGS " "
40 # Use different architectures as well as the normal optimisation options.
41 # (i.e. use both SB and DSB+ISB barriers).
43 set save-dg-do-what-default ${dg-do-what-default}
45 # Run with torture tests (i.e. a bunch of different optimisation levels) just
46 # to increase test coverage.
47 set dg-do-what-default assemble
48 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
49 "-save-temps" $DEFAULT_CFLAGS
51 # Run the same tests but this time with SB extension.
52 # Since not all supported assemblers will support that extension we decide
53 # whether to assemble or just compile based on whether the extension is
54 # supported for the available assembler.
57 foreach x $DG_TORTURE_OPTIONS {
58 lappend templist "$x -march=armv8.3-a+sb "
59 lappend templist "$x -march=armv8-a+sb "
61 set-torture-options $templist
62 if { [check_effective_target_aarch64_asm_sb_ok] } {
63 set dg-do-what-default assemble
65 set dg-do-what-default compile
67 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
68 "-save-temps" $DEFAULT_CFLAGS
69 set dg-do-what-default ${save-dg-do-what-default}