summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/target_map_messages.cpp
diff options
context:
space:
mode:
authorCarlo Bertolli <cbertol@us.ibm.com>2016-03-18 21:43:32 +0000
committerCarlo Bertolli <cbertol@us.ibm.com>2016-03-18 21:43:32 +0000
commitb74bfc80a434b645bddeb5865c28a3bdaa5440b8 (patch)
treec333045a0c346a158f42cda8032f1b3cf6d2e3f7 /clang/test/OpenMP/target_map_messages.cpp
parent9359b8fe5d944c8355ea49ba949d481fe080cec9 (diff)
downloadbcm5719-llvm-b74bfc80a434b645bddeb5865c28a3bdaa5440b8.tar.gz
bcm5719-llvm-b74bfc80a434b645bddeb5865c28a3bdaa5440b8.zip
[OPENMP] Implementation of codegen for firstprivate clause of target directive
This patch implements the following aspects: It extends sema to check that a variable is not reference in both a map clause and firstprivate or private. This is needed to ensure correct functioning at codegen level, apart from being useful for the user. It implements firstprivate for target in codegen. The implementation applies to both host and nvptx devices. It adds regression tests for codegen of firstprivate, host and device side when using the host as device, and nvptx side. Please note that the regression test for nvptx codegen is missing VLAs. This is because VLAs currently require saving and restoring the stack which appears not to be a supported operation by nvptx backend. It adds a check in sema regression tests for target map, firstprivate, and private clauses. http://reviews.llvm.org/D18203 llvm-svn: 263837
Diffstat (limited to 'clang/test/OpenMP/target_map_messages.cpp')
-rw-r--r--clang/test/OpenMP/target_map_messages.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/OpenMP/target_map_messages.cpp b/clang/test/OpenMP/target_map_messages.cpp
index 8d4df4be30b..baa0751abcd 100644
--- a/clang/test/OpenMP/target_map_messages.cpp
+++ b/clang/test/OpenMP/target_map_messages.cpp
@@ -500,6 +500,10 @@ int main(int argc, char **argv) {
#pragma omp target data map(always, tofrom: always, tofrom, x)
#pragma omp target map(tofrom j) // expected-error {{expected ',' or ')' in 'map' clause}}
foo();
+#pragma omp target private(j) map(j) // expected-error {{private variable cannot be in a map clause in '#pragma omp target' directive}} expected-note {{defined as private}}
+ {}
+#pragma omp target firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target' directive}} expected-note {{defined as firstprivate}}
+ {}
return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}}
}
#endif
OpenPOWER on IntegriCloud