Index: test/SemaOpenCL/ternary-implicit-casts-fail.cl =================================================================== --- test/SemaOpenCL/ternary-implicit-casts-fail.cl +++ test/SemaOpenCL/ternary-implicit-casts-fail.cl @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 %s +// XFAIL: * + +kernel void implicit_cast_local(global int* gint, local int* lint, int cond) +{ + local int *ptr = cond ? gint : lint; // will not compile, ptr is not generic but local +} Index: test/SemaOpenCL/ternary-implicit-casts-succ.cl =================================================================== --- test/SemaOpenCL/ternary-implicit-casts-succ.cl +++ test/SemaOpenCL/ternary-implicit-casts-succ.cl @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 %s + +kernel void implicit_cast_private(global int* gint, local int* lint, int cond) { + // will work, ptr is generic and can accept global and local + int* ptr = cond ? gint : lint; +}