diff --git a/clang/lib/Basic/Targets/AMDGPU.h b/clang/lib/Basic/Targets/AMDGPU.h index a51d8d2375cfe..1d8f27ab915e2 100644 --- a/clang/lib/Basic/Targets/AMDGPU.h +++ b/clang/lib/Basic/Targets/AMDGPU.h @@ -316,8 +316,10 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo { Opts["cl_amd_media_ops"] = true; Opts["cl_amd_media_ops2"] = true; + // FIXME: Check subtarget for image support. Opts["__opencl_c_images"] = true; Opts["__opencl_c_3d_image_writes"] = true; + Opts["__opencl_c_read_write_images"] = true; Opts["cl_khr_3d_image_writes"] = true; Opts["__opencl_c_program_scope_global_variables"] = true; Opts["__opencl_c_atomic_order_seq_cst"] = true; diff --git a/clang/test/Misc/amdgcn.languageOptsOpenCL.cl b/clang/test/Misc/amdgcn.languageOptsOpenCL.cl index 80c0825895c86..57ea891b3eb29 100644 --- a/clang/test/Misc/amdgcn.languageOptsOpenCL.cl +++ b/clang/test/Misc/amdgcn.languageOptsOpenCL.cl @@ -162,6 +162,10 @@ #ifndef __opencl_c_program_scope_global_variables #error "Missing __opencl_c_program_scope_global_variables define" #endif + + #ifndef __opencl_c_read_write_images + #error "Missing __opencl_c_read_write_images define" + #endif #endif #if (__OPENCL_C_VERSION__ >= 300)