summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/nesting_of_regions.cpp
diff options
context:
space:
mode:
authorArpith Chacko Jacob <acjacob@us.ibm.com>2016-02-01 16:32:47 +0000
committerArpith Chacko Jacob <acjacob@us.ibm.com>2016-02-01 16:32:47 +0000
commitf1958627d9cc6fde9fba025af2ed4c1566d1da04 (patch)
treeac60309f7f96099c7df60a89283219a53bd8c7d8 /clang/test/OpenMP/nesting_of_regions.cpp
parent04bf91a8c1c6faaedf3f20dff6b795cc13e1071e (diff)
downloadbcm5719-llvm-f1958627d9cc6fde9fba025af2ed4c1566d1da04.tar.gz
bcm5719-llvm-f1958627d9cc6fde9fba025af2ed4c1566d1da04.zip
[OpenMP] Prevent nesting of target constructs within target code execution regions.
Summary: This patch enhances Sema to check for the following restriction: OpenMP 4.5 [2.17 Nesting of Regions] If a target, target update, target data, target enter data, or target exit data construct is encountered during execution of a target region, the behavior is unspecified. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16758 llvm-svn: 259366
Diffstat (limited to 'clang/test/OpenMP/nesting_of_regions.cpp')
-rw-r--r--clang/test/OpenMP/nesting_of_regions.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/clang/test/OpenMP/nesting_of_regions.cpp b/clang/test/OpenMP/nesting_of_regions.cpp
index ebab809c562..4fa6cac01a6 100644
--- a/clang/test/OpenMP/nesting_of_regions.cpp
+++ b/clang/test/OpenMP/nesting_of_regions.cpp
@@ -2666,12 +2666,12 @@ void foo() {
}
#pragma omp target
{
-#pragma omp target
+#pragma omp target // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
{
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
@@ -2699,11 +2699,11 @@ void foo() {
}
#pragma omp target
{
-#pragma omp target enter data map(to: a)
+#pragma omp target enter data map(to: a) // expected-error {{region cannot be nested inside 'target' region}}
}
#pragma omp target
{
-#pragma omp target exit data map(from: a)
+#pragma omp target exit data map(from: a) // expected-error {{region cannot be nested inside 'target' region}}
}
// TARGET PARALLEL DIRECTIVE
@@ -2796,12 +2796,12 @@ void foo() {
}
#pragma omp target parallel
{
-#pragma omp target
+#pragma omp target // expected-error {{region cannot be nested inside 'target parallel' region}}
++a;
}
#pragma omp target parallel
{
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target parallel' region}}
++a;
}
#pragma omp target parallel
@@ -2829,11 +2829,11 @@ void foo() {
}
#pragma omp target parallel
{
-#pragma omp target enter data map(to: a)
+#pragma omp target enter data map(to: a) // expected-error {{region cannot be nested inside 'target parallel' region}}
}
#pragma omp target parallel
{
-#pragma omp target exit data map(from: a)
+#pragma omp target exit data map(from: a) // expected-error {{region cannot be nested inside 'target parallel' region}}
}
// TEAMS DIRECTIVE
@@ -2952,7 +2952,7 @@ void foo() {
#pragma omp target
#pragma omp teams
{
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
@@ -3337,28 +3337,28 @@ void foo() {
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target
+#pragma omp target // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target enter data map(to: a)
+#pragma omp target enter data map(to: a) // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target exit data map(from: a)
+#pragma omp target exit data map(from: a) // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
@@ -5807,21 +5807,21 @@ void foo() {
}
#pragma omp target
{
-#pragma omp target
+#pragma omp target // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
{
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
{
-#pragma omp target enter data map(to: a)
+#pragma omp target enter data map(to: a) // expected-error {{region cannot be nested inside 'target' region}}
}
#pragma omp target
{
-#pragma omp target exit data map(from: a)
+#pragma omp target exit data map(from: a) // expected-error {{region cannot be nested inside 'target' region}}
}
#pragma omp target
{
@@ -5937,12 +5937,12 @@ void foo() {
}
#pragma omp target parallel
{
-#pragma omp target
+#pragma omp target // expected-error {{region cannot be nested inside 'target parallel' region}}
++a;
}
#pragma omp target parallel
{
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target parallel' region}}
++a;
}
#pragma omp target parallel
@@ -5970,11 +5970,11 @@ void foo() {
}
#pragma omp target parallel
{
-#pragma omp target enter data map(to: a)
+#pragma omp target enter data map(to: a) // expected-error {{region cannot be nested inside 'target parallel' region}}
}
#pragma omp target parallel
{
-#pragma omp target exit data map(from: a)
+#pragma omp target exit data map(from: a) // expected-error {{region cannot be nested inside 'target parallel' region}}
}
// TEAMS DIRECTIVE
@@ -6093,7 +6093,7 @@ void foo() {
#pragma omp target
#pragma omp teams
{
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
@@ -6477,14 +6477,14 @@ void foo() {
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target
+#pragma omp target // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel
+#pragma omp target parallel // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
@@ -6499,14 +6499,14 @@ void foo() {
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target enter data map(to: a)
+#pragma omp target enter data map(to: a) // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
#pragma omp target
#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
-#pragma omp target exit data map(from: a)
+#pragma omp target exit data map(from: a) // expected-error {{region cannot be nested inside 'target' region}}
++a;
}
}
OpenPOWER on IntegriCloud