From c1d9a8f5904a22f2e1e8ec8f52a9dde30c560809 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 3 Apr 2019 18:21:38 +0000 Subject: [PATCH] go-torture.exp: Only add lto to TORTURE_OPTIONS if it is supported. * lib/go-torture.exp: Only add lto to TORTURE_OPTIONS if it is supported. From-SVN: r270133 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/go-torture.exp | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2473b2557ef..eaee0a304a3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-04-03 Clément Chigot + + * lib/go-torture.exp: Only add lto to TORTURE_OPTIONS if it is + supported. + 2019-04-13 Christophe Lyon PR c/71598 diff --git a/gcc/testsuite/lib/go-torture.exp b/gcc/testsuite/lib/go-torture.exp index a7eca184416..097bb9737e7 100644 --- a/gcc/testsuite/lib/go-torture.exp +++ b/gcc/testsuite/lib/go-torture.exp @@ -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. -- 2.30.2