Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Misc / r600.languageOptsOpenCL.cl
blob600c49f4ed692632f42f26b0fd63dd06b8f5d0e7
1 // REQUIRES: amdgpu-registered-target
2 // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -target-cpu cayman
3 // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -target-cpu cayman
4 // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -target-cpu cayman
5 // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cayman
6 // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cayman
7 // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cayman
8 // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -target-cpu cypress
9 // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -target-cpu cypress
10 // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -target-cpu cypress
11 // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cypress
12 // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cypress
13 // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu cypress
14 // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -target-cpu turks
15 // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -target-cpu turks
16 // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -target-cpu turks
17 // RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu turks
18 // RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu turks
19 // RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple r600-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES -target-cpu turks
21 // Extensions in all versions
22 #ifndef cl_clang_storage_class_specifiers
23 #error "Missing cl_clang_storage_class_specifiers define"
24 #endif
25 #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
27 #ifndef __cl_clang_function_pointers
28 #error "Missing __cl_clang_function_pointers define"
29 #endif
30 #pragma OPENCL EXTENSION __cl_clang_function_pointers : enable
32 #ifndef __cl_clang_variadic_functions
33 #error "Missing __cl_clang_variadic_functions define"
34 #endif
35 #pragma OPENCL EXTENSION __cl_clang_variadic_functions : enable
37 #ifndef __cl_clang_non_portable_kernel_param_types
38 #error "Missing __cl_clang_non_portable_kernel_param_types define"
39 #endif
40 #pragma OPENCL EXTENSION __cl_clang_non_portable_kernel_param_types : enable
42 #ifndef __cl_clang_bitfields
43 #error "Missing __cl_clang_bitfields define"
44 #endif
45 #pragma OPENCL EXTENSION __cl_clang_bitfields : enable
47 #ifdef cl_khr_fp16
48 #error "Incorrect cl_khr_fp16 define"
49 #endif
50 #pragma OPENCL EXTENSION cl_khr_fp16: enable
51 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_fp16' - ignoring}}
53 #ifdef cl_khr_int64_base_atomics
54 #error "Incorrect cl_khr_int64_base_atomics define"
55 #endif
56 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable
57 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_int64_base_atomics' - ignoring}}
59 #ifdef cl_khr_int64_extended_atomics
60 #error "Incorrect cl_khr_int64_extended_atomics define"
61 #endif
62 #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics: enable
63 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_int64_extended_atomics' - ignoring}}
65 // Core features in CL 1.1
67 #ifndef cl_khr_byte_addressable_store
68 #error "Missing cl_khr_byte_addressable_store define"
69 #endif
70 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store: enable
71 #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
72 // expected-warning@-2{{OpenCL extension 'cl_khr_byte_addressable_store' is core feature or supported optional core feature - ignoring}}
73 #endif
75 #ifndef cl_khr_global_int32_base_atomics
76 #error "Missing cl_khr_global_int32_base_atomics define"
77 #endif
78 #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics: enable
79 #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
80 // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_base_atomics' is core feature or supported optional core feature - ignoring}}
81 #endif
83 #ifndef cl_khr_global_int32_extended_atomics
84 #error "Missing cl_khr_global_int32_extended_atomics define"
85 #endif
86 #pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics: enable
87 #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
88 // expected-warning@-2{{OpenCL extension 'cl_khr_global_int32_extended_atomics' is core feature or supported optional core feature - ignoring}}
89 #endif
91 #ifndef cl_khr_local_int32_base_atomics
92 #error "Missing cl_khr_local_int32_base_atomics define"
93 #endif
94 #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics: enable
95 #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
96 // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_base_atomics' is core feature or supported optional core feature - ignoring}}
97 #endif
99 #ifndef cl_khr_local_int32_extended_atomics
100 #error "Missing cl_khr_local_int32_extended_atomics define"
101 #endif
102 #pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics: enable
103 #if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
104 // expected-warning@-2{{OpenCL extension 'cl_khr_local_int32_extended_atomics' is core feature or supported optional core feature - ignoring}}
105 #endif
107 // Core feature in CL 1.2
108 #ifdef __HAS_FP64__
109 #ifndef cl_khr_fp64
110 #error "Missing cl_khr_fp64 define"
111 #endif
112 #pragma OPENCL EXTENSION cl_khr_fp64: enable
113 #if (__OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES
114 // expected-warning@-2{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}}
115 #endif
116 #else
117 #ifdef cl_khr_fp64
118 #error "Incorrect cl_khr_fp64 define"
119 #endif
120 #pragma OPENCL EXTENSION cl_khr_fp64: enable
121 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_fp64' - ignoring}}
122 #endif // __HAS_FP64__
124 //Core feature in CL 2.0
125 #ifdef cl_khr_3d_image_writes
126 #error "Incorrect cl_khr_3d_image_writes define"
127 #endif
128 #pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable
129 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_3d_image_writes' - ignoring}}
131 #ifdef cl_khr_gl_msaa_sharing
132 #error "Incorrect cl_khr_gl_msaa_sharing define"
133 #endif
134 #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing: enable
135 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring}}
137 #ifdef cl_khr_srgb_image_writes
138 #error "Incorrect cl_khr_srgb_image_writes define"
139 #endif
140 #pragma OPENCL EXTENSION cl_khr_srgb_image_writes: enable
141 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_srgb_image_writes' - ignoring}}
143 #ifdef cl_khr_subgroups
144 #error "Incorrect cl_khr_subgroups define"
145 #endif
146 #pragma OPENCL EXTENSION cl_khr_subgroups: enable
147 // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}}