+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
}
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.
{ -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 } \
}
}
+ # 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"
}
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.
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 } {