summaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorIlya Verbin <ilya.verbin@intel.com>2014-10-14 17:18:04 +0400
committerIlya Verbin <ilya.verbin@intel.com>2014-11-12 15:39:30 +0300
commit60f48f14c673afcabb6dd6830241383b248c64e0 (patch)
tree953e7e896ad99e256707d15f5b79514448095639 /libgomp/testsuite
parent6cf3816b093d697b4051c1d35b1204849ac7df7f (diff)
downloadgcc-kyukhin/gomp4-offload.tar.gz
[PATCH 4/4] OpenMP 4.0 offloading to Intel MIC: non-fallback testingkyukhin/gomp4-offload
2014-10-30 Andrey Turetskiy <andrey.turetskiy@intel.com> Ilya Verbin <ilya.verbin@intel.com> libgomp/ * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Set up offload_additional_options, offload_additional_lib_paths and offload_targets. * testsuite/Makefile.am: Overrule site.exp. * testsuite/Makefile.in: Regenerate. * testsuite/lib/libgomp.exp (libgomp_init): Append offload_additional_lib_paths to LD_LIBRARY_PATH. Append offload_additional_options to ALWAYS_CFLAGS. Append liboffloadmic build directory to LD_LIBRARY_PATH for intelmic offload targets.
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/Makefile.am5
-rw-r--r--libgomp/testsuite/Makefile.in8
-rw-r--r--libgomp/testsuite/lib/libgomp.exp25
3 files changed, 38 insertions, 0 deletions
diff --git a/libgomp/testsuite/Makefile.am b/libgomp/testsuite/Makefile.am
index 561b7e25448..9cc103a1c4d 100644
--- a/libgomp/testsuite/Makefile.am
+++ b/libgomp/testsuite/Makefile.am
@@ -11,3 +11,8 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
_RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
+
+# Used for support non-fallback offloading.
+export OFFLOAD_TARGETS = $(offload_targets)
+export OFFLOAD_ADDITIONAL_OPTIONS = $(offload_additional_options)
+export OFFLOAD_ADDITIONAL_LIB_PATHS = $(offload_additional_lib_paths)
diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in
index 5273eaa2b35..2f845f0c7cb 100644
--- a/libgomp/testsuite/Makefile.in
+++ b/libgomp/testsuite/Makefile.in
@@ -184,6 +184,9 @@ lt_host_flags = @lt_host_flags@
mandir = @mandir@
mkdir_p = @mkdir_p@
multi_basedir = @multi_basedir@
+offload_additional_lib_paths = @offload_additional_lib_paths@
+offload_additional_options = @offload_additional_options@
+offload_targets = @offload_targets@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
@@ -408,6 +411,11 @@ uninstall-am:
uninstall uninstall-am
+# Used for support non-fallback offloading.
+export OFFLOAD_TARGETS = $(offload_targets)
+export OFFLOAD_ADDITIONAL_OPTIONS = $(offload_additional_options)
+export OFFLOAD_ADDITIONAL_LIB_PATHS = $(offload_additional_lib_paths)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 071e22fbf30..a1546847323 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -107,6 +107,25 @@ proc libgomp_init { args } {
# Compute what needs to be put into LD_LIBRARY_PATH
set always_ld_library_path ".:${blddir}/.libs"
+ # Get offload-related variables from environment (exported by Makefile)
+ set offload_targets [getenv OFFLOAD_TARGETS]
+ set offload_additional_options [getenv OFFLOAD_ADDITIONAL_OPTIONS]
+ set offload_additional_lib_paths [getenv OFFLOAD_ADDITIONAL_LIB_PATHS]
+
+ # Add liboffloadmic build directory in LD_LIBRARY_PATH to support
+ # non-fallback testing for Intel MIC targets
+ if { [string match "*-intelmic-*" $offload_targets]
+ || [string match "*-intelmicemul-*" $offload_targets] } {
+ append always_ld_library_path ":${blddir}/../liboffloadmic/.libs"
+ append always_ld_library_path ":${blddir}/../liboffloadmic/plugin/.libs"
+ # libstdc++ is required by liboffloadmic
+ append always_ld_library_path ":${blddir}/../libstdc++-v3/src/.libs"
+ }
+
+ if { $offload_additional_lib_paths != "" } {
+ append always_ld_library_path "${offload_additional_lib_paths}"
+ }
+
# Compute what needs to be added to the existing LD_LIBRARY_PATH.
if {$gccdir != ""} {
# Add AIX pthread directory first.
@@ -169,6 +188,12 @@ proc libgomp_init { args } {
# Disable color diagnostics
lappend ALWAYS_CFLAGS "additional_flags=-fdiagnostics-color=never"
+
+ # Used for support non-fallback offloading.
+ # Help GCC to find target mkoffload.
+ if { $offload_additional_options != "" } {
+ lappend ALWAYS_CFLAGS "additional_flags=${offload_additional_options}"
+ }
}
#