OSDN Git Service

* lib/gcc-dg.exp (gcc_force_conventional_output): New global
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Nov 2011 18:06:43 +0000 (18:06 +0000)
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Nov 2011 18:06:43 +0000 (18:06 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180972 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/scanasm.exp

index d0e9423..e39ed46 100644 (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
index caa057f..d0b679d 100644 (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"
     }
index 6574ab1..3ba22f9 100644 (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 } {