| 1 |
# |
| 2 |
# Expect driver script for GCC Regression Tests |
| 3 |
# Copyright (C) 1993-2025 Free Software Foundation, Inc. |
| 4 |
# |
| 5 |
# This file is free software; you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation; either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with GCC; see the file COPYING3. If not see |
| 17 |
# <http://www.gnu.org/licenses/>. |
| 18 |
# |
| 19 |
# Written by Jeffrey Wheat ([email protected]) |
| 20 |
# |
| 21 |
|
| 22 |
# Load support procs. |
| 23 |
load_lib gcc-dg.exp |
| 24 |
load_lib torture-options.exp |
| 25 |
load_lib c-torture.exp |
| 26 |
|
| 27 |
# These tests come from Torbjorn Granlund's ([email protected]) |
| 28 |
# C torture test suite, and other contributors. |
| 29 |
|
| 30 |
# Disable tests on machines with no hardware support for IEEE arithmetic. |
| 31 |
if { [istarget "vax-*-*"] || [ istarget "powerpc-*-*spe"] || [istarget "pdp11-*-*"] } { return } |
| 32 |
|
| 33 |
if $tracelevel then { |
| 34 |
strace $tracelevel |
| 35 |
} |
| 36 |
|
| 37 |
torture-init |
| 38 |
set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS |
| 39 |
|
| 40 |
set additional_flags "-fno-inline" |
| 41 |
|
| 42 |
# We must use -ffloat-store/-mieee to ensure that excess precision on some |
| 43 |
# machines does not cause problems |
| 44 |
if { ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) |
| 45 |
&& [check_effective_target_ia32] } then { |
| 46 |
lappend additional_flags "-ffloat-store" |
| 47 |
} |
| 48 |
if [istarget "m68k-*-*"] then { |
| 49 |
lappend additional_flags "-ffloat-store" |
| 50 |
} |
| 51 |
if { [istarget "alpha*-*-*"] |
| 52 |
|| [istarget "sh*-*-*"] } then { |
| 53 |
lappend additional_flags "-mieee" |
| 54 |
} |
| 55 |
if [istarget rx-*-*] then { |
| 56 |
lappend additional_flags "-mnofpu" |
| 57 |
} |
| 58 |
|
| 59 |
if { ![check_effective_target_signal] } { |
| 60 |
lappend additional_flags "-DSIGNAL_SUPPRESS" |
| 61 |
} |
| 62 |
|
| 63 |
# load support procs |
| 64 |
load_lib c-torture.exp |
| 65 |
|
| 66 |
# initialize harness |
| 67 |
gcc_init |
| 68 |
|
| 69 |
# |
| 70 |
# main test loop |
| 71 |
# |
| 72 |
|
| 73 |
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { |
| 74 |
# If we're only testing specific files and this isn't one of them, skip it. |
| 75 |
if ![runtest_file_p $runtests $src] then { |
| 76 |
continue |
| 77 |
} |
| 78 |
|
| 79 |
c-torture-execute $src $additional_flags |
| 80 |
} |
| 81 |
|
| 82 |
# All done. |
| 83 |
torture-finish |
| 84 |
gcc_finish |