1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=52 -ast-print %s | FileCheck %s
2 // RUN: %clang_cc1 -fopenmp -fopenmp-version=52 -x c++ -std=c++11 -emit-pch -o %t %s
3 // RUN: %clang_cc1 -fopenmp -fopenmp-version=52 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
5 // expected-no-diagnostics
10 template <typename T
, int C
>
11 T
tmain(T argc
, T
*argv
) {
15 #pragma omp target exit data map(i_def)
17 #pragma omp target exit data map(from: i)
22 // CHECK: template <typename T, int C> T tmain(T argc, T *argv) {
23 // CHECK-NEXT: T i_def, i;
24 // CHECK-NEXT: i = argc;
25 // CHECK-NEXT: #pragma omp target exit data map(from: i_def){{$}}
26 // CHECK-NEXT: #pragma omp target exit data map(from: i){{$}}
28 // CHECK: template<> int tmain<int, 5>(int argc, int *argv) {
29 // CHECK-NEXT: int i_def, i;
30 // CHECK-NEXT: i = argc;
31 // CHECK-NEXT: #pragma omp target exit data map(from: i_def)
32 // CHECK-NEXT: #pragma omp target exit data map(from: i)
34 // CHECK: template<> char tmain<char, 1>(char argc, char *argv) {
35 // CHECK-NEXT: char i_def, i;
36 // CHECK-NEXT: i = argc;
37 // CHECK-NEXT: #pragma omp target exit data map(from: i_def)
38 // CHECK-NEXT: #pragma omp target exit data map(from: i)
40 int main (int argc
, char **argv
) {
43 // CHECK: static int a_def, a;
45 #pragma omp target exit data map(a_def)
46 // CHECK: #pragma omp target exit data map(from: a_def)
48 // CHECK-NEXT: a_def = 2;
50 #pragma omp target exit data map(from: a)
51 // CHECK: #pragma omp target exit data map(from: a)
55 #pragma omp target exit data map(b_def)
56 // CHECK-NEXT: #pragma omp target exit data map(from: b_def)
58 #pragma omp target exit data map(from: b)
59 // CHECK-NEXT: #pragma omp target exit data map(from: b)
61 return tmain
<int, 5>(argc
, &argc
) + tmain
<char, 1>(argv
[0][0], argv
[0]);