1 // RUN
: %clang_cc1 -triple spir-unknown-unknown -verify -cl-std
=CL3.0 -cl-ext
=-__opencl_c_images
,-__opencl_c_read_write_images
,-cl_khr_3d_image_writes
,-__opencl_c_3d_image_writes %s
2 // RUN
: %clang_cc1 -triple spir-unknown-unknown -verify -cl-std
=CL3.0 -cl-ext
=+__opencl_c_images
,+__opencl_c_read_write_images
,+cl_khr_3d_image_writes
,+__opencl_c_3d_image_writes %s
3 // RUN
: %clang_cc1 -triple spir-unknown-unknown -verify -cl-std
=CL3.0 -cl-ext
=+__opencl_c_images
,+__opencl_c_read_write_images
,-cl_khr_3d_image_writes
,-__opencl_c_3d_image_writes %s
4 // RUN
: %clang_cc1 -triple spir-unknown-unknown -verify -cl-std
=clc
++2021 -cl-ext
=-__opencl_c_images
,-__opencl_c_read_write_images
,-cl_khr_3d_image_writes
,-__opencl_c_3d_image_writes %s
5 // RUN
: %clang_cc1 -triple spir-unknown-unknown -verify -cl-std
=clc
++2021 -cl-ext
=+__opencl_c_images
,+__opencl_c_read_write_images
,+cl_khr_3d_image_writes
,+__opencl_c_3d_image_writes %s
6 // RUN
: %clang_cc1 -triple spir-unknown-unknown -verify -cl-std
=clc
++2021 -cl-ext
=+__opencl_c_images
,+__opencl_c_read_write_images
,-cl_khr_3d_image_writes
,-__opencl_c_3d_image_writes %s
8 #if defined
(__opencl_c_images) && defined
(__opencl_c_3d_image_writes)
9 //expected-no-diagnostics
12 void test1
(image1d_t i
) {}
13 #if
!defined
(__opencl_c_images)
14 // expected-error
@-
2{{use of type
'__read_only image1d_t
' requires __opencl_c_images support
}}
17 void test2
(image2d_t i
) {}
18 #if
!defined
(__opencl_c_images)
19 // expected-error
@-
2{{use of type
'__read_only image2d_t
' requires __opencl_c_images support
}}
22 void test3
(image1d_array_t i
) {}
23 #if
!defined
(__opencl_c_images)
24 // expected-error
@-
2{{use of type
'__read_only image1d_array_t
' requires __opencl_c_images support
}}
27 void test4
(image2d_array_t i
) {}
28 #if
!defined
(__opencl_c_images)
29 // expected-error
@-
2{{use of type
'__read_only image2d_array_t
' requires __opencl_c_images support
}}
32 void test5
(image2d_depth_t i
) {}
33 #if
!defined
(__opencl_c_images)
34 // expected-error
@-
2{{use of type
'__read_only image2d_depth_t
' requires __opencl_c_images support
}}
37 void test6
(image1d_buffer_t i
) {}
38 #if
!defined
(__opencl_c_images)
39 // expected-error
@-
2{{use of type
'__read_only image1d_buffer_t
' requires __opencl_c_images support
}}
42 void test7
(image2d_msaa_t i
) {}
43 #if
!defined
(__opencl_c_images)
44 // expected-error
@-
2{{use of type
'__read_only image2d_msaa_t
' requires __opencl_c_images support
}}
47 void test8
(image2d_array_msaa_t i
) {}
48 #if
!defined
(__opencl_c_images)
49 // expected-error
@-
2{{use of type
'__read_only image2d_array_msaa_t
' requires __opencl_c_images support
}}
52 void test9
(image2d_msaa_depth_t i
) {}
53 #if
!defined
(__opencl_c_images)
54 // expected-error
@-
2{{use of type
'__read_only image2d_msaa_depth_t
' requires __opencl_c_images support
}}
57 void test10
(image2d_array_msaa_depth_t i
) {}
58 #if
!defined
(__opencl_c_images)
59 // expected-error
@-
2{{use of type
'__read_only image2d_array_msaa_depth_t
' requires __opencl_c_images support
}}
62 void test11
(sampler_t s
) {}
63 #if
!defined
(__opencl_c_images)
64 // expected-error
@-
2{{use of type
'sampler_t
' requires __opencl_c_images support
}}
67 void test12
(write_only image3d_t i
) {}
68 #if
!defined
(__opencl_c_images)
69 // expected-error
@-
2{{use of type
'__write_only image3d_t
' requires __opencl_c_images support
}}
70 #elif
!defined
(__opencl_c_3d_image_writes)
71 // expected-error
@-
4{{use of type
'__write_only image3d_t
' requires cl_khr_3d_image_writes and __opencl_c_3d_image_writes support
}}