1 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp \
2 // RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions %s
4 // RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -verify -fopenmp \
5 // RUN: -x c++ -std=c++14 -fexceptions -fcxx-exceptions %s
8 #pragma omp declare variant(disp_variant) \
9 match(construct = {dispatch}, device = {arch(arm)})
13 int disp_method_variant1();
14 #pragma omp declare variant(disp_method_variant1) \
15 match(construct={dispatch}, device={arch(arm)})
17 int disp_method_variant2();
18 #pragma omp declare variant(disp_method_variant2) \
19 match(construct={dispatch}, device={arch(arm)})
23 void testit_one(int dnum
) {
24 // expected-error@+1 {{cannot contain more than one 'device' clause}}
25 #pragma omp dispatch device(dnum) device(3)
28 // expected-error@+1 {{cannot contain more than one 'nowait' clause}}
29 #pragma omp dispatch nowait device(dnum) nowait
32 // expected-error@+1 {{expected '(' after 'novariants'}}
33 #pragma omp dispatch novariants
36 // expected-error@+3 {{expected expression}}
37 // expected-error@+2 {{expected ')'}}
38 // expected-note@+1 {{to match this '('}}
39 #pragma omp dispatch novariants (
42 // expected-error@+1 {{cannot contain more than one 'novariants' clause}}
43 #pragma omp dispatch novariants(dnum> 4) novariants(3)
46 // expected-error@+1 {{use of undeclared identifier 'x'}}
47 #pragma omp dispatch novariants(x)
50 // expected-error@+1 {{expected '(' after 'nocontext'}}
51 #pragma omp dispatch nocontext
54 // expected-error@+3 {{expected expression}}
55 // expected-error@+2 {{expected ')'}}
56 // expected-note@+1 {{to match this '('}}
57 #pragma omp dispatch nocontext (
60 // expected-error@+1 {{cannot contain more than one 'nocontext' clause}}
61 #pragma omp dispatch nocontext(dnum> 4) nocontext(3)
64 // expected-error@+1 {{use of undeclared identifier 'x'}}
65 #pragma omp dispatch nocontext(x)
70 //expected-error@+2 {{cannot return from OpenMP region}}
75 void testit_three(int (*fptr
)(void), Obj
*obj
, int (Obj::*mptr
)(void)) {
76 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
80 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
86 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
90 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
95 void testit_four(int *x
, int y
, Obj
*obj
)
97 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
101 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
103 y
= disp_call() + disp_call();
105 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
107 y
= (y
= disp_call());
109 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
113 //expected-error@+2 {{statement after '#pragma omp dispatch' must be a direct call to a target function or an assignment to one}}
115 for (int I
= 0; I
< 8; ++I
) {