1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 -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 -verify %s -ast-print | FileCheck %s
5 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ast-print %s | FileCheck %s
6 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
7 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s
8 // expected-no-diagnostics
22 #pragma omp target data map(tofrom: i) use_device_ptr(k) use_device_addr(i, j)
24 #pragma omp target data map(tofrom: i) use_device_ptr(z) use_device_addr(k, y)
31 // CHECK: #pragma omp target data map(tofrom: this->i) use_device_ptr(this->k) use_device_addr(this->i,this->j){{$}}
32 // CHECK: #pragma omp target data map(tofrom: this->i) use_device_ptr(this->z) use_device_addr(this->k,this->y)
55 SC(SB
*&_RPtrS
) : RPtrS(_RPtrS
) {}
69 S2(S2
&s2
):a(s2
.a
) { }
71 static const float S2sc
;
73 const float S2::S2sc
= 0;
80 S3(S3
&s3
):a(s3
.a
) { }
95 S5(const S5
&s5
):a(s5
.a
) { }
101 #pragma omp threadprivate(h)
105 template <typename T
>
111 #pragma omp target data map(tofrom: i) use_device_ptr(k)
113 #pragma omp target data map(tofrom: i) use_device_ptr(z)
118 // CHECK: template<> int tmain<int>(int argc) {
119 // CHECK-NEXT: int i;
120 // CHECK-NEXT: int &j = i;
121 // CHECK-NEXT: int *k = &j;
122 // CHECK-NEXT: int *&z = k;
123 // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(k)
126 // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(z)
128 // CHECK: template<> int *tmain<int *>(int *argc) {
129 // CHECK-NEXT: int *i;
130 // CHECK-NEXT: int *&j = i;
131 // CHECK-NEXT: int **k = &j;
132 // CHECK-NEXT: int **&z = k;
133 // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(k)
136 // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(z)
138 // CHECK-LABEL: int main(int argc, char **argv) {
139 int main(int argc
, char **argv
) {
144 // CHECK-NEXT: int i;
145 // CHECK-NEXT: int &j = i;
146 // CHECK-NEXT: int *k = &j;
147 // CHECK-NEXT: int *&z = k;
148 #pragma omp target data map(tofrom: i) use_device_ptr(k) use_device_addr(i, j)
149 // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(k) use_device_addr(i,j)
153 #pragma omp target data map(tofrom: i) use_device_ptr(z) use_device_addr(i, j, k[:i])
154 // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(z) use_device_addr(i,j,k[:i])
156 return tmain
<int>(argc
) + (*tmain
<int*>(&argc
));