| 1 |
# Assembly-based regression-test driver for the SME 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 gcc-dg.exp |
| 29 |
|
| 30 |
# Initialize `dg'. |
| 31 |
dg-init |
| 32 |
|
| 33 |
# Force SME if we're not testing it already. |
| 34 |
if { [check_effective_target_aarch64_sme] } { |
| 35 |
set sme_flags "" |
| 36 |
} else { |
| 37 |
set sme_flags "-march=armv9-a+sme" |
| 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 sme_flags "$sme_flags -mtune=generic -moverride=tune=none" |
| 43 |
|
| 44 |
global gcc_runtest_parallelize_limit_minor |
| 45 |
if { [info exists gcc_runtest_parallelize_limit_minor] } { |
| 46 |
set old_limit_minor $gcc_runtest_parallelize_limit_minor |
| 47 |
set gcc_runtest_parallelize_limit_minor 1 |
| 48 |
} |
| 49 |
|
| 50 |
torture-init |
| 51 |
set-torture-options { |
| 52 |
"-std=c90 -O0 -g" |
| 53 |
"-std=c99 -Og -g" |
| 54 |
"-std=c11 -Os -g" |
| 55 |
"-std=c23 -O2 -fno-schedule-insns -fno-schedule-insns2 -DCHECK_ASM --save-temps" |
| 56 |
"-std=gnu90 -O3 -g" |
| 57 |
"-std=gnu23 -Ofast -g" |
| 58 |
} { |
| 59 |
"-DTEST_FULL" |
| 60 |
"-DTEST_OVERLOADS" |
| 61 |
} |
| 62 |
|
| 63 |
# Main loop. |
| 64 |
set files [glob -nocomplain $srcdir/$subdir/acle-asm/*.c] |
| 65 |
set save-dg-do-what-default ${dg-do-what-default} |
| 66 |
if { [check_effective_target_aarch64_asm_sme-i16i64_ok] } { |
| 67 |
set dg-do-what-default assemble |
| 68 |
} else { |
| 69 |
set dg-do-what-default compile |
| 70 |
} |
| 71 |
gcc-dg-runtest [lsort $files] "" "$sme_flags -fno-ipa-icf" |
| 72 |
set dg-do-what-default ${save-dg-do-what-default} |
| 73 |
|
| 74 |
torture-finish |
| 75 |
|
| 76 |
if { [info exists gcc_runtest_parallelize_limit_minor] } { |
| 77 |
set gcc_runtest_parallelize_limit_minor $old_limit_minor |
| 78 |
} |
| 79 |
|
| 80 |
# All done. |
| 81 |
dg-finish |