| 1 |
# Assembly-based regression-test driver for the SVE ACLE |
| 2 |
# Copyright (C) 2009-2025 Free Software Foundation, Inc. |
| 3 |
# |
| 4 |
# This file is part of GCC. |
| 5 |
# |
| 6 |
# GCC is free software; you can redistribute it and/or modify it |
| 7 |
# under the terms of the GNU General Public License as published by |
| 8 |
# the Free Software Foundation; either version 3, or (at your option) |
| 9 |
# any later version. |
| 10 |
# |
| 11 |
# GCC is distributed in the hope that it will be useful, but |
| 12 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
# General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License |
| 17 |
# along with GCC; see the file COPYING3. If not see |
| 18 |
# <http://www.gnu.org/licenses/>. */ |
| 19 |
|
| 20 |
# GCC testsuite that uses the `dg.exp' driver. |
| 21 |
|
| 22 |
# Exit immediately if this isn't an AArch64 target. |
| 23 |
if { ![istarget aarch64*-*-*] } { |
| 24 |
return |
| 25 |
} |
| 26 |
|
| 27 |
# Load support procs. |
| 28 |
load_lib g++-dg.exp |
| 29 |
|
| 30 |
# Initialize `dg'. |
| 31 |
dg-init |
| 32 |
|
| 33 |
# Force SVE if we're not testing it already. |
| 34 |
if { [check_effective_target_aarch64_sve2] } { |
| 35 |
set sve2_flags "" |
| 36 |
} else { |
| 37 |
set sve2_flags "-march=armv8.5-a+sve2" |
| 38 |
} |
| 39 |
|
| 40 |
# Turn off any codegen tweaks by default that may affect expected assembly. |
| 41 |
# Tests relying on those should turn them on explicitly. |
| 42 |
set sve2_flags "$sve2_flags -mtune=generic -moverride=tune=none -moverride=tune=cheap_fpmr_write" |
| 43 |
|
| 44 |
set gcc_subdir [string replace $subdir 0 2 gcc] |
| 45 |
lappend extra_flags "-fno-ipa-icf" "-I$srcdir/$gcc_subdir/../../sve/acle/asm" |
| 46 |
|
| 47 |
global gcc_runtest_parallelize_limit_minor |
| 48 |
if { [info exists gcc_runtest_parallelize_limit_minor] } { |
| 49 |
set old_limit_minor $gcc_runtest_parallelize_limit_minor |
| 50 |
set gcc_runtest_parallelize_limit_minor 1 |
| 51 |
} |
| 52 |
|
| 53 |
torture-init |
| 54 |
set-torture-options { |
| 55 |
"-std=c++98 -O0 -g" |
| 56 |
"-std=c++11 -O0 -DSTREAMING_COMPATIBLE" |
| 57 |
"-std=c++98 -O1 -g" |
| 58 |
"-std=c++11 -O2 -g" |
| 59 |
"-std=c++14 -O3 -g" |
| 60 |
"-std=c++17 -Og -g" |
| 61 |
"-std=c++2a -Os -g" |
| 62 |
"-std=gnu++98 -O2 -fno-schedule-insns -DCHECK_ASM --save-temps" |
| 63 |
"-std=gnu++11 -Ofast -g" |
| 64 |
"-std=gnu++17 -O3 -g" |
| 65 |
"-std=gnu++2a -O0 -g" |
| 66 |
} { |
| 67 |
"-DTEST_FULL" |
| 68 |
"-DTEST_OVERLOADS" |
| 69 |
} |
| 70 |
|
| 71 |
# Main loop. |
| 72 |
set files [glob -nocomplain $srcdir/$gcc_subdir/asm/*.c] |
| 73 |
set save-dg-do-what-default ${dg-do-what-default} |
| 74 |
if { [check_effective_target_aarch64_asm_sve2_ok] |
| 75 |
&& [check_effective_target_aarch64_variant_pcs] } { |
| 76 |
set dg-do-what-default assemble |
| 77 |
} else { |
| 78 |
set dg-do-what-default compile |
| 79 |
} |
| 80 |
gcc-dg-runtest [lsort $files] "" "$sve2_flags $extra_flags" |
| 81 |
set dg-do-what-default ${save-dg-do-what-default} |
| 82 |
|
| 83 |
torture-finish |
| 84 |
|
| 85 |
if { [info exists gcc_runtest_parallelize_limit_minor] } { |
| 86 |
set gcc_runtest_parallelize_limit_minor $old_limit_minor |
| 87 |
} |
| 88 |
|
| 89 |
# All done. |
| 90 |
dg-finish |