Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -2127,6 +2127,7 @@ Opts.cl_khr_int64_base_atomics = 1; Opts.cl_khr_int64_extended_atomics = 1; Opts.cl_khr_mipmap_image = 1; + Opts.cl_khr_subgroups = 1; Opts.cl_khr_3d_image_writes = 1; } } Index: test/Misc/amdgcn.languageOptsOpenCL.cl =================================================================== --- test/Misc/amdgcn.languageOptsOpenCL.cl +++ test/Misc/amdgcn.languageOptsOpenCL.cl @@ -199,11 +199,17 @@ #pragma OPENCL EXTENSION cl_khr_srgb_image_writes: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_srgb_image_writes' - ignoring}} +#if (__OPENCL_C_VERSION__ >= 200) +#ifndef cl_khr_subgroups +#error "Missing cl_khr_subgroups define" +#endif +#else #ifdef cl_khr_subgroups #error "Incorrect cl_khr_subgroups define" #endif +// expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} +#endif #pragma OPENCL EXTENSION cl_khr_subgroups: enable -// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} #ifdef cl_khr_terminate_context #error "Incorrect cl_khr_terminate_context define" Index: test/SemaOpenCL/extension-version.cl =================================================================== --- test/SemaOpenCL/extension-version.cl +++ test/SemaOpenCL/extension-version.cl @@ -247,6 +247,9 @@ #error "Missing cl_khr_subgroups define" #endif #else +#ifdef cl_khr_subgroups +#error "Incorrect cl_khr_subgroups define" +#endif // expected-warning@+2{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} #endif #pragma OPENCL EXTENSION cl_khr_subgroups: enable