go-torture.exp: Only add lto to TORTURE_OPTIONS if it is supported.
authorClément Chigot <clement.chigot@atos.net>
Wed, 3 Apr 2019 18:21:38 +0000 (18:21 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 3 Apr 2019 18:21:38 +0000 (18:21 +0000)
* lib/go-torture.exp: Only add lto to TORTURE_OPTIONS if it is
supported.

From-SVN: r270133

gcc/testsuite/ChangeLog
gcc/testsuite/lib/go-torture.exp

index 2473b2557ef252f06c7416ab83bf75b6e2bd7228..eaee0a304a329f300b8c2b6ebcb49285869cfcce 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-03  Clément Chigot  <clement.chigot@atos.net>
+
+       * lib/go-torture.exp: Only add lto to TORTURE_OPTIONS if it is
+       supported.
+
 2019-04-13  Christophe Lyon  <christophe.lyon@linaro.org>
 
        PR c/71598
index a7eca1844167f791788c0821a9f404740d2e95f9..097bb9737e711a9f90192b9f5014f46433cedf0d 100644 (file)
@@ -34,10 +34,13 @@ if ![info exists TORTURE_OPTIONS] {
        { -O2 -fomit-frame-pointer -finline-functions -funroll-loops } \
        { -O2 -fbounds-check } \
        { -O3 -g } \
-       { -Os } \
-       { -flto }]
-}
+       { -Os }]
 
+    if [check_effective_target_lto] {
+       set TORTURE_OPTIONS \
+           [concat $TORTURE_OPTIONS [list {-flto}]]
+    }
+}
 
 #
 # go-torture-compile -- compile a go.go-torture testcase.