summaryrefslogtreecommitdiffstats
path: root/openmp
diff options
context:
space:
mode:
authorJoachim Protze <protze@itc.rwth-aachen.de>2018-07-05 09:14:06 +0000
committerJoachim Protze <protze@itc.rwth-aachen.de>2018-07-05 09:14:06 +0000
commitb41c61eed456415961de9f4c99aa7501d7365b82 (patch)
treea2fd66764c098efbb7c13cf1ada8b2be21aa22fc /openmp
parent00505b85a3fb6f6e4b095ebb6b753e7a376a7d3e (diff)
downloadbcm5719-llvm-b41c61eed456415961de9f4c99aa7501d7365b82.tar.gz
bcm5719-llvm-b41c61eed456415961de9f4c99aa7501d7365b82.zip
Dropped non-supoorted "--no-as-needed" flag from OMPT tests for macOS
The flag "--no-as-needed" is not recognized by the linker on macOS making the following tests fail: ompt/loadtool/tool_available/tool_available.c ompt/loadtool/tool_not_available/tool_not_available.c This patch removes this flag for macOS and adds it only for Linux and Windows. I tested it on Ubuntu 16.04 and macOS HighSierra, with Clang/LLVM 6.0.1 and OpenMP trunk. This solution was also discussed in the OpenMP-dev mailing list. Patch provided by Simone Atzeni Differential Revision: https://reviews.llvm.org/D48888 llvm-svn: 336327
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/test/lit.cfg4
-rw-r--r--openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c4
-rw-r--r--openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 22969871433..e4561ebc30b 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -120,7 +120,11 @@ if config.has_ompt:
if config.operating_system == 'Windows':
# No such environment variable on Windows.
config.substitutions.append(("%preload-tool", "true ||"))
+ config.substitutions.append(("%no-as-needed-flag", "-Wl,--no-as-needed"))
elif config.operating_system == 'Darwin':
config.substitutions.append(("%preload-tool", "env DYLD_INSERT_LIBRARIES=%T/tool.so"))
+ # No such linker flag on Darwin.
+ config.substitutions.append(("%no-as-needed-flag", ""))
else:
config.substitutions.append(("%preload-tool", "env LD_PRELOAD=%T/tool.so"))
+ config.substitutions.append(("%no-as-needed-flag", "-Wl,--no-as-needed"))
diff --git a/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c b/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c
index dc00b033daa..fbbdadd5c42 100644
--- a/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c
+++ b/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c
@@ -7,9 +7,9 @@
// RUN: %clang %flags -DTOOL -shared -fPIC %s -o %T/tool.so
// 2. "introducing a dynamically-linked library that includes the tool’s definition of ompt_start_tool into the application’s address space"
// 2.1 Link with tool during compilation
-// RUN: %libomp-compile -DCODE -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
+// RUN: %libomp-compile -DCODE %no-as-needed-flag %T/tool.so && %libomp-run | FileCheck %s
// 2.2 Link with tool during compilation, but AFTER the runtime
-// RUN: %libomp-compile -DCODE -lomp -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
+// RUN: %libomp-compile -DCODE -lomp %no-as-needed-flag %T/tool.so && %libomp-run | FileCheck %s
// 2.3 Inject tool via the dynamic loader
// RUN: %libomp-compile -DCODE && %preload-tool %libomp-run | FileCheck %s
diff --git a/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c b/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c
index e25e7374055..b0d3f2bcf5b 100644
--- a/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c
+++ b/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c
@@ -7,9 +7,9 @@
// RUN: %clang %flags -DTOOL -shared -fPIC %s -o %T/tool.so
// 2. "introducing a dynamically-linked library that includes the tool’s definition of ompt_start_tool into the application’s address space"
// 2.1 Link with tool during compilation
-// RUN: %libomp-compile -DCODE -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
+// RUN: %libomp-compile -DCODE %no-as-needed-flag %T/tool.so && %libomp-run | FileCheck %s
// 2.2 Link with tool during compilation, but AFTER the runtime
-// RUN: %libomp-compile -DCODE -lomp -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
+// RUN: %libomp-compile -DCODE -lomp %no-as-needed-flag %T/tool.so && %libomp-run | FileCheck %s
// 2.3 Inject tool via the dynamic loader
// RUN: %libomp-compile -DCODE && %preload-tool %libomp-run | FileCheck %s
OpenPOWER on IntegriCloud