[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaOpenCL / address-spaces-conversions-cl2.0.cl
blob14f7cf3a0e7e08d70eb567bb9c444c35445494d0
1 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=CL2.0
2 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=CL2.0
3 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=CL2.0
4 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=clc++
5 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=clc++
6 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=clc++
8 /* OpenCLC v2.0 adds a set of restrictions for conversions between pointers to
9 * different address spaces, mainly described in Sections 6.5.5 and 6.5.6.
11 * It adds notion of overlapping address spaces. The main differention is that
12 * an unnamed address space is added, called '__generic'. Pointers to the
13 * generic address space can be interchangabley used with pointers to any
14 * other address space except for __constant address space (Section 6.5.5).
16 * Based on this there are 3 sets of tests: __generic, named (__global in this
17 * case), and __constant, that should cover all program paths for CL address
18 * space conversions used in initialisations, assignments, casts, comparisons
19 * and arithmetic operations.
22 #ifdef GENERIC
23 #define AS __generic
24 #define AS_COMP __local
25 #define AS_INCOMP __constant
26 #endif
28 #ifdef GLOBAL
29 #define AS __global
30 #define AS_COMP __global
31 #define AS_INCOMP __local
32 #endif
34 #ifdef CONSTANT
35 #define AS __constant
36 #define AS_COMP __constant
37 #define AS_INCOMP __global
38 #endif
40 void f_glob(__global int *arg_glob) {}
41 #ifndef GLOBAL
42 #if !__OPENCL_CPP_VERSION__
43 // expected-note@-3{{passing argument to parameter 'arg_glob' here}}
44 #else
45 // expected-note-re@-5{{candidate function not viable: cannot pass pointer to address space '__{{generic|constant}}' as a pointer to address space '__global' in 1st argument}}
46 #endif
47 #endif
49 void f_loc(__local int *arg_loc) {}
50 #if !__OPENCL_CPP_VERSION__
51 // expected-note@-2{{passing argument to parameter 'arg_loc' here}}
52 #else
53 // expected-note-re@-4{{candidate function not viable: cannot pass pointer to address space '__{{global|generic|constant}}' as a pointer to address space '__local' in 1st argument}}
54 #endif
56 void f_const(__constant int *arg_const) {}
57 #ifndef CONSTANT
58 #if !__OPENCL_CPP_VERSION__
59 // expected-note@-3{{passing argument to parameter 'arg_const' here}}
60 #else
61 // expected-note-re@-5{{candidate function not viable: cannot pass pointer to address space '__{{global|generic}}' as a pointer to address space '__constant' in 1st argument}}
62 #endif
63 #endif
65 void f_priv(__private int *arg_priv) {}
66 #if !__OPENCL_CPP_VERSION__
67 // expected-note@-2{{passing argument to parameter 'arg_priv' here}}
68 #else
69 // expected-note-re@-4{{candidate function not viable: cannot pass pointer to address space '__{{global|generic|constant}}' as a pointer to address space '__private' in 1st argument}}
70 #endif
72 void f_gen(__generic int *arg_gen) {}
73 #ifdef CONSTANT
74 #if !__OPENCL_CPP_VERSION__
75 // expected-note@-3{{passing argument to parameter 'arg_gen' here}}
76 #else
77 // expected-note@-5{{candidate function not viable: cannot pass pointer to address space '__constant' as a pointer to address space '__generic' in 1st argument}}
78 #endif
79 #endif
81 void test_conversion(__global int *arg_glob, __local int *arg_loc,
82 __constant int *arg_const, __private int *arg_priv,
83 __generic int *arg_gen) {
85 AS int *var_init1 = arg_glob;
86 #ifdef CONSTANT
87 #if !__OPENCL_CPP_VERSION__
88 // expected-error@-3{{initializing '__constant int *__private' with an expression of type '__global int *__private' changes address space of pointer}}
89 #else
90 // expected-error@-5{{cannot initialize a variable of type '__constant int *__private' with an lvalue of type '__global int *__private'}}
91 #endif
92 #endif
94 AS int *var_init2 = arg_loc;
95 #ifndef GENERIC
96 #if !__OPENCL_CPP_VERSION__
97 // expected-error-re@-3{{initializing '__{{global|constant}} int *__private' with an expression of type '__local int *__private' changes address space of pointer}}
98 #else
99 // expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *__private' with an lvalue of type '__local int *__private'}}
100 #endif
101 #endif
103 AS int *var_init3 = arg_const;
104 #ifndef CONSTANT
105 #if !__OPENCL_CPP_VERSION__
106 // expected-error-re@-3{{initializing '__{{global|generic}} int *__private' with an expression of type '__constant int *__private' changes address space of pointer}}
107 #else
108 // expected-error-re@-5{{cannot initialize a variable of type '__{{global|generic}} int *__private' with an lvalue of type '__constant int *__private'}}
109 #endif
110 #endif
112 AS int *var_init4 = arg_priv;
113 #ifndef GENERIC
114 #if !__OPENCL_CPP_VERSION__
115 // expected-error-re@-3{{initializing '__{{global|constant}} int *__private' with an expression of type '__private int *__private' changes address space of pointer}}
116 #else
117 // expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *__private' with an lvalue of type '__private int *__private'}}
118 #endif
119 #endif
121 AS int *var_init5 = arg_gen;
122 #ifndef GENERIC
123 #if !__OPENCL_CPP_VERSION__
124 // expected-error-re@-3{{initializing '__{{global|constant}} int *__private' with an expression of type '__generic int *__private' changes address space of pointer}}
125 #else
126 // expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *__private' with an lvalue of type '__generic int *__private'}}
127 #endif
128 #endif
130 AS int *var_cast1 = (AS int *)arg_glob;
131 #ifdef CONSTANT
132 #if !__OPENCL_CPP_VERSION__
133 // expected-error@-3{{casting '__global int *' to type '__constant int *' changes address space of pointer}}
134 #else
135 // expected-error@-5{{C-style cast from '__global int *' to '__constant int *' converts between mismatching address spaces}}
136 #endif
137 #endif
139 AS int *var_cast2 = (AS int *)arg_loc;
140 #ifndef GENERIC
141 #if !__OPENCL_CPP_VERSION__
142 // expected-error-re@-3{{casting '__local int *' to type '__{{global|constant}} int *' changes address space of pointer}}
143 #else
144 // expected-error-re@-5{{C-style cast from '__local int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
145 #endif
146 #endif
148 AS int *var_cast3 = (AS int *)arg_const;
149 #ifndef CONSTANT
150 #if !__OPENCL_CPP_VERSION__
151 // expected-error-re@-3{{casting '__constant int *' to type '__{{global|generic}} int *' changes address space of pointer}}
152 #else
153 // expected-error-re@-5{{C-style cast from '__constant int *' to '__{{global|generic}} int *' converts between mismatching address spaces}}
154 #endif
155 #endif
157 AS int *var_cast4 = (AS int *)arg_priv;
158 #ifndef GENERIC
159 #if !__OPENCL_CPP_VERSION__
160 // expected-error-re@-3{{casting '__private int *' to type '__{{global|constant}} int *' changes address space of pointer}}
161 #else
162 // expected-error-re@-5{{C-style cast from '__private int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
163 #endif
164 #endif
166 AS int *var_cast5 = (AS int *)arg_gen;
167 #ifdef CONSTANT
168 #if !__OPENCL_CPP_VERSION__
169 // expected-error@-3{{casting '__generic int *' to type '__constant int *' changes address space of pointer}}
170 #else
171 // expected-error@-5{{C-style cast from '__generic int *' to '__constant int *' converts between mismatching address spaces}}
172 #endif
173 #endif
175 AS int *var_impl;
176 var_impl = arg_glob;
177 #ifdef CONSTANT
178 #if !__OPENCL_CPP_VERSION__
179 // expected-error@-3{{assigning '__global int *__private' to '__constant int *__private' changes address space of pointer}}
180 #else
181 // expected-error@-5{{assigning to '__constant int *' from incompatible type '__global int *__private'}}
182 #endif
183 #endif
185 var_impl = arg_loc;
186 #ifndef GENERIC
187 #if !__OPENCL_CPP_VERSION__
188 // expected-error-re@-3{{assigning '__local int *__private' to '__{{global|constant}} int *__private' changes address space of pointer}}
189 #else
190 // expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__local int *__private'}}
191 #endif
192 #endif
194 var_impl = arg_const;
195 #ifndef CONSTANT
196 #if !__OPENCL_CPP_VERSION__
197 // expected-error-re@-3{{assigning '__constant int *__private' to '__{{global|generic}} int *__private' changes address space of pointer}}
198 #else
199 // expected-error-re@-5{{assigning to '__{{global|generic}} int *' from incompatible type '__constant int *__private'}}
200 #endif
201 #endif
203 var_impl = arg_priv;
204 #ifndef GENERIC
205 #if !__OPENCL_CPP_VERSION__
206 // expected-error-re@-3{{assigning '__private int *__private' to '__{{global|constant}} int *__private' changes address space of pointer}}
207 #else
208 // expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__private int *__private'}}
209 #endif
210 #endif
212 var_impl = arg_gen;
213 #ifndef GENERIC
214 #if !__OPENCL_CPP_VERSION__
215 // expected-error-re@-3{{assigning '__generic int *__private' to '__{{global|constant}} int *__private' changes address space of pointer}}
216 #else
217 // expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__generic int *__private'}}
218 #endif
219 #endif
221 var_cast1 = (AS int *)arg_glob;
222 #ifdef CONSTANT
223 #if !__OPENCL_CPP_VERSION__
224 // expected-error@-3{{casting '__global int *' to type '__constant int *' changes address space of pointer}}
225 #else
226 // expected-error@-5{{C-style cast from '__global int *' to '__constant int *' converts between mismatching address spaces}}
227 #endif
228 #endif
230 var_cast2 = (AS int *)arg_loc;
231 #ifndef GENERIC
232 #if !__OPENCL_CPP_VERSION__
233 // expected-error-re@-3{{casting '__local int *' to type '__{{global|constant}} int *' changes address space of pointer}}
234 #else
235 // expected-error-re@-5{{C-style cast from '__local int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
236 #endif
237 #endif
239 var_cast3 = (AS int *)arg_const;
240 #ifndef CONSTANT
241 #if !__OPENCL_CPP_VERSION__
242 // expected-error-re@-3{{casting '__constant int *' to type '__{{global|generic}} int *' changes address space of pointer}}
243 #else
244 // expected-error-re@-5{{C-style cast from '__constant int *' to '__{{global|generic}} int *' converts between mismatching address spaces}}
245 #endif
246 #endif
248 var_cast4 = (AS int *)arg_priv;
249 #ifndef GENERIC
250 #if !__OPENCL_CPP_VERSION__
251 // expected-error-re@-3{{casting '__private int *' to type '__{{global|constant}} int *' changes address space of pointer}}
252 #else
253 // expected-error-re@-5{{C-style cast from '__private int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
254 #endif
255 #endif
257 var_cast5 = (AS int *)arg_gen;
258 #ifdef CONSTANT
259 #if !__OPENCL_CPP_VERSION__
260 // expected-error@-3{{casting '__generic int *' to type '__constant int *' changes address space of pointer}}
261 #else
262 // expected-error@-5{{C-style cast from '__generic int *' to '__constant int *' converts between mismatching address spaces}}
263 #endif
264 #endif
266 AS int *var_cmp;
267 int b = var_cmp != arg_glob;
268 #ifdef CONSTANT
269 #if !__OPENCL_CPP_VERSION__
270 // expected-error@-3{{comparison between ('__constant int *' and '__global int *') which are pointers to non-overlapping address spaces}}
271 #else
272 // expected-error@-5{{comparison of distinct pointer types ('__constant int *' and '__global int *')}}
273 #endif
274 #endif
276 b = var_cmp != arg_loc;
277 #ifndef GENERIC
278 #if !__OPENCL_CPP_VERSION__
279 // expected-error-re@-3{{comparison between ('__{{global|constant}} int *' and '__local int *') which are pointers to non-overlapping address spaces}}
280 #else
281 // expected-error-re@-5{{comparison of distinct pointer types ('__{{global|constant}} int *' and '__local int *')}}
282 #endif
283 #endif
285 b = var_cmp == arg_const;
286 #ifndef CONSTANT
287 #if !__OPENCL_CPP_VERSION__
288 // expected-error-re@-3{{comparison between ('__{{global|generic}} int *' and '__constant int *') which are pointers to non-overlapping address spaces}}
289 #else
290 // expected-error-re@-5{{comparison of distinct pointer types ('__{{global|generic}} int *' and '__constant int *')}}
291 #endif
292 #endif
294 b = var_cmp <= arg_priv;
295 #ifndef GENERIC
296 #if !__OPENCL_CPP_VERSION__
297 // expected-error-re@-3{{comparison between ('__{{global|constant}} int *' and '__private int *') which are pointers to non-overlapping address spaces}}
298 #else
299 // expected-error-re@-5{{comparison of distinct pointer types ('__{{global|constant}} int *' and '__private int *')}}
300 #endif
301 #endif
303 b = var_cmp >= arg_gen;
304 #ifdef CONSTANT
305 #if !__OPENCL_CPP_VERSION__
306 // expected-error@-3{{comparison between ('__constant int *' and '__generic int *') which are pointers to non-overlapping address spaces}}
307 #else
308 // expected-error@-5{{comparison of distinct pointer types ('__constant int *' and '__generic int *')}}
309 #endif
310 #endif
312 AS int *var_sub;
313 b = var_sub - arg_glob;
314 #ifdef CONSTANT
315 // expected-error@-2{{arithmetic operation with operands of type ('__constant int *' and '__global int *') which are pointers to non-overlapping address spaces}}
316 #endif
318 b = var_sub - arg_loc;
319 #ifndef GENERIC
320 // expected-error-re@-2{{arithmetic operation with operands of type ('__{{global|constant}} int *' and '__local int *') which are pointers to non-overlapping address spaces}}
321 #endif
323 b = var_sub - arg_const;
324 #ifndef CONSTANT
325 // expected-error-re@-2{{arithmetic operation with operands of type ('__{{global|generic}} int *' and '__constant int *') which are pointers to non-overlapping address spaces}}
326 #endif
328 b = var_sub - arg_priv;
329 #ifndef GENERIC
330 // expected-error-re@-2{{arithmetic operation with operands of type ('__{{global|constant}} int *' and '__private int *') which are pointers to non-overlapping address spaces}}
331 #endif
333 b = var_sub - arg_gen;
334 #ifdef CONSTANT
335 // expected-error@-2{{arithmetic operation with operands of type ('__constant int *' and '__generic int *') which are pointers to non-overlapping address spaces}}
336 #endif
338 f_glob(var_sub);
339 #ifndef GLOBAL
340 #if !__OPENCL_CPP_VERSION__
341 // expected-error-re@-3{{passing '__{{constant|generic}} int *__private' to parameter of type '__global int *' changes address space of pointer}}
342 #else
343 // expected-error@-5{{no matching function for call to 'f_glob'}}
344 #endif
345 #endif
347 f_loc(var_sub);
348 #if !__OPENCL_CPP_VERSION__
349 // expected-error-re@-2{{passing '__{{global|constant|generic}} int *__private' to parameter of type '__local int *' changes address space of pointer}}
350 #else
351 // expected-error@-4{{no matching function for call to 'f_loc'}}
352 #endif
354 f_const(var_sub);
355 #ifndef CONSTANT
356 #if !__OPENCL_CPP_VERSION__
357 // expected-error-re@-3{{passing '__{{global|generic}} int *__private' to parameter of type '__constant int *' changes address space of pointer}}
358 #else
359 // expected-error@-5{{no matching function for call to 'f_const'}}
360 #endif
361 #endif
363 f_priv(var_sub);
364 #if !__OPENCL_CPP_VERSION__
365 // expected-error-re@-2{{passing '__{{global|constant|generic}} int *__private' to parameter of type '__private int *' changes address space of pointer}}
366 #else
367 // expected-error@-4{{no matching function for call to 'f_priv'}}
368 #endif
370 f_gen(var_sub);
371 #ifdef CONSTANT
372 #if !__OPENCL_CPP_VERSION__
373 // expected-error@-3{{passing '__constant int *__private' to parameter of type '__generic int *' changes address space of pointer}}
374 #else
375 // expected-error@-5{{no matching function for call to 'f_gen'}}
376 #endif
377 #endif
380 void test_ternary() {
381 AS int *var_cond;
382 __generic int *var_gen;
383 __global int *var_glob;
384 var_gen = 0 ? var_cond : var_glob;
385 #ifdef CONSTANT
386 #if !__OPENCL_CPP_VERSION__
387 // expected-error@-3{{conditional operator with the second and third operands of type ('__constant int *' and '__global int *') which are pointers to non-overlapping address spaces}}
388 #else
389 // expected-error@-5{{incompatible operand types ('__constant int *' and '__global int *')}}
390 #endif
391 #endif
393 __local int *var_loc;
394 var_gen = 0 ? var_cond : var_loc;
395 #ifndef GENERIC
396 #if !__OPENCL_CPP_VERSION__
397 // expected-error-re@-3{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and '__local int *') which are pointers to non-overlapping address spaces}}
398 #else
399 // expected-error-re@-5{{incompatible operand types ('__{{global|constant}} int *' and '__local int *')}}
400 #endif
401 #endif
403 __constant int *var_const;
404 var_cond = 0 ? var_cond : var_const;
405 #ifndef CONSTANT
406 #if !__OPENCL_CPP_VERSION__
407 // expected-error-re@-3{{conditional operator with the second and third operands of type ('__{{global|generic}} int *' and '__constant int *') which are pointers to non-overlapping address spaces}}
408 #else
409 // expected-error-re@-5{{incompatible operand types ('__{{global|generic}} int *' and '__constant int *')}}
410 #endif
411 #endif
413 __private int *var_priv;
414 var_gen = 0 ? var_cond : var_priv;
415 #ifndef GENERIC
416 #if !__OPENCL_CPP_VERSION__
417 // expected-error-re@-3{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and '__private int *') which are pointers to non-overlapping address spaces}}
418 #else
419 // expected-error-re@-5{{incompatible operand types ('__{{global|constant}} int *' and '__private int *')}}
420 #endif
421 #endif
423 var_gen = 0 ? var_cond : var_gen;
424 #ifdef CONSTANT
425 #if !__OPENCL_CPP_VERSION__
426 // expected-error@-3{{conditional operator with the second and third operands of type ('__constant int *' and '__generic int *') which are pointers to non-overlapping address spaces}}
427 #else
428 // expected-error@-5{{incompatible operand types ('__constant int *' and '__generic int *')}}
429 #endif
430 #endif
432 void *var_void_gen;
433 __global char *var_glob_ch;
434 var_void_gen = 0 ? var_cond : var_glob_ch;
435 #if __OPENCL_CPP_VERSION__
436 // expected-error-re@-2{{incompatible operand types ('__{{constant|global|generic}} int *' and '__global char *')}}
437 #else
438 #ifdef CONSTANT
439 // expected-error@-5{{conditional operator with the second and third operands of type ('__constant int *' and '__global char *') which are pointers to non-overlapping address spaces}}
440 #else
441 // expected-warning-re@-7{{pointer type mismatch ('__{{global|generic}} int *' and '__global char *')}}
442 #endif
443 #endif
445 __local char *var_loc_ch;
446 var_void_gen = 0 ? var_cond : var_loc_ch;
447 #if __OPENCL_CPP_VERSION__
448 // expected-error-re@-2{{incompatible operand types ('__{{constant|global|generic}} int *' and '__local char *')}}
449 #else
450 #ifndef GENERIC
451 // expected-error-re@-5{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and '__local char *') which are pointers to non-overlapping address spaces}}
452 #else
453 // expected-warning@-7{{pointer type mismatch ('__generic int *' and '__local char *')}}
454 #endif
455 #endif
457 __constant void *var_void_const;
458 __constant char *var_const_ch;
459 var_void_const = 0 ? var_cond : var_const_ch;
460 #if __OPENCL_CPP_VERSION__
461 // expected-error-re@-2{{incompatible operand types ('__{{constant|global|generic}} int *' and '__constant char *')}}
462 #else
463 #ifndef CONSTANT
464 // expected-error-re@-5{{conditional operator with the second and third operands of type ('__{{global|generic}} int *' and '__constant char *') which are pointers to non-overlapping address spaces}}
465 #else
466 // expected-warning@-7{{pointer type mismatch ('__constant int *' and '__constant char *')}}
467 #endif
468 #endif
470 __private char *var_priv_ch;
471 var_void_gen = 0 ? var_cond : var_priv_ch;
472 #if __OPENCL_CPP_VERSION__
473 // expected-error-re@-2{{incompatible operand types ('__{{constant|global|generic}} int *' and '__private char *')}}
474 #else
475 #ifndef GENERIC
476 // expected-error-re@-5{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and '__private char *') which are pointers to non-overlapping address spaces}}
477 #else
478 // expected-warning@-7{{pointer type mismatch ('__generic int *' and '__private char *')}}
479 #endif
480 #endif
482 __generic char *var_gen_ch;
483 var_void_gen = 0 ? var_cond : var_gen_ch;
484 #if __OPENCL_CPP_VERSION__
485 // expected-error-re@-2{{incompatible operand types ('__{{constant|global|generic}} int *' and '__generic char *')}}
486 #else
487 #ifdef CONSTANT
488 // expected-error@-5{{conditional operator with the second and third operands of type ('__constant int *' and '__generic char *') which are pointers to non-overlapping address spaces}}
489 #else
490 // expected-warning-re@-7{{pointer type mismatch ('__{{global|generic}} int *' and '__generic char *')}}
491 #endif
492 #endif
495 void test_pointer_chains() {
496 AS int *AS *var_as_as_int;
497 AS int *AS_COMP *var_asc_as_int;
498 AS_INCOMP int *AS_COMP *var_asc_asn_int;
499 AS_COMP int *AS_COMP *var_asc_asc_int;
501 // Case 1:
502 // * address spaces of corresponded most outer pointees overlaps, their canonical types are equal
503 // * CVR, address spaces and canonical types of the rest of pointees are equivalent.
504 var_as_as_int = var_asc_as_int;
505 var_as_as_int = 0 ? var_as_as_int : var_asc_as_int;
507 // Case 2: Corresponded inner pointees has non-overlapping address spaces.
508 var_as_as_int = 0 ? var_as_as_int : var_asc_asn_int;
509 #if !__OPENCL_CPP_VERSION__
510 // expected-warning-re@-2{{pointer type mismatch ('__{{(generic|global|constant)}} int *__{{(generic|global|constant)}} *' and '__{{(local|global|constant)}} int *__{{(constant|local|global)}} *')}}
511 #else
512 // expected-error-re@-4{{incompatible operand types ('__{{(generic|global|constant)}} int *__{{(generic|global|constant)}} *' and '__{{(local|global|constant)}} int *__{{(constant|local|global)}} *')}}
513 #endif
515 // Case 3: Corresponded inner pointees has overlapping but not equivalent address spaces.
516 // FIXME: Should this really be allowed in C++ mode?
517 var_as_as_int = var_asc_asc_int;
518 #if !__OPENCL_CPP_VERSION__
519 #ifdef GENERIC
520 // expected-error@-3 {{assigning '__local int *__local *__private' to '__generic int *__generic *__private' changes address space of nested pointer}}
521 #endif
522 #endif
523 var_as_as_int = 0 ? var_as_as_int : var_asc_asc_int;
524 #if !__OPENCL_CPP_VERSION__
525 #ifdef GENERIC
526 // expected-warning@-3{{pointer type mismatch ('__generic int *__generic *' and '__local int *__local *')}}
527 #endif
528 #endif