summaryrefslogtreecommitdiff
path: root/test/OpenMP/target_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/OpenMP/target_messages.cpp')
-rw-r--r--test/OpenMP/target_messages.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/OpenMP/target_messages.cpp b/test/OpenMP/target_messages.cpp
index c9dc80aca44c8..9bd8b3749e055 100644
--- a/test/OpenMP/target_messages.cpp
+++ b/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,10 +28,33 @@ 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() {
}
+class S {
+ public:
+ void zee() {
+ #pragma omp target map(this[:2]) // expected-note {{expected length on mapping of 'this' array section expression to be '1'}} // expected-error {{invalid 'this' expression on 'map' clause}}
+ int a;
+ #pragma omp target map(this[1:1]) // expected-note {{expected lower bound on mapping of 'this' array section expression to be '0' or not specified}} // expected-error {{invalid 'this' expression on 'map' clause}}
+ int b;
+ #pragma omp target map(this[1]) // expected-note {{expected 'this' subscript expression on map clause to be 'this[0]'}} // expected-error {{invalid 'this' expression on 'map' clause}}
+ int c;
+ }
+};
+
#pragma omp target // expected-error {{unexpected OpenMP directive '#pragma omp target'}}
int main(int argc, char **argv) {