Index: test/CodeGenOpenCL/ternary-implicit-casts.cl =================================================================== --- test/CodeGenOpenCL/ternary-implicit-casts.cl +++ test/CodeGenOpenCL/ternary-implicit-casts.cl @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - -ffake-address-space-map +// XFAIL: * + +kernel void implicit_cast_private(global int* gint, local int* lint, int cond) +{ + int *ptr = // ptr takes generic address space + cond ? gint : lint; // expected-warning{{TRUE}} +} + +kernel void implicit_cast_local(global int* gint, local int* lint, int cond) +{ + local int *ptr = // ptr cannot take another address space, because it is already explicitly set + cond ? gint : lint; // expected-warning{{TRUE}} + // it will fail on assignment to ptr +}