diff options
Diffstat (limited to 'test/OpenMP/for_loop_messages.cpp')
-rw-r--r-- | test/OpenMP/for_loop_messages.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/test/OpenMP/for_loop_messages.cpp b/test/OpenMP/for_loop_messages.cpp index cb32484..f425def 100644 --- a/test/OpenMP/for_loop_messages.cpp +++ b/test/OpenMP/for_loop_messages.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -fopenmp=libiomp5 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s +// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s class S { int a; @@ -10,15 +10,18 @@ public: }; static int sii; -#pragma omp threadprivate(sii) // expected-note {{defined as threadprivate or thread local}} +#pragma omp threadprivate(sii) static int globalii; +register int reg0 __asm__("0"); + int test_iteration_spaces() { const int N = 100; float a[N], b[N], c[N]; int ii, jj, kk; float fii; double dii; + register int reg; // expected-warning {{'register' storage class specifier is deprecated}} #pragma omp parallel #pragma omp for for (int i = 0; i < 10; i += 1) { @@ -305,7 +308,6 @@ int test_iteration_spaces() { #pragma omp parallel { -// expected-error@+2 {{loop iteration variable in the associated loop of 'omp for' directive may not be threadprivate or thread local, predetermined as private}} #pragma omp for for (sii = 0; sii < 10; sii += 1) c[sii] = a[sii]; @@ -313,7 +315,20 @@ int test_iteration_spaces() { #pragma omp parallel { -// expected-error@+2 {{loop iteration variable in the associated loop of 'omp for' directive may not be a variable with global storage without being explicitly marked as private}} +#pragma omp for + for (reg0 = 0; reg0 < 10; reg0 += 1) + c[reg0] = a[reg0]; + } + +#pragma omp parallel + { +#pragma omp for + for (reg = 0; reg < 10; reg += 1) + c[reg] = a[reg]; + } + +#pragma omp parallel + { #pragma omp for for (globalii = 0; globalii < 10; globalii += 1) c[globalii] = a[globalii]; @@ -321,7 +336,6 @@ int test_iteration_spaces() { #pragma omp parallel { -// expected-error@+3 {{loop iteration variable in the associated loop of 'omp for' directive may not be a variable with global storage without being explicitly marked as private}} #pragma omp for collapse(2) for (ii = 0; ii < 10; ii += 1) for (globalii = 0; globalii < 10; globalii += 1) |