From: Richard Biener Date: Mon, 22 Jun 2015 10:45:47 +0000 (+0000) Subject: c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on not existing TORTURE_OPTIONS... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a7611575b2dade35a46f99c67c2a649de2c12ad;p=gcc.git c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on not existing TORTURE_OPTIONS only. 2015-06-22 Richard Biener * lib/c-torture.exp: Set LTO_TORTURE_OPTIONS conditional on not existing TORTURE_OPTIONS only. * lib/gcc-dg.exp: Likewise. From-SVN: r224724 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 666acc1b2d4..06ab4972690 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-06-22 Richard Biener + + * 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 PR target/52144 diff --git a/gcc/testsuite/lib/c-torture.exp b/gcc/testsuite/lib/c-torture.exp index ebac57af9f8..607e7d0435f 100644 --- a/gcc/testsuite/lib/c-torture.exp +++ b/gcc/testsuite/lib/c-torture.exp @@ -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 # diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 9e4ecce5f9a..00ca0c5d116 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -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