Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaOpenCL / unsupported-image.cl
blob53422fa259f29106252b347fed398f371079309a
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
10 #endif
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}}
15 #endif
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}}
20 #endif
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}}
25 #endif
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}}
30 #endif
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}}
35 #endif
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}}
40 #endif
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}}
45 #endif
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}}
50 #endif
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}}
55 #endif
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}}
60 #endif
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}}
65 #endif
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}}
72 #endif