diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-03-28 06:57:54 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-03-28 06:57:54 +0000 |
commit | 10b5f23cf3f18a0c23b421f7c52f2b95a09bc20f (patch) | |
tree | 304c1783eae708a6dfc6b3a0a60f40ed83bbfa49 /gcc/testsuite/lib | |
parent | 24060bf97ef55b35abd20a8a6d9e5c1b31e2c1fe (diff) | |
download | ppe42-gcc-10b5f23cf3f18a0c23b421f7c52f2b95a09bc20f.tar.gz ppe42-gcc-10b5f23cf3f18a0c23b421f7c52f2b95a09bc20f.zip |
2014-03-28 Tobias Burnus <burnus@net-b.de>
* lib/cilk-plus-dg.exp: New.
* g++.dg/cilk-plus/cilk-plus.exp: Use it.
* gcc.dg/cilk-plus/cilk-plus.exp: Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208889 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/cilk-plus-dg.exp | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/cilk-plus-dg.exp b/gcc/testsuite/lib/cilk-plus-dg.exp new file mode 100644 index 00000000000..bfb4b71de4c --- /dev/null +++ b/gcc/testsuite/lib/cilk-plus-dg.exp @@ -0,0 +1,104 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# +# cilkplus_link_flags -- compute library path and flags to find libcilkrts. +# (originally from g++.exp) +# + +proc cilkplus_link_flags { paths } { + global srcdir + global ld_library_path + global shlib_ext + + set gccpath ${paths} + set flags "" + + set shlib_ext [get_shlib_extension] + + if { $gccpath != "" } { + if { [file exists "${gccpath}/libcilkrts/.libs/libcilkrts.a"] + || [file exists "${gccpath}/libcilkrts/.libs/libcilkrts.${shlib_ext}"] } { + append flags " -B${gccpath}/libcilkrts/ " + append flags " -L${gccpath}/libcilkrts/.libs" + append ld_library_path ":${gccpath}/libcilkrts/.libs" + } + } else { + global tool_root_dir + + set libcilkrts [lookfor_file ${tool_root_dir} libcilkrts] + if { $libcilkrts != "" } { + append flags "-L${libcilkrts} " + append ld_library_path ":${libcilkrts}" + } + } + + set_ld_library_path_env_vars + + return "$flags" +} + +# +# cilkplus_init -- called at the start of each subdir of tests +# + +proc cilkplus_init { args } { + global TEST_ALWAYS_FLAGS + global ALWAYS_CXXFLAGS + global TOOL_OPTIONS + global cilkplus_saved_TEST_ALWAYS_FLAGS + + set link_flags "" + if ![is_remote host] { + if [info exists TOOL_OPTIONS] { + set link_flags "[cilkplus_link_flags [get_multilibs ${TOOL_OPTIONS}]]" + } else { + set link_flags "[cilkplus_link_flags [get_multilibs]]" + } + } + + if [info exists TEST_ALWAYS_FLAGS] { + set cilkplus_saved_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS + } + if [info exists ALWAYS_CXXFLAGS] { + set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags}" $ALWAYS_CXXFLAGS] + } else { + if [info exists TEST_ALWAYS_FLAGS] { + set TEST_ALWAYS_FLAGS "$link_flags $TEST_ALWAYS_FLAGS" + } else { + set TEST_ALWAYS_FLAGS "$link_flags" + } + } + if { $link_flags != "" } { + return 1 + } + return 0 +} + +# +# cilkplus_finish -- called at the end of each subdir of tests +# + +proc cilkplus_finish { args } { + global TEST_ALWAYS_FLAGS + global cilkplus_saved_TEST_ALWAYS_FLAGS + + if [info exists cilkplus_saved_TEST_ALWAYS_FLAGS] { + set TEST_ALWAYS_FLAGS $cilkplus_saved_TEST_ALWAYS_FLAGS + } else { + unset TEST_ALWAYS_FLAGS + } +} |