target_exit_data_ast_print.cpp
13.7 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
template <typename T, int C>
T tmain(T argc, T *argv) {
T i, j, b, c, d, e, x[20];
i = argc;
#pragma omp target exit data map(from: i)
#pragma omp target exit data map(from: i) if (target exit data: j > 0)
#pragma omp target exit data map(from: i) if (b)
#pragma omp target exit data map(from: c)
#pragma omp target exit data map(from: c) if(b>e)
#pragma omp target exit data map(release: x[0:10], c)
#pragma omp target exit data map(delete: x[0:10])
#pragma omp target exit data map(always, delete: x[0:10])
#pragma omp target exit data map(from: c) map(release: d)
#pragma omp target exit data map(always,release: e)
#pragma omp target exit data nowait map(from: i)
#pragma omp target exit data nowait map(from: i) if (target exit data: j > 0)
#pragma omp target exit data map(from: i) if (b) nowait
#pragma omp target exit data map(from: c) nowait
#pragma omp target exit data map(from: c) nowait if(b>e)
#pragma omp target exit data nowait map(release: x[0:10], c)
#pragma omp target exit data nowait map(from: c) map(release: d)
#pragma omp target exit data nowait map(always,release: e)
#pragma omp target exit data depend(in : argc, argv[i:argc], x[:]) nowait map(from: i)
#pragma omp target exit data nowait depend(in : argc, argv[i:argc], x[:]) map(from: i) if (target exit data: j > 0)
#pragma omp target exit data map(from: i) depend(in : argc, argv[i:argc], x[:]) if (b) nowait
#pragma omp target exit data map(from: c) depend(in : argc, argv[i:argc], x[:]) nowait
#pragma omp target exit data map(from: c) depend(in : argc, argv[i:argc], x[:]) nowait if(b>e)
#pragma omp target exit data nowait map(release: x[0:10], c) depend(in : argc, argv[i:argc], x[:])
#pragma omp target exit data nowait map(from: c) depend(in : argc, argv[i:argc], x[:]) map(release: d)
#pragma omp target exit data depend(in : argc, argv[i:argc], x[:]) nowait map(always,release: e)
return 0;
}
// CHECK: template <typename T, int C> T tmain(T argc, T *argv) {
// CHECK-NEXT: T i, j, b, c, d, e, x[20];
// CHECK-NEXT: i = argc;
// CHECK-NEXT: #pragma omp target exit data map(from: i){{$}}
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b)
// CHECK-NEXT: #pragma omp target exit data map(from: c)
// CHECK-NEXT: #pragma omp target exit data map(from: c) if(b > e)
// CHECK-NEXT: #pragma omp target exit data map(release: x[0:10],c)
// CHECK-NEXT: #pragma omp target exit data map(delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(always,delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: i)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait if(b > e)
// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(from: i)
// CHECK-NEXT: #pragma omp target exit data nowait depend(in : argc,argv[i:argc],x[:]) map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) depend(in : argc,argv[i:argc],x[:]) if(b) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait if(b > e)
// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) depend(in : argc,argv[i:argc],x[:])
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) depend(in : argc,argv[i:argc],x[:]) map(release: d)
// CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(always,release: e)
// CHECK: template<> int tmain<int, 5>(int argc, int *argv) {
// CHECK-NEXT: int i, j, b, c, d, e, x[20];
// CHECK-NEXT: i = argc;
// CHECK-NEXT: #pragma omp target exit data map(from: i)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b)
// CHECK-NEXT: #pragma omp target exit data map(from: c)
// CHECK-NEXT: #pragma omp target exit data map(from: c) if(b > e)
// CHECK-NEXT: #pragma omp target exit data map(release: x[0:10],c)
// CHECK-NEXT: #pragma omp target exit data map(delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(always,delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: i)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait if(b > e)
// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(from: i)
// CHECK-NEXT: #pragma omp target exit data nowait depend(in : argc,argv[i:argc],x[:]) map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) depend(in : argc,argv[i:argc],x[:]) if(b) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait if(b > e)
// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) depend(in : argc,argv[i:argc],x[:])
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) depend(in : argc,argv[i:argc],x[:]) map(release: d)
// CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(always,release: e)
// CHECK: template<> char tmain<char, 1>(char argc, char *argv) {
// CHECK-NEXT: char i, j, b, c, d, e, x[20];
// CHECK-NEXT: i = argc;
// CHECK-NEXT: #pragma omp target exit data map(from: i)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b)
// CHECK-NEXT: #pragma omp target exit data map(from: c)
// CHECK-NEXT: #pragma omp target exit data map(from: c) if(b > e)
// CHECK-NEXT: #pragma omp target exit data map(release: x[0:10],c)
// CHECK-NEXT: #pragma omp target exit data map(delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(always,delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: i)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait if(b > e)
// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(from: i)
// CHECK-NEXT: #pragma omp target exit data nowait depend(in : argc,argv[i:argc],x[:]) map(from: i) if(target exit data: j > 0)
// CHECK-NEXT: #pragma omp target exit data map(from: i) depend(in : argc,argv[i:argc],x[:]) if(b) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait if(b > e)
// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) depend(in : argc,argv[i:argc],x[:])
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) depend(in : argc,argv[i:argc],x[:]) map(release: d)
// CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(always,release: e)
int main (int argc, char **argv) {
int b = argc, i, c, d, e, f, g, x[20];
static int a;
// CHECK: static int a;
#pragma omp target exit data map(from: a)
// CHECK: #pragma omp target exit data map(from: a)
a=2;
// CHECK-NEXT: a = 2;
#pragma omp target exit data map(from: a) if (target exit data: b)
// CHECK: #pragma omp target exit data map(from: a) if(target exit data: b)
#pragma omp target exit data map(from: a) if (b > g)
// CHECK: #pragma omp target exit data map(from: a) if(b > g)
#pragma omp target exit data map(from: c)
// CHECK-NEXT: #pragma omp target exit data map(from: c)
#pragma omp target exit data map(release: c) if(b>g)
// CHECK-NEXT: #pragma omp target exit data map(release: c) if(b > g)
#pragma omp target exit data map(from: x[0:10], c)
// CHECK-NEXT: #pragma omp target exit data map(from: x[0:10],c)
#pragma omp target exit data map(delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(delete: x[0:10])
#pragma omp target exit data map(always, delete: x[0:10])
// CHECK-NEXT: #pragma omp target exit data map(always,delete: x[0:10])
#pragma omp target exit data map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data map(from: c) map(release: d)
#pragma omp target exit data map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data map(always,release: e)
#pragma omp target exit data nowait map(from: a)
// CHECK: #pragma omp target exit data nowait map(from: a)
#pragma omp target exit data nowait map(from: a) if (target exit data: b)
// CHECK: #pragma omp target exit data nowait map(from: a) if(target exit data: b)
#pragma omp target exit data map(from: a) if (b > g) nowait
// CHECK: #pragma omp target exit data map(from: a) if(b > g) nowait
#pragma omp target exit data map(from: c) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait
#pragma omp target exit data map(release: c) nowait if(b>g)
// CHECK-NEXT: #pragma omp target exit data map(release: c) nowait if(b > g)
#pragma omp target exit data nowait map(from: x[0:10], c)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: x[0:10],c)
#pragma omp target exit data nowait map(from: c) map(release: d)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d)
#pragma omp target exit data nowait map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e)
#pragma omp target exit data nowait depend(in : argc,argv[i:argc],x[:]) map(from: a)
// CHECK: #pragma omp target exit data nowait depend(in : argc,argv[i:argc],x[:]) map(from: a)
#pragma omp target exit data nowait map(from: a) depend(in : argc,argv[i:argc],x[:]) if (target exit data: b)
// CHECK: #pragma omp target exit data nowait map(from: a) depend(in : argc,argv[i:argc],x[:]) if(target exit data: b)
#pragma omp target exit data map(from: a) if (b > g) nowait depend(in : argc,argv[i:argc],x[:])
// CHECK: #pragma omp target exit data map(from: a) if(b > g) nowait depend(in : argc,argv[i:argc],x[:])
#pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait
// CHECK-NEXT: #pragma omp target exit data map(from: c) depend(in : argc,argv[i:argc],x[:]) nowait
#pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) map(release: c) nowait if(b>g)
// CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) map(release: c) nowait if(b > g)
#pragma omp target exit data nowait map(from: x[0:10], c) depend(in : argc,argv[i:argc],x[:])
// CHECK-NEXT: #pragma omp target exit data nowait map(from: x[0:10],c) depend(in : argc,argv[i:argc],x[:])
#pragma omp target exit data nowait map(from: c) depend(in : argc,argv[i:argc],x[:]) map(release: d)
// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) depend(in : argc,argv[i:argc],x[:]) map(release: d)
#pragma omp target exit data nowait depend(in : argc,argv[i:argc],x[:]) map(always,release: e)
// CHECK-NEXT: #pragma omp target exit data nowait depend(in : argc,argv[i:argc],x[:]) map(always,release: e)
return tmain<int, 5>(argc, &argc) + tmain<char, 1>(argv[0][0], argv[0]);
}
#endif