diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2024-10-09 13:57:36 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2024-10-09 13:57:36 +0100 |
commit | b94331d9a3f7efb451bfad9db0fda162d3c46748 (patch) | |
tree | 711f2edb8557ede0167b031c73f0ad732ee7dad8 /gcc | |
parent | 9a5ac633f0f49c819f2745584475051c9eb8f6e0 (diff) | |
download | gcc-b94331d9a3f7efb451bfad9db0fda162d3c46748.zip gcc-b94331d9a3f7efb451bfad9db0fda162d3c46748.tar.gz gcc-b94331d9a3f7efb451bfad9db0fda162d3c46748.tar.bz2 |
testsuite: Make check-function-bodies work with LTO
This patch tries to make check-function-bodies automatically
choose between reading the regular assembly file and reading the
LTO assembly file. There should only ever be one right answer,
since check-function-bodies doesn't make sense on slim LTO output.
Maybe this will turn out to be impossible to get right, but I'd like
to try at least.
gcc/testsuite/
* lib/scanasm.exp (check-function-bodies): Look in ltrans0.ltrans.s
if the test appears to be using LTO.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/lib/scanasm.exp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 737eefc..26504de 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -997,16 +997,17 @@ proc check-function-bodies { args } { error "too many arguments to check-function-bodies" } + upvar 2 dg-extra-tool-flags extra_tool_flags + set flags $extra_tool_flags + + global torture_current_flags + if { [info exists torture_current_flags] } { + append flags " " $torture_current_flags + } + if { [llength $args] >= 3 } { set required_flags [lindex $args 2] - upvar 2 dg-extra-tool-flags extra_tool_flags - set flags $extra_tool_flags - - global torture_current_flags - if { [info exists torture_current_flags] } { - append flags " " $torture_current_flags - } foreach required_flag $required_flags { switch -- $required_flag { target - @@ -1043,7 +1044,14 @@ proc check-function-bodies { args } { global srcdir set input_filename "$srcdir/$filename" - set output_filename "[file rootname [file tail $filename]].s" + set output_filename "[file rootname [file tail $filename]]" + if { [string match "* -flto *" " ${flags} "] + && ![string match "* -fno-use-linker-plugin *" " ${flags} "] + && ![string match "* -ffat-lto-objects *" " ${flags} "] } { + append output_filename ".ltrans0.ltrans.s" + } else { + append output_filename ".s" + } set prefix [lindex $args 0] set prefix_len [string length $prefix] |