summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/target_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/OpenMP/target_messages.cpp')
-rw-r--r--clang/test/OpenMP/target_messages.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/OpenMP/target_messages.cpp b/clang/test/OpenMP/target_messages.cpp
index c9dc80aca44..4fa8272ab45 100644
--- a/clang/test/OpenMP/target_messages.cpp
+++ b/clang/test/OpenMP/target_messages.cpp
@@ -15,6 +15,7 @@
// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc -DREGION_HOST
// RUN: not %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -DREGION_DEVICE 2>&1 | FileCheck %s --check-prefix NO-REGION
// NO-REGION: Offloading entry for target region is incorrect: either the address or the ID is invalid.
+// NO-REGION-NOT: Offloading entry for target region is incorrect: either the address or the ID is invalid.
#if defined(REGION_HOST) || defined(REGION_DEVICE)
void foo() {
@@ -27,6 +28,17 @@ void foo() {
;
#endif
}
+#pragma omp declare target to(foo)
+void bar() {
+#ifdef REGION_HOST
+#pragma omp target
+ ;
+#endif
+#ifdef REGION_DEVICE
+#pragma omp target
+ ;
+#endif
+}
#else
void foo() {
}
OpenPOWER on IntegriCloud