summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/for_misc_messages.c
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-07-25 06:27:47 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-07-25 06:27:47 +0000
commitcaf09b01fc69450bb385cdd107cd3a6efc851b83 (patch)
tree8909d4c6a451313886f9c1f6a9b66cb1ec9a19dc /clang/test/OpenMP/for_misc_messages.c
parent16e47ff42e7ec10b20152f74b98380856c0ad534 (diff)
downloadbcm5719-llvm-caf09b01fc69450bb385cdd107cd3a6efc851b83.tar.gz
bcm5719-llvm-caf09b01fc69450bb385cdd107cd3a6efc851b83.zip
[OPENMP] Improved DSA processing of the loop control variables for loop directives.
llvm-svn: 213925
Diffstat (limited to 'clang/test/OpenMP/for_misc_messages.c')
-rw-r--r--clang/test/OpenMP/for_misc_messages.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/OpenMP/for_misc_messages.c b/clang/test/OpenMP/for_misc_messages.c
index 854898c0443..99e6a2b7d5f 100644
--- a/clang/test/OpenMP/for_misc_messages.c
+++ b/clang/test/OpenMP/for_misc_messages.c
@@ -190,6 +190,16 @@ void test_collapse() {
#pragma omp for collapse(5 - 5)
for (i = 0; i < 16; ++i)
;
+#pragma omp parallel
+#pragma omp for collapse(2)
+ for (i = 0; i < 16; ++i)
+// expected-note@+1 {{variable with automatic storage duration is predetermined as private; perhaps you forget to enclose 'omp for' directive into a parallel or another task region?}}
+ for (int j = 0; j < 16; ++j)
+// expected-error@+2 {{private variable cannot be reduction}}
+// expected-error@+1 {{region cannot be closely nested inside 'for' region; perhaps you forget to enclose 'omp for' directive into a parallel region?}}
+#pragma omp for reduction(+ : i, j)
+ for (int k = 0; k < 16; ++k)
+ i += j;
}
void test_private() {
OpenPOWER on IntegriCloud