diff options
Diffstat (limited to 'clang/test/OpenMP/declare_simd_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/declare_simd_messages.cpp | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/clang/test/OpenMP/declare_simd_messages.cpp b/clang/test/OpenMP/declare_simd_messages.cpp index e1745aaa116..15971eb14de 100644 --- a/clang/test/OpenMP/declare_simd_messages.cpp +++ b/clang/test/OpenMP/declare_simd_messages.cpp @@ -144,6 +144,57 @@ void test() { #pragma omp declare simd aligned(b: -1) // expected-warning@+1 {{aligned clause will be ignored because the requested alignment is not a power of 2}} #pragma omp declare simd aligned(b: 3) +// expected-error@+1 {{expected '(' after 'linear'}} +#pragma omp declare simd linear +// expected-note@+3 {{to match this '('}} +// expected-error@+2 {{expected ')'}} +// expected-error@+1 {{expected expression}} +#pragma omp declare simd linear( +// expected-error@+1 {{expected expression}} +#pragma omp declare simd linear() +// expected-note@+3 {{to match this '('}} +// expected-error@+2 {{expected ')'}} +// expected-error@+1 {{expected expression}} +#pragma omp declare simd linear(a: +// expected-error@+1 {{expected expression}} +#pragma omp declare simd linear(a:) +// expected-warning@+2 {{extra tokens at the end of '#pragma omp declare simd' are ignored}} +// expected-error@+1 {{expected '(' after 'linear'}} +#pragma omp declare simd linear :) +// expected-note@+3 {{to match this '('}} +// expected-error@+2 {{expected ')'}} +// expected-error@+1 {{invalid use of 'this' outside of a non-static member function}} +#pragma omp declare simd linear(this +// expected-note@+3 {{to match this '('}} +// expected-error@+2 {{expected ')'}} +// expected-error@+1 {{invalid use of 'this' outside of a non-static member function}} +#pragma omp declare simd linear(this,b +// expected-error@+1 {{expected expression}} +#pragma omp declare simd linear(, b) +// expected-note@+4 {{defined as linear}} +// expected-error@+3 {{linear variable cannot be linear}} +// expected-error@+2 {{expected expression}} +// expected-error@+1 {{expected ',' or ')' in 'linear' clause}} +#pragma omp declare simd linear(b) linear(b ; 64) +// expected-note@+2 {{defined as linear}} +// expected-error@+1 {{linear variable cannot be linear}} +#pragma omp declare simd linear(b) linear(b: 64) +#pragma omp declare simd linear(b: -1) +#pragma omp declare simd linear(b: 3) +// expected-error@+1 {{expected a reference to a parameter specified in a 'uniform' clause}} +#pragma omp declare simd linear(b: a) +// expected-note@+2 {{defined as uniform}} +// expected-error@+1 {{linear variable cannot be uniform}} +#pragma omp declare simd uniform(a), linear(a: 4) +// expected-note@+2 {{defined as uniform}} +// expected-error@+1 {{linear variable cannot be uniform}} +#pragma omp declare simd linear(a: 4) uniform(a) +// expected-error@+1 {{variable of non-reference type 'int *' can be used only with 'val' modifier, but used with 'uval'}} +#pragma omp declare simd linear(uval(b)) +// expected-error@+1 {{variable of non-reference type 'int *' can be used only with 'val' modifier, but used with 'ref'}} +#pragma omp declare simd linear(ref(b)) +// expected-error@+1 {{expected one of 'ref', val' or 'uval' modifiers}} +#pragma omp declare simd linear(uref(b)) void bar(int a, int *b); template <class T> @@ -152,11 +203,14 @@ struct St { #pragma init_seg(compiler) #pragma omp declare simd #pragma init_seg(compiler) +// expected-note@+7 {{defined as uniform}} +// expected-error@+6 {{expected a reference to a parameter specified in a 'uniform' clause}} +// expected-error@+5 {{linear variable cannot be uniform}} // expected-note@+4 {{defined as aligned}} // expected-error@+3 {{argument to 'aligned' clause must be a strictly positive integer value}} // expected-error@+2 {{'this' cannot appear in more than one aligned clause}} // expected-error@+1 {{use of undeclared identifier 't'}} -#pragma omp declare simd uniform(this, t) aligned(this: 4) aligned(this: -4) +#pragma omp declare simd uniform(this, t) aligned(this: 4) aligned(this: -4) linear(this: hp) void h(T *hp) { // expected-error@+1 {{unexpected OpenMP directive '#pragma omp declare simd'}} #pragma omp declare simd |