c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on not existing TORTURE_OPTIONS...
authorRichard Biener <rguenther@suse.de>
Mon, 22 Jun 2015 10:45:47 +0000 (10:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 22 Jun 2015 10:45:47 +0000 (10:45 +0000)
2015-06-22  Richard Biener  <rguenther@suse.de>

* lib/c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on
not existing TORTURE_OPTIONS only.
* lib/gcc-dg.exp: Likewise.

From-SVN: r224724

gcc/testsuite/ChangeLog
gcc/testsuite/lib/c-torture.exp
gcc/testsuite/lib/gcc-dg.exp

index 666acc1b2d4579e71eeeb5b8942ad4850c342a37..06ab49726904616b90e5b2d13717adf27fc92938 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-22  Richard Biener  <rguenther@suse.de>
+
+       * lib/c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on
+       not existing TORTURE_OPTIONS only.
+       * lib/gcc-dg.exp: Likewise.
+
 2015-06-22  Christian Bruel  <christian.bruel@st.com>
 
        PR target/52144
index ebac57af9f8de1698b56c013c9bb5381a22593ae..607e7d0435f477c053f210eb6d8088dba7976672 100644 (file)
@@ -22,8 +22,9 @@ load_lib target-libpath.exp
 load_lib target-utils.exp
 
 # The default option list can be overridden by
-# TORTURE_OPTIONS="{ { list1 } ... { listN } }"
+# TORTURE_OPTIONS="{ list1 } ... { listN }"
 
+set LTO_TORTURE_OPTIONS ""
 if [info exists TORTURE_OPTIONS] {
     set C_TORTURE_OPTIONS $TORTURE_OPTIONS
 } else {
@@ -44,6 +45,22 @@ if [info exists TORTURE_OPTIONS] {
        { -O3 -g } \
        { -Os } \
        { -Og -g } ]
+
+    if [check_effective_target_lto] {
+        # When having plugin test both slim and fat LTO and plugin/nonplugin
+        # path.
+        if [check_linker_plugin_available] {
+          set LTO_TORTURE_OPTIONS [list \
+             { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
+             { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
+          ]
+        } else {
+          set LTO_TORTURE_OPTIONS [list \
+             { -O2 -flto -flto-partition=none } \
+             { -O2 -flto }
+          ]
+        }
+    }
 }
 
 if [info exists ADDITIONAL_TORTURE_OPTIONS] {
@@ -65,23 +82,6 @@ if { $orig_environment_saved == 0 } {
     set_ld_library_path_env_vars
 }
 
-set LTO_TORTURE_OPTIONS ""
-if [check_effective_target_lto] {
-    # When having plugin test both slim and fat LTO and plugin/nonplugin
-    # path.
-    if [check_linker_plugin_available] {
-      set LTO_TORTURE_OPTIONS [list \
-         { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
-         { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
-      ]
-    } else {
-      set LTO_TORTURE_OPTIONS [list \
-         { -O2 -flto -flto-partition=none } \
-         { -O2 -flto }
-      ]
-    }
-}
-
 #
 # c-torture-compile -- runs the Tege C-torture test
 #
index 9e4ecce5f9a9008ed8fd035a23b0a2812ea8355c..00ca0c5d116d0b77697bf9c7e08361b3222c4a0a 100644 (file)
@@ -46,6 +46,7 @@ if ![info exists GCC_UNDER_TEST] {
     set GCC_UNDER_TEST "[find_gcc]"
 }
 
+set LTO_TORTURE_OPTIONS ""
 if [info exists TORTURE_OPTIONS] {
     set DG_TORTURE_OPTIONS $TORTURE_OPTIONS
 } else {
@@ -65,6 +66,23 @@ if [info exists TORTURE_OPTIONS] {
        { -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \
        { -O3 -g } \
        { -Os } ]
+
+    if [check_effective_target_lto] {
+        # When having plugin test both slim and fat LTO and plugin/nonplugin
+        # path.
+       if [check_linker_plugin_available] {
+           set LTO_TORTURE_OPTIONS [list \
+             { -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 } \
+             { -O2 -flto }
+           ]
+        }
+    }
 }
 
 if [info exists ADDITIONAL_TORTURE_OPTIONS] {
@@ -87,24 +105,6 @@ if { $orig_environment_saved == 0 } {
 global gcc_force_conventional_output
 set gcc_force_conventional_output ""
 
-set LTO_TORTURE_OPTIONS ""
-if [check_effective_target_lto] {
-    # When having plugin test both slim and fat LTO and plugin/nonplugin
-    # path.
-    if [check_linker_plugin_available] {
-      set LTO_TORTURE_OPTIONS [list \
-         { -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 } \
-         { -O2 -flto }
-      ]
-    }
-}
-
 # Deduce generated files from tool flags, return finalcode string
 proc schedule-cleanups { opts } {
     global additional_sources