Debian Codegraph @

clang/test/SemaOpenACC/loop-loc-and-stmt.c

raw
1 // RUN: %clang_cc1 %s -verify -fopenacc
2
3 // expected-error@+1{{OpenACC construct 'loop' cannot be used here; it can only be used in a statement context}}
4 #pragma acc loop
5
6 // expected-error@+1{{OpenACC construct 'loop' cannot be used here; it can only be used in a statement context}}
7 #pragma acc loop
8 int foo;
9
10 struct S {
11 // expected-error@+1{{OpenACC construct 'loop' cannot be used here; it can only be used in a statement context}}
12 #pragma acc loop
13 int i;
14 };
15
16 void func() {
17 // expected-error@+2{{expected expression}}
18 #pragma acc loop
19 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 loop
24 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 loop
29 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 loop
34 {}
35
36 #pragma acc loop
37 for(int i = 0; i < 5; ++i);
38 }