1 // RUN: %clang_cc1 %s -verify -fopenacc 2 3 // expected-error@+1{{OpenACC construct 'parallel' cannot be used here; it can only be used in a statement context}} 4 #pragma acc parallel 5 6 // expected-error@+1{{OpenACC construct 'parallel' cannot be used here; it can only be used in a statement context}} 7 #pragma acc parallel 8 int foo; 9 10 struct S { 11 // expected-error@+1{{OpenACC construct 'parallel' cannot be used here; it can only be used in a statement context}} 12 #pragma acc parallel 13 int foo; 14 mem_funcS15void mem_func() { 16 // FIXME: Should we disallow this on declarations, or consider this to be on 17 // the initialization? 18 #pragma acc parallel 19 int foo; 20 21 #pragma acc parallel 22 { 23 } 24 25 #pragma acc parallel 26 while(0){} 27 28 #pragma acc parallel 29 for(;;){} 30 31 // expected-error@+2{{expected statement}} 32 #pragma acc parallel 33 } 34 35 }; 36 37 template<typename T> func()38void func() { 39 // FIXME: Should we disallow this on declarations, and consider this to be on 40 // the initialization? 41 #pragma acc parallel 42 int foo; 43 44 #pragma acc parallel 45 { 46 } 47 48 #pragma acc parallel 49 while(0){} 50 51 #pragma acc parallel 52 for(;;){} 53 54 #pragma acc parallel 55 #pragma acc parallel 56 for(;;){} 57 58 // expected-error@+2{{expected statement}} 59 #pragma acc parallel 60 }; 61 62