From: James Norris Date: Wed, 7 Oct 2015 17:09:46 +0000 (+0000) Subject: atomic-dg.exp (atomic_link_flags): Move flag setting to atomic_init. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=919e06d3f59f9770be5e3968159a46f6c077c9f8;p=gcc.git atomic-dg.exp (atomic_link_flags): Move flag setting to atomic_init. * testsuite/lib/atomic-dg.exp (atomic_link_flags): Move flag setting to atomic_init. (atomic_init): Restrict flags usage. From-SVN: r228575 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2b7094692cd..d06a25f01ab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-07 James Norris + + * testsuite/lib/atomic-dg.exp (atomic_link_flags): Move flag setting + to atomic_init. (atomic_init): Restrict flags usage. + 2015-10-07 Andre Vehreschild PR fortran/65889 diff --git a/gcc/testsuite/lib/atomic-dg.exp b/gcc/testsuite/lib/atomic-dg.exp index fe24127ac84..0640f3c38b7 100644 --- a/gcc/testsuite/lib/atomic-dg.exp +++ b/gcc/testsuite/lib/atomic-dg.exp @@ -48,7 +48,6 @@ proc atomic_link_flags { paths } { set_ld_library_path_env_vars - append flags " -latomic " return "$flags" } @@ -61,6 +60,7 @@ proc atomic_init { args } { global ALWAYS_CXXFLAGS global TOOL_OPTIONS global atomic_saved_TEST_ALWAYS_FLAGS + global atomic_saved_ALWAYS_CXXFLAGS set link_flags "" if ![is_remote host] { @@ -71,10 +71,13 @@ proc atomic_init { args } { } } + append link_flags " -latomic " + if [info exists TEST_ALWAYS_FLAGS] { set atomic_saved_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS } if [info exists ALWAYS_CXXFLAGS] { + set atomic_saved_ALWAYS_CXXFLAGS $ALWAYS_CXXFLAGS set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags}" $ALWAYS_CXXFLAGS] } else { if [info exists TEST_ALWAYS_FLAGS] { @@ -95,11 +98,16 @@ proc atomic_init { args } { proc atomic_finish { args } { global TEST_ALWAYS_FLAGS global atomic_saved_TEST_ALWAYS_FLAGS + global atomic_saved_ALWAYS_CXXFLAGS - if [info exists atomic_saved_TEST_ALWAYS_FLAGS] { - set TEST_ALWAYS_FLAGS $atomic_saved_TEST_ALWAYS_FLAGS + if [info exists atomic_saved_ALWAYS_CXXFLAGS] { + set ALWAYS_CXXFLAGS $atomic_saved_ALWAYS_CXXFLAGS } else { - unset TEST_ALWAYS_FLAGS + if [info exists atomic_saved_TEST_ALWAYS_FLAGS] { + set TEST_ALWAYS_FLAGS $atomic_saved_TEST_ALWAYS_FLAGS + } else { + unset TEST_ALWAYS_FLAGS + } } clear_effective_target_cache }