diff options
Diffstat (limited to 'test/OpenMP/teams_distribute_simd_linear_messages.cpp')
-rw-r--r-- | test/OpenMP/teams_distribute_simd_linear_messages.cpp | 60 |
1 files changed, 18 insertions, 42 deletions
diff --git a/test/OpenMP/teams_distribute_simd_linear_messages.cpp b/test/OpenMP/teams_distribute_simd_linear_messages.cpp index 6bfdb16274a5..a53f0e62dda2 100644 --- a/test/OpenMP/teams_distribute_simd_linear_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_linear_messages.cpp @@ -18,34 +18,42 @@ void test_linear_colons() { int B = 0; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(B:bfoo()) for (int i = 0; i < 10; ++i) ; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(B::ib:B:bfoo()) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'}} for (int i = 0; i < 10; ++i) ; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(B:ib) // expected-error {{use of undeclared identifier 'ib'; did you mean 'B::ib'}} for (int i = 0; i < 10; ++i) ; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(z:B:ib) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'?}} for (int i = 0; i < 10; ++i) ; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(B:B::bfoo()) for (int i = 0; i < 10; ++i) ; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(X::x : ::z) for (int i = 0; i < 10; ++i) ; +// expected-error@+2 3 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(B,::z, X::x) for (int i = 0; i < 10; ++i) ; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(::z) for (int i = 0; i < 10; ++i) ; @@ -54,6 +62,7 @@ void test_linear_colons() #pragma omp teams distribute simd linear(B::bfoo()) // expected-error {{expected variable name}} for (int i = 0; i < 10; ++i) ; +// expected-error@+2 2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(B::ib,B:C1+C2) for (int i = 0; i < 10; ++i) ; @@ -76,6 +85,7 @@ template<int L, class T, class N> T test_template(T* arr, N num) { template<int LEN> int test_warn() { int ind2 = 0; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(ind2:LEN) // expected-warning {{zero linear step (ind2 should probably be const)}} for (int i = 0; i < 100; i++) { @@ -133,10 +143,12 @@ template<class I, class C> int foomain(I argc, C **argv) { #pragma omp teams distribute simd linear () // expected-error {{expected expression}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; @@ -145,6 +157,7 @@ template<class I, class C> int foomain(I argc, C **argv) { #pragma omp teams distribute simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear (argc : 5) for (int k = 0; k < argc; ++k) ++k; @@ -161,6 +174,7 @@ template<class I, class C> int foomain(I argc, C **argv) { #pragma omp teams distribute simd linear (argv[1]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(e, g) for (int k = 0; k < argc; ++k) ++k; @@ -169,32 +183,11 @@ template<class I, class C> int foomain(I argc, C **argv) { #pragma omp teams distribute simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear(i) for (int k = 0; k < argc; ++k) ++k; - #pragma omp parallel - { - int v = 0; - int i; - #pragma omp target - #pragma omp teams distribute simd linear(v:i) - for (int k = 0; k < argc; ++k) { i = k; v += i; } - } - -#pragma omp target -#pragma omp teams distribute simd linear(j) - for (int k = 0; k < argc; ++k) ++k; - - int v = 0; - -#pragma omp target -#pragma omp teams distribute simd linear(v:j) - for (int k = 0; k < argc; ++k) { ++k; v += j; } - -#pragma omp target -#pragma omp teams distribute simd linear(i) - for (int k = 0; k < argc; ++k) ++k; return 0; } @@ -230,10 +223,12 @@ int main(int argc, char **argv) { #pragma omp teams distribute simd linear () // expected-error {{expected expression}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; @@ -242,6 +237,7 @@ int main(int argc, char **argv) { #pragma omp teams distribute simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; +// expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams distribute simd linear (argc) for (int k = 0; k < argc; ++k) ++k; @@ -267,26 +263,6 @@ int main(int argc, char **argv) { #pragma omp teams distribute simd linear(h, C::x) // expected-error 2 {{threadprivate or thread local variable cannot be linear}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp parallel - { - int i; - #pragma omp target - #pragma omp teams distribute simd linear(i) - for (int k = 0; k < argc; ++k) ++k; - - #pragma omp target - #pragma omp teams distribute simd linear(i : 4) - for (int k = 0; k < argc; ++k) { ++k; i += 4; } - } - -#pragma omp target -#pragma omp teams distribute simd linear(j) - for (int k = 0; k < argc; ++k) ++k; - -#pragma omp target -#pragma omp teams distribute simd linear(i) - for (int k = 0; k < argc; ++k) ++k; - foomain<int,char>(argc,argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}} return 0; } |