Changeset View
Changeset View
Standalone View
Standalone View
clang/test/SemaOpenCL/address-spaces.cl
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | void nested(__global int *g, __global int * __private *gg, __local int *l, __local int * __private *ll, __global float * __private *gg_f) { | ||||
l = ll; // expected-error {{assigning to '__local int *' from incompatible type '__local int *__private *__private'}} | l = ll; // expected-error {{assigning to '__local int *' from incompatible type '__local int *__private *__private'}} | ||||
l = gg_f; // expected-error {{assigning to '__local int *' from incompatible type '__global float *__private *__private'}} | l = gg_f; // expected-error {{assigning to '__local int *' from incompatible type '__global float *__private *__private'}} | ||||
l = (__local int *)gg_f; // expected-error {{C-style cast from '__global float *__private *' to '__local int *' converts between mismatching address spaces}} | l = (__local int *)gg_f; // expected-error {{C-style cast from '__global float *__private *' to '__local int *' converts between mismatching address spaces}} | ||||
ll = g; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global int *__private'}} | ll = g; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global int *__private'}} | ||||
ll = gg; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global int *__private *__private'}} | ll = gg; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global int *__private *__private'}} | ||||
ll = l; // expected-error {{assigning to '__local int *__private *' from incompatible type '__local int *__private'; take the address with &}} | ll = l; // expected-error {{assigning to '__local int *__private *' from incompatible type '__local int *__private'; take the address with &}} | ||||
ll = gg_f; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global float *__private *__private'}} | ll = gg_f; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global float *__private *__private'}} | ||||
// FIXME: The below becomes a reinterpret_cast, and therefore does not emit an error | ll = (__local int *__private *)gg; //expected-warning{{C-style cast from '__global int *__private *' to '__local int *__private *' changes address space of nested pointers}} | ||||
// even though the address space mismatches in the nested pointers. | |||||
ll = (__local int * __private *)gg; | |||||
gg_f = g; // expected-error {{assigning to '__global float *__private *' from incompatible type '__global int *__private'}} | gg_f = g; // expected-error {{assigning to '__global float *__private *' from incompatible type '__global int *__private'}} | ||||
gg_f = gg; // expected-error {{assigning to '__global float *__private *' from incompatible type '__global int *__private *__private'}} | gg_f = gg; // expected-error {{assigning to '__global float *__private *' from incompatible type '__global int *__private *__private'}} | ||||
gg_f = l; // expected-error {{assigning to '__global float *__private *' from incompatible type '__local int *__private'}} | gg_f = l; // expected-error {{assigning to '__global float *__private *' from incompatible type '__local int *__private'}} | ||||
gg_f = ll; // expected-error {{assigning to '__global float *__private *' from incompatible type '__local int *__private *__private'}} | gg_f = ll; // expected-error {{assigning to '__global float *__private *' from incompatible type '__local int *__private *__private'}} | ||||
gg_f = (__global float * __private *)gg; | gg_f = (__global float * __private *)gg; | ||||
typedef __local int * l_t; | typedef __local int * l_t; | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |