xref: /llvm-project/clang/test/SemaOpenACC/data-construct-if-clause.c (revision fbb14dd97702db242a31e1b36ca8a3554a73c212)
1 // RUN: %clang_cc1 %s -fopenacc -verify
2 
3 void Foo() {
4   int Var;
5 #pragma acc data default(present) if(1)
6   ;
7   // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'data' directive}}
8   // expected-note@+1{{previous clause is here}}
9 #pragma acc data default(present) if(1) if (2)
10   ;
11 
12 #pragma acc enter data copyin(Var) if(1)
13 
14   // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'enter data' directive}}
15   // expected-note@+1{{previous clause is here}}
16 #pragma acc enter data copyin(Var) if(1) if (2)
17 
18 #pragma acc exit data copyout(Var) if(1)
19   // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'exit data' directive}}
20   // expected-note@+1{{previous clause is here}}
21 #pragma acc exit data copyout(Var) if(1) if (2)
22 
23 #pragma acc host_data use_device(Var) if(1)
24   ;
25   // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'host_data' directive}}
26   // expected-note@+1{{previous clause is here}}
27 #pragma acc host_data use_device(Var) if(1) if (2)
28   ;
29 }
30