[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / SemaOpenACC / compute-construct-if-clause.c
blob4629b1b2c2bd0960bbc6778d935deaba243dcfd9
1 // RUN: %clang_cc1 %s -fopenacc -verify
3 void BoolExpr(int *I, float *F) {
5 typedef struct {} SomeStruct;
6 int Array[5];
8 struct C{};
9 // expected-error@+1{{expected expression}}
10 #pragma acc parallel if (struct C f())
11 while(0);
13 // expected-error@+1{{unexpected type name 'SomeStruct': expected expression}}
14 #pragma acc serial if (SomeStruct)
15 while(0);
17 // expected-error@+1{{unexpected type name 'SomeStruct': expected expression}}
18 #pragma acc serial if (SomeStruct())
19 while(0);
21 SomeStruct S;
22 // expected-error@+1{{statement requires expression of scalar type ('SomeStruct' invalid)}}
23 #pragma acc serial if (S)
24 while(0);
26 // expected-warning@+1{{address of array 'Array' will always evaluate to 'true'}}
27 #pragma acc kernels if (Array)
28 while(0);
30 // expected-warning@+4{{incompatible pointer types assigning to 'int *' from 'float *'}}
31 // expected-warning@+3{{using the result of an assignment as a condition without parentheses}}
32 // expected-note@+2{{place parentheses around the assignment to silence this warning}}
33 // expected-note@+1{{use '==' to turn this assignment into an equality comparison}}
34 #pragma acc kernels if (I = F)
35 while(0);
37 #pragma acc parallel if (I)
38 while(0);
40 #pragma acc serial if (F)
41 while(0);
43 #pragma acc kernels if (*I < *F)
44 while(0);
46 // expected-warning@+2{{OpenACC construct 'data' not yet implemented}}
47 // expected-warning@+1{{OpenACC clause 'if' not yet implemented}}
48 #pragma acc data if (*I < *F)
49 while(0);
50 // expected-warning@+2{{OpenACC construct 'parallel loop' not yet implemented}}
51 // expected-warning@+1{{OpenACC clause 'if' not yet implemented}}
52 #pragma acc parallel loop if (*I < *F)
53 while(0);
54 // expected-warning@+2{{OpenACC construct 'serial loop' not yet implemented}}
55 // expected-warning@+1{{OpenACC clause 'if' not yet implemented}}
56 #pragma acc serial loop if (*I < *F)
57 while(0);
58 // expected-warning@+2{{OpenACC construct 'kernels loop' not yet implemented}}
59 // expected-warning@+1{{OpenACC clause 'if' not yet implemented}}
60 #pragma acc kernels loop if (*I < *F)
61 while(0);
63 // expected-error@+1{{OpenACC 'if' clause is not valid on 'loop' directive}}
64 #pragma acc loop if(I)
65 for(;;);