39 lines · c
1// RUN: %clang_cc1 %s -verify -fopenacc2 3// expected-error@+1{{OpenACC construct 'loop' cannot be used here; it can only be used in a statement context}}4#pragma acc loop5 6// expected-error@+1{{OpenACC construct 'loop' cannot be used here; it can only be used in a statement context}}7#pragma acc loop8int foo;9 10struct S {11// expected-error@+1{{OpenACC construct 'loop' cannot be used here; it can only be used in a statement context}}12#pragma acc loop13 int i;14};15 16void func() {17 // expected-error@+2{{expected expression}}18#pragma acc loop19 int foo;20 21 // expected-error@+3{{OpenACC 'loop' construct can only be applied to a 'for' loop}}22 // expected-note@+1{{'loop' construct is here}}23#pragma acc loop24 while(0);25 26 // expected-error@+3{{OpenACC 'loop' construct can only be applied to a 'for' loop}}27 // expected-note@+1{{'loop' construct is here}}28#pragma acc loop29 do{}while(0);30 31 // expected-error@+3{{OpenACC 'loop' construct can only be applied to a 'for' loop}}32 // expected-note@+1{{'loop' construct is here}}33#pragma acc loop34 {}35 36#pragma acc loop37 for(int i = 0; i < 5; ++i);38}39