gcc-dg.exp (gcc_force_conventional_output): New global variable, default empty, -ffat-lto-objects for effective_target_lto.

* lib/gcc-dg.exp (gcc_force_conventional_output): New global
	variable, default empty, -ffat-lto-objects for effective_target_lto.
	(gcc-dg-test-1): Add options from dg-final methods.
	* lib/scanasm.exp (scan-assembler_required_options)
	(scan-assembler-not_required_options): New procs.

From-SVN: r180972
This commit is contained in:
Hans-Peter Nilsson 2011-11-04 18:06:43 +00:00 committed by Hans-Peter Nilsson
parent d269f788e8
commit e03af9c4b7
3 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2011-11-04 Hans-Peter Nilsson <hp@axis.com>
* lib/gcc-dg.exp (gcc_force_conventional_output): New global
variable, default empty, -ffat-lto-objects for effective_target_lto.
(gcc-dg-test-1): Add options from dg-final methods.
* lib/scanasm.exp (scan-assembler_required_options)
(scan-assembler-not_required_options): New procs.
2011-10-09 Magnus Fromreide <magfr@lysator.liu.se>
* g++.dg/cpp0x/enum21a.C: Test that enum x { y, } does

View File

@ -73,6 +73,13 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] {
}
set LTO_TORTURE_OPTIONS ""
# Some torture-options cause intermediate code output, unusable for
# testing using e.g. scan-assembler. In this variable are the options
# how to force it, when needed.
global gcc_force_conventional_output
set gcc_force_conventional_output ""
if [check_effective_target_lto] {
# When having plugin test both slim and fat LTO and plugin/nonplugin
# path.
@ -81,6 +88,7 @@ if [check_effective_target_lto] {
{ -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
{ -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
]
set gcc_force_conventional_output "-ffat-lto-objects"
} else {
set LTO_TORTURE_OPTIONS [list \
{ -O2 -flto -flto-partition=none } \
@ -156,6 +164,19 @@ proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } {
}
}
# Let { dg-final { action } } force options as returned by an
# optional proc ${action}_required_options.
upvar 2 dg-final-code finalcode
foreach x [split $finalcode "\n"] {
set finalcmd [lindex $x 0]
if { [info procs ${finalcmd}_required_options] != "" } {
set req [${finalcmd}_required_options]
if { $req != "" } {
lappend extra_tool_flags $req
}
}
}
if { $extra_tool_flags != "" } {
lappend options "additional_flags=$extra_tool_flags"
}

View File

@ -85,6 +85,11 @@ proc scan-assembler { args } {
dg-scan "scan-assembler" 1 $testcase $output_file $args
}
proc scan-assembler_required_options { args } {
global gcc_force_conventional_output
return $gcc_force_conventional_output
}
# Check that a pattern is not present in the .s file produced by the
# compiler. See dg-scan for details.
@ -96,6 +101,11 @@ proc scan-assembler-not { args } {
dg-scan "scan-assembler-not" 0 $testcase $output_file $args
}
proc scan-assembler-not_required_options { args } {
global gcc_force_conventional_output
return $gcc_force_conventional_output
}
# Return the scan for the assembly for hidden visibility.
proc hidden-scan-for { symbol } {