1 // RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
4 // expected-no-diagnostics
11 template <class T, class U>
12 T foo(T targ, U uarg) {
16 #pragma omp target update to(a) if(l>5) device(l) nowait depend(inout:l)
18 #pragma omp target update from(b) if(l<5) device(l-1) nowait depend(inout:l)
19 return a + targ + (T)b;
21 // CHECK: static int a;
22 // CHECK-NEXT: float b;
24 // CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait depend(inout : l)
25 // CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait depend(inout : l)
26 // CHECK: static char a;
27 // CHECK-NEXT: float b;
29 // CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait depend(inout : l)
30 // CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait depend(inout : l)
34 // CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait depend(inout : l)
35 // CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait depend(inout : l)
37 int main(int argc, char **argv) {
42 // CHECK: static int a;
44 // CHECK-NEXT: float f;
45 #pragma omp target update to(a) if(f>0.0) device(n) nowait depend(in:n)
46 // CHECK-NEXT: #pragma omp target update to(a) if(f > 0.) device(n) nowait depend(in : n)
47 #pragma omp target update from(f) if(f<0.0) device(n+1) nowait depend(in:n)
48 // CHECK-NEXT: #pragma omp target update from(f) if(f < 0.) device(n + 1) nowait depend(in : n)
49 return foo(argc, f) + foo(argv[0][0], f) + a;