1 // REQUIRES
: amdgpu-registered-target
2 // RUN
: %clang_cc1 -x cl -cl-std
=CL %s -verify -triple amdgcn-unknown-unknown
3 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.1 %s -verify -triple amdgcn-unknown-unknown
4 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.2 %s -verify -triple amdgcn-unknown-unknown
5 // RUN
: %clang_cc1 -x cl -cl-std
=CL2.0 %s -verify -triple amdgcn-unknown-unknown
6 // RUN
: %clang_cc1 -x cl -cl-std
=CL %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
7 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.1 %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
8 // RUN
: %clang_cc1 -x cl -cl-std
=CL1.2 %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
9 // RUN
: %clang_cc1 -x cl -cl-std
=CL2.0 %s -verify -triple amdgcn-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
11 // Extensions in all versions
12 #ifndef cl_clang_storage_class_specifiers
13 #error
"Missing cl_clang_storage_class_specifiers define"
15 #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers
: enable
17 #ifndef __cl_clang_function_pointers
18 #error
"Missing __cl_clang_function_pointers define"
20 #pragma OPENCL EXTENSION __cl_clang_function_pointers
: enable
22 #ifndef __cl_clang_variadic_functions
23 #error
"Missing __cl_clang_variadic_functions define"
25 #pragma OPENCL EXTENSION __cl_clang_variadic_functions
: enable
27 #ifndef __cl_clang_non_portable_kernel_param_types
28 #error
"Missing __cl_clang_non_portable_kernel_param_types define"
30 #pragma OPENCL EXTENSION __cl_clang_non_portable_kernel_param_types
: enable
32 #ifndef __cl_clang_bitfields
33 #error
"Missing __cl_clang_bitfields define"
35 #pragma OPENCL EXTENSION __cl_clang_bitfields
: enable
38 #error
"Missing cl_khr_fp16 define"
40 #pragma OPENCL EXTENSION cl_khr_fp16
: enable
42 #ifndef cl_khr_int64_base_atomics
43 #error
"Missing cl_khr_int64_base_atomics define"
45 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics
: enable
47 #ifndef cl_khr_int64_extended_atomics
48 #error
"Missing cl_khr_int64_extended_atomics define"
50 #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics
: enable
52 // Core features in CL
1.1
54 #ifndef cl_khr_byte_addressable_store
55 #error
"Missing cl_khr_byte_addressable_store define"
57 #pragma OPENCL EXTENSION cl_khr_byte_addressable_store
: enable
58 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
59 // expected-warning
@-
2{{OpenCL extension
'cl_khr_byte_addressable_store
' is core feature or supported optional core feature - ignoring
}}
62 #ifndef cl_khr_global_int32_base_atomics
63 #error
"Missing cl_khr_global_int32_base_atomics define"
65 #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics
: enable
66 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
67 // expected-warning
@-
2{{OpenCL extension
'cl_khr_global_int32_base_atomics
' is core feature or supported optional core feature - ignoring
}}
70 #ifndef cl_khr_global_int32_extended_atomics
71 #error
"Missing cl_khr_global_int32_extended_atomics define"
73 #pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics
: enable
74 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
75 // expected-warning
@-
2{{OpenCL extension
'cl_khr_global_int32_extended_atomics
' is core feature or supported optional core feature - ignoring
}}
78 #ifndef cl_khr_local_int32_base_atomics
79 #error
"Missing cl_khr_local_int32_base_atomics define"
81 #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics
: enable
82 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
83 // expected-warning
@-
2{{OpenCL extension
'cl_khr_local_int32_base_atomics
' is core feature or supported optional core feature - ignoring
}}
86 #ifndef cl_khr_local_int32_extended_atomics
87 #error
"Missing cl_khr_local_int32_extended_atomics define"
89 #pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics
: enable
90 #if
(__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
91 // expected-warning
@-
2{{OpenCL extension
'cl_khr_local_int32_extended_atomics
' is core feature or supported optional core feature - ignoring
}}
94 // Core feature in CL
1.2
96 #error
"Missing cl_khr_fp64 define"
98 #pragma OPENCL EXTENSION cl_khr_fp64
: enable
99 #if
(__OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES
100 // expected-warning
@-
2{{OpenCL extension
'cl_khr_fp64
' is core feature or supported optional core feature - ignoring
}}
103 //Core feature in CL
2.0
104 #ifndef cl_khr_3d_image_writes
105 #error
"Missing cl_khr_3d_image_writes define"
107 #pragma OPENCL EXTENSION cl_khr_3d_image_writes
: enable
108 #if
(__OPENCL_C_VERSION__ >= 200) && defined TEST_CORE_FEATURES
109 // expected-warning
@-
2{{OpenCL extension
'cl_khr_3d_image_writes
' is core feature or supported optional core feature - ignoring
}}
112 #ifdef cl_khr_gl_msaa_sharing
113 #error
"Incorrect cl_khr_gl_msaa_sharing define"
115 #pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing
: enable
116 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_gl_msaa_sharing
' - ignoring
}}
118 #if
(__OPENCL_C_VERSION__ >= 200)
119 #ifndef cl_khr_mipmap_image
120 #error
"Missing cl_khr_mipmap_image define"
123 #ifdef cl_khr_mipmap_image
124 #error
"Incorrect cl_khr_mipmap_image define"
126 // expected-warning
@+2{{unsupported OpenCL extension
'cl_khr_mipmap_image
' - ignoring
}}
128 #pragma OPENCL EXTENSION cl_khr_mipmap_image
: enable
130 #ifdef cl_khr_srgb_image_writes
131 #error
"Incorrect cl_khr_srgb_image_writes define"
133 #pragma OPENCL EXTENSION cl_khr_srgb_image_writes
: enable
134 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_srgb_image_writes
' - ignoring
}}
136 #if
(__OPENCL_C_VERSION__ >= 200)
137 #ifndef cl_khr_subgroups
138 #error
"Missing cl_khr_subgroups define"
141 #ifdef cl_khr_subgroups
142 #error
"Incorrect cl_khr_subgroups define"
144 // expected-warning
@+2{{unsupported OpenCL extension
'cl_khr_subgroups
' - ignoring
}}
146 #pragma OPENCL EXTENSION cl_khr_subgroups
: enable
148 #ifndef cl_amd_media_ops
149 #error
"Missing cl_amd_media_ops define"
151 #pragma OPENCL EXTENSION cl_amd_media_ops
: enable
153 #ifndef cl_amd_media_ops2
154 #error
"Missing cl_amd_media_ops2 define"
156 #pragma OPENCL EXTENSION cl_amd_media_ops2
: enable