aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2011-11-04 18:06:43 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2011-11-04 18:06:43 +0000
commite03af9c4b75a5e24619eaa8aa5eeafed57b2edbe (patch)
treed5ccebc41d8a7ca2e14d638123fd1ab92df3cb37 /gcc
parentd269f788e8e54567a223e49af95b266601285ba9 (diff)
downloadgcc-e03af9c4b75a5e24619eaa8aa5eeafed57b2edbe.zip
gcc-e03af9c4b75a5e24619eaa8aa5eeafed57b2edbe.tar.gz
gcc-e03af9c4b75a5e24619eaa8aa5eeafed57b2edbe.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp21
-rw-r--r--gcc/testsuite/lib/scanasm.exp10
3 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d0e9423..e39ed46 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index caa057f..d0b679d 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -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"
}
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 6574ab1..3ba22f9 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -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 } {