summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/nesting_of_regions.cpp
diff options
context:
space:
mode:
authorKelvin Li <kkwli0@gmail.com>2016-07-01 14:30:25 +0000
committerKelvin Li <kkwli0@gmail.com>2016-07-01 14:30:25 +0000
commitfd8b5748f113adb7357b181e595b96c14baaf224 (patch)
tree6d139558ef5153e919becf5b1eb3dbb849067021 /clang/test/OpenMP/nesting_of_regions.cpp
parentc5a47bb9c1ff4fcd46c04373b6b81a4b5e36dfa2 (diff)
downloadbcm5719-llvm-fd8b5748f113adb7357b181e595b96c14baaf224.tar.gz
bcm5719-llvm-fd8b5748f113adb7357b181e595b96c14baaf224.zip
[OpenMP] Issue warning if a simd construct nested inside another simd
construct llvm-svn: 274352
Diffstat (limited to 'clang/test/OpenMP/nesting_of_regions.cpp')
-rw-r--r--clang/test/OpenMP/nesting_of_regions.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/clang/test/OpenMP/nesting_of_regions.cpp b/clang/test/OpenMP/nesting_of_regions.cpp
index 38012e85961..3694aa9fb4b 100644
--- a/clang/test/OpenMP/nesting_of_regions.cpp
+++ b/clang/test/OpenMP/nesting_of_regions.cpp
@@ -153,7 +153,7 @@ void foo() {
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd
+#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -257,6 +257,16 @@ void foo() {
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
+#pragma omp ordered simd // OK
+ bar();
+ }
+#pragma omp simd
+ for (int i = 0; i < 10; ++i) {
+#pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+ bar();
+ }
+#pragma omp simd
+ for (int i = 0; i < 10; ++i) {
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
@@ -516,7 +526,7 @@ void foo() {
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd
+#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -620,6 +630,16 @@ void foo() {
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
+#pragma omp ordered simd // OK
+ bar();
+ }
+#pragma omp for simd
+ for (int i = 0; i < 10; ++i) {
+#pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+ bar();
+ }
+#pragma omp for simd
+ for (int i = 0; i < 10; ++i) {
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
@@ -1902,7 +1922,7 @@ void foo() {
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd
+#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -4314,7 +4334,7 @@ void foo() {
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd
+#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -4662,7 +4682,7 @@ void foo() {
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd
+#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -6022,7 +6042,7 @@ void foo() {
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd
+#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
OpenPOWER on IntegriCloud