| 1 |
# Copyright (C) 2009-2025 Free Software Foundation, Inc. |
| 2 |
# Contributed by ARM Ltd. |
| 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 |
load_lib c-torture.exp |
| 21 |
load_lib target-supports.exp |
| 22 |
load_lib torture-options.exp |
| 23 |
|
| 24 |
if { ![istarget aarch64*-*-*] } then { |
| 25 |
return |
| 26 |
} |
| 27 |
|
| 28 |
torture-init |
| 29 |
set-torture-options $C_TORTURE_OPTIONS |
| 30 |
set additional_flags "-W -Wall -Wno-abi -fno-pie -no-pie" |
| 31 |
|
| 32 |
# Test parameter passing. This uses abitest.S which relies on weak |
| 33 |
# symbols. |
| 34 |
|
| 35 |
set additional_flags_for_abitest [add_options_for_weak_undefined ""] |
| 36 |
set additional_flags_for_abitest "$additional_flags $additional_flags_for_abitest" |
| 37 |
|
| 38 |
if { [check_effective_target_weak_undefined] } { |
| 39 |
foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] { |
| 40 |
if {[runtest_file_p $runtests $src]} { |
| 41 |
c-torture-execute [list $src \ |
| 42 |
$srcdir/$subdir/abitest.S] \ |
| 43 |
$additional_flags_for_abitest |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
# Test parameter receiving. |
| 49 |
set additional_flags_for_rec $additional_flags |
| 50 |
append additional_flags_for_rec " -fno-inline" |
| 51 |
foreach src [lsort [glob -nocomplain $srcdir/$subdir/rec_*.c]] { |
| 52 |
if {[runtest_file_p $runtests $src]} { |
| 53 |
c-torture-execute [list $src] \ |
| 54 |
$additional_flags_for_rec |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
# Test unnamed argument retrieval via the va_arg macro. This uses abitest.S |
| 59 |
# which relies on weak symbols. |
| 60 |
if { [check_effective_target_weak_undefined] } { |
| 61 |
foreach src [lsort [glob -nocomplain $srcdir/$subdir/va_arg-*.c]] { |
| 62 |
if {[runtest_file_p $runtests $src]} { |
| 63 |
c-torture-execute [list $src \ |
| 64 |
$srcdir/$subdir/abitest.S] \ |
| 65 |
$additional_flags_for_abitest |
| 66 |
} |
| 67 |
} |
| 68 |
} |
| 69 |
|
| 70 |
# Test function return value. This uses abitest.S which relies on |
| 71 |
# weak symbols. |
| 72 |
if { [check_effective_target_weak_undefined] } { |
| 73 |
# Disable -fipa-ra to prevent the compiler from generating |
| 74 |
# conflicting code. |
| 75 |
set additional_flags_for_func_ret $additional_flags_for_abitest |
| 76 |
append additional_flags_for_func_ret " -fno-ipa-ra" |
| 77 |
foreach src [lsort [glob -nocomplain $srcdir/$subdir/func-ret-*.c]] { |
| 78 |
if {[runtest_file_p $runtests $src]} { |
| 79 |
c-torture-execute [list $src \ |
| 80 |
$srcdir/$subdir/abitest.S] \ |
| 81 |
$additional_flags_for_func_ret |
| 82 |
} |
| 83 |
} |
| 84 |
} |
| 85 |
|
| 86 |
# Test no internal compiler errors. |
| 87 |
foreach src [lsort [glob -nocomplain $srcdir/$subdir/ice_*.c]] { |
| 88 |
if {[runtest_file_p $runtests $src]} { |
| 89 |
c-torture [list $src] \ |
| 90 |
$additional_flags |
| 91 |
} |
| 92 |
} |
| 93 |
|
| 94 |
# Test DFP support |
| 95 |
foreach src [lsort [glob -nocomplain $srcdir/$subdir/dfp*.c]] { |
| 96 |
if {[runtest_file_p $runtests $src]} { |
| 97 |
c-torture [list $src] \ |
| 98 |
$additional_flags |
| 99 |
} |
| 100 |
} |
| 101 |
|
| 102 |
torture-finish |