diff options
Diffstat (limited to 'libgomp/testsuite/lib/libgomp.exp')
-rw-r--r-- | libgomp/testsuite/lib/libgomp.exp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 071e22f..a154684 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}" + } } # |