[DAG] TransformFPLoadStorePair - early out if we're not loading a simple type
[llvm-project.git] / clang / test / OpenMP / declare_target_variables_ast_print.cpp
blobcd5dfea56f8f35ea2bf488d949c24703490da3e8
1 // RUN: %clang_cc1 -w -verify -fopenmp -I %S/Inputs -ast-print %s | FileCheck %s --check-prefix=CHECK
2 // expected-no-diagnostics
4 static int variable = 100;
5 static float variable1 = 200;
6 static float variable2 = variable1;
8 static int var = 1;
10 static int var1 = 10;
11 static int *var2 = &var1;
12 static int **ptr1 = &var2;
14 int arr[2] = {1,2};
15 int (*arrptr)[2] = &arr;
17 class declare{
18 public: int x;
19 void print();
21 declare obj1;
22 declare *obj2 = &obj1;
24 struct target{
25 int x;
26 void print();
28 static target S;
30 static int var3 = 100;
31 static int *ptr_3 = &var3;
32 static char c = 'a';
34 #pragma omp declare target
35 int target_var = variable;
36 float target_var1 = variable2;
37 int *ptr = &var;
38 int ***ptr2 = &ptr1;
39 int (**ptr3)[2] = &arrptr;
40 declare **obj3 = &obj2;
41 target *S1 = &S;
42 #pragma omp end declare target
43 #pragma omp declare target(ptr_3)
44 #pragma omp declare target to(c)
46 // CHECK: #pragma omp declare target
47 // CHECK-NEXT: static int variable = 100;
48 // CHECK-NEXT: #pragma omp end declare target
50 // CHECK-NEXT: #pragma omp declare target
51 // CHECK-NEXT: static float variable1 = 200;
52 // CHECK-NEXT: #pragma omp end declare target
53 // CHECK-NEXT: #pragma omp declare target
54 // CHECK-NEXT: static float variable2 = variable1;
55 // CHECK-NEXT: #pragma omp end declare target
57 // CHECK: #pragma omp declare target
58 // CHECK-NEXT: static int var = 1;
59 // CHECK-NEXT: #pragma omp end declare target
61 // CHECK-NEXT: #pragma omp declare target
62 // CHECK-NEXT: static int var1 = 10;
63 // CHECK-NEXT: #pragma omp end declare target
64 // CHECK-NEXT: #pragma omp declare target
65 // CHECK-NEXT: static int *var2 = &var1;
66 // CHECK-NEXT: #pragma omp end declare target
67 // CHECK-NEXT: #pragma omp declare target
68 // CHECK-NEXT: static int **ptr1 = &var2;
69 // CHECK-NEXT: #pragma omp end declare target
71 // CHECK-NEXT: #pragma omp declare target
72 // CHECK-NEXT: int arr[2] = {1, 2};
73 // CHECK-NEXT: #pragma omp end declare target
74 // CHECK-NEXT: #pragma omp declare target
75 // CHECK-NEXT: int (*arrptr)[2] = &arr;
76 // CHECK-NEXT: #pragma omp end declare target
78 // CHECK-NEXT: class declare {
79 // CHECK-NEXT: public:
80 // CHECK-NEXT: int x;
81 // CHECK-NEXT: void print();
82 // CHECK-NEXT: };
83 // CHECK-NEXT: #pragma omp declare target
84 // CHECK-NEXT: declare obj1;
85 // CHECK-NEXT: #pragma omp end declare target
86 // CHECK-NEXT: #pragma omp declare target
87 // CHECK-NEXT: declare *obj2 = &obj1;
88 // CHECK-NEXT: #pragma omp end declare target
90 // CHECK-NEXT: struct target {
91 // CHECK-NEXT: int x;
92 // CHECK-NEXT: void print();
93 // CHECK-NEXT: };
94 // CHECK-NEXT: #pragma omp declare target
95 // CHECK-NEXT: static target S;
96 // CHECK-NEXT: #pragma omp end declare target
97 // CHECK-NEXT: #pragma omp declare target
98 // CHECK-NEXT: static int var3 = 100;
99 // CHECK-NEXT: #pragma omp end declare target
100 // CHECK-NEXT: #pragma omp declare target
101 // CHECK-NEXT: static int *ptr_3 = &var3;
102 // CHECK-NEXT: #pragma omp end declare target
103 // CHECK-NEXT: #pragma omp declare target
104 // CHECK-NEXT: static char c = 'a';
105 // CHECK-NEXT: #pragma omp end declare target
106 // CHECK-NEXT: #pragma omp declare target
107 // CHECK-NEXT: int target_var = variable;
108 // CHECK-NEXT: #pragma omp end declare target
109 // CHECK-NEXT: #pragma omp declare target
110 // CHECK-NEXT: float target_var1 = variable2;
111 // CHECK-NEXT: #pragma omp end declare target
112 // CHECK-NEXT: #pragma omp declare target
113 // CHECK-NEXT: int *ptr = &var;
114 // CHECK-NEXT: #pragma omp end declare target
115 // CHECK-NEXT: #pragma omp declare target
116 // CHECK-NEXT: int ***ptr2 = &ptr1;
117 // CHECK-NEXT: #pragma omp end declare target
118 // CHECK-NEXT: #pragma omp declare target
119 // CHECK-NEXT: int (**ptr3)[2] = &arrptr;
120 // CHECK-NEXT: #pragma omp end declare target
121 // CHECK-NEXT: #pragma omp declare target
122 // CHECK-NEXT: declare **obj3 = &obj2;
123 // CHECK-NEXT: #pragma omp end declare target
124 // CHECK-NEXT: #pragma omp declare target
125 // CHECK-NEXT: target *S1 = &S;
126 // CHECK-NEXT: #pragma omp end declare target