// RUN: %clang_cc1 %s -fblocks -verify -pedantic -fsyntax-only -ferror-limit 100
// RUN: %clang_cc1 %s -fblocks -verify -pedantic -fsyntax-only -ferror-limit 100 -cl-std=CL1.2
// RUN: %clang_cc1 %s -fblocks -verify -pedantic -fsyntax-only -ferror-limit 100 -cl-std=CL3.0 -cl-ext=-__opencl_c_device_enqueue,-__opencl_c_generic_address_space,-__opencl_c_pipes
// Confirm CL2.0 Clang builtins are not available in earlier versions and in OpenCL C 3.0 without required features.
kernel void dse_builtins;
enqueue_kernel;
unsigned size = get_kernel_work_group_size;
size = get_kernel_preferred_work_group_size_multiple;
#if && !defined
// expected-error@-10{{support disabled - compile with -fblocks or for OpenCL C 2.0 or OpenCL C 3.0 with __opencl_c_device_enqueue feature}}
// FIXME: the typo correction for the undeclared identifiers finds alternative
// suggestions, but instantiating the typo correction causes us to
// re-instantiate the argument to the call, which triggers the support
// diagnostic a second time.
// expected-error@-12 2{{support disabled - compile with -fblocks or for OpenCL C 2.0 or OpenCL C 3.0 with __opencl_c_device_enqueue feature}}
// expected-error@-10 2{{support disabled - compile with -fblocks or for OpenCL C 2.0 or OpenCL C 3.0 with __opencl_c_device_enqueue feature}}
#endif
}
void pipe_builtins {
int tmp;
// FIXME: the typo correction for this case goes off the rails and tries to
// convert this mistake into a for loop instead of a local function
// declaration.
foo; // expected-error{{use of undeclared identifier 'foo'; did you mean 'for'?}}
// expected-error@-1{{expected identifier or ' {
int tmp