summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/openmp-offload-gpu.c
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-03-13 19:39:19 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-03-13 19:39:19 +0000
commit148046c11b15abc7ba8cfa4ab0ee4c76733c1a3f (patch)
treed15782881fbaace09b83031895935dc0e96fac00 /clang/test/Driver/openmp-offload-gpu.c
parent95da8758980c5723e30c6cfb751f8c9bf0449006 (diff)
downloadbcm5719-llvm-148046c11b15abc7ba8cfa4ab0ee4c76733c1a3f.tar.gz
bcm5719-llvm-148046c11b15abc7ba8cfa4ab0ee4c76733c1a3f.zip
[OpenMP] Add flag for linking runtime bitcode library
Summary: This patch adds an additional flag to the OpenMP device offloading toolchain to link in the runtime library bitcode. Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, grokos, hfinkel Reviewed By: ABataev, grokos Subscribers: jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D43197 llvm-svn: 327438
Diffstat (limited to 'clang/test/Driver/openmp-offload-gpu.c')
-rw-r--r--clang/test/Driver/openmp-offload-gpu.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/Driver/openmp-offload-gpu.c b/clang/test/Driver/openmp-offload-gpu.c
index 16c321b9f49..bc1ecccf2f5 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -142,3 +142,23 @@
// RUN: | FileCheck -check-prefix=CHK-NOLIBDEVICE %s
// CHK-NOLIBDEVICE-NOT: error:{{.*}}sm_60
+
+/// ###########################################################################
+
+/// Check that the runtime bitcode library is part of the compile line. Create a bogus
+/// bitcode library and add it to the LIBRARY_PATH.
+// RUN: env LIBRARY_PATH=%S/Inputs/libomptarget %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN: -Xopenmp-target -march=sm_20 -fopenmp-relocatable-target -save-temps \
+// RUN: -no-canonical-prefixes %s 2>&1 | FileCheck -check-prefix=CHK-BCLIB %s
+
+// CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-cuda-bitcode{{.*}}libomptarget-nvptx-sm_20.bc
+
+/// ###########################################################################
+
+/// Check that the warning is thrown when the libomptarget bitcode library is not found.
+/// Libomptarget requires sm_35 or newer so an sm_20 bitcode library should never exist.
+// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
+// RUN: -Xopenmp-target -march=sm_20 -fopenmp-relocatable-target -save-temps \
+// RUN: -no-canonical-prefixes %s 2>&1 | FileCheck -check-prefix=CHK-BCLIB-WARN %s
+
+// CHK-BCLIB-WARN: No library 'libomptarget-nvptx-sm_20.bc' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.
OpenPOWER on IntegriCloud