aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaOpenACC/data-construct-if-clause.c
blob: cf44b36830eb17532b16097eb4ddd2e87ed1a7a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// RUN: %clang_cc1 %s -fopenacc -verify

void Foo() {
  int Var;
#pragma acc data default(present) if(1)
  ;
  // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'data' directive}}
  // expected-note@+1{{previous 'if' clause is here}}
#pragma acc data default(present) if(1) if (2)
  ;

#pragma acc enter data copyin(Var) if(1)

  // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'enter data' directive}}
  // expected-note@+1{{previous 'if' clause is here}}
#pragma acc enter data copyin(Var) if(1) if (2)

#pragma acc exit data copyout(Var) if(1)
  // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'exit data' directive}}
  // expected-note@+1{{previous 'if' clause is here}}
#pragma acc exit data copyout(Var) if(1) if (2)

#pragma acc host_data use_device(Var) if(1)
  ;
  // expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'host_data' directive}}
  // expected-note@+1{{previous 'if' clause is here}}
#pragma acc host_data use_device(Var) if(1) if (2)
  ;
}