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"
25 #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers
: enable
27 #ifndef __cl_clang_function_pointers
28 #error
"Missing __cl_clang_function_pointers define"
30 #pragma OPENCL EXTENSION __cl_clang_function_pointers
: enable
32 #ifndef __cl_clang_variadic_functions
33 #error
"Missing __cl_clang_variadic_functions define"
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"
40 #pragma OPENCL EXTENSION __cl_clang_non_portable_kernel_param_types
: enable
42 #ifndef __cl_clang_bitfields
43 #error
"Missing __cl_clang_bitfields define"
45 #pragma OPENCL EXTENSION __cl_clang_bitfields
: enable
48 #error
"Incorrect cl_khr_fp16 define"
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"
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"
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"
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
}}
75 #ifndef cl_khr_global_int32_base_atomics
76 #error
"Missing cl_khr_global_int32_base_atomics define"
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
}}
83 #ifndef cl_khr_global_int32_extended_atomics
84 #error
"Missing cl_khr_global_int32_extended_atomics define"
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
}}
91 #ifndef cl_khr_local_int32_base_atomics
92 #error
"Missing cl_khr_local_int32_base_atomics define"
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
}}
99 #ifndef cl_khr_local_int32_extended_atomics
100 #error
"Missing cl_khr_local_int32_extended_atomics define"
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
}}
107 // Core feature in CL
1.2
110 #error
"Missing cl_khr_fp64 define"
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
}}
118 #error
"Incorrect cl_khr_fp64 define"
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"
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"
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"
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"
146 #pragma OPENCL EXTENSION cl_khr_subgroups
: enable
147 // expected-warning
@-
1{{unsupported OpenCL extension
'cl_khr_subgroups
' - ignoring
}}