|
3 | 3 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_program_scope_global_variables,+__cl_clang_function_scope_local_variables |
4 | 4 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_generic_address_space,+__cl_clang_function_scope_local_variables |
5 | 5 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-all,+__opencl_c_program_scope_global_variables,+__opencl_c_generic_address_space,+__cl_clang_function_scope_local_variables |
| 6 | +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.1 -cl-ext=-all,+__cl_clang_function_scope_local_variables |
| 7 | +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.1 -cl-ext=-all,+__opencl_c_program_scope_global_variables,+__cl_clang_function_scope_local_variables |
| 8 | +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.1 -cl-ext=-all,+__opencl_c_generic_address_space,+__cl_clang_function_scope_local_variables |
| 9 | +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.1 -cl-ext=-all,+__opencl_c_program_scope_global_variables,+__opencl_c_generic_address_space,+__cl_clang_function_scope_local_variables |
6 | 10 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++2021 -cl-ext=-all,+__cl_clang_function_scope_local_variables |
7 | 11 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++2021 -cl-ext=-all,+__opencl_c_program_scope_global_variables,+__cl_clang_function_scope_local_variables |
8 | 12 | // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++2021 -cl-ext=-all,+__opencl_c_generic_address_space,+__cl_clang_function_scope_local_variables |
@@ -50,10 +54,10 @@ static generic float g_generic_static_var = 0; |
50 | 54 | #if (defined(__OPENCL_C_VERSION__) && __OPENCL_C_VERSION__ < 300) |
51 | 55 | // expected-error@-2 {{OpenCL C version 1.2 does not support the 'generic' type qualifier}} |
52 | 56 | // expected-error@-3 {{program scope variable must reside in constant address space}} |
53 | | -#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300) |
| 57 | +#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ >= 300) |
54 | 58 | #if !defined(__opencl_c_generic_address_space) |
55 | | -#if (__OPENCL_C_VERSION__ == 300) |
56 | | -// expected-error@-7 {{OpenCL C version 3.0 does not support the 'generic' type qualifier}} |
| 59 | +#if (__OPENCL_C_VERSION__ >= 300) |
| 60 | +// expected-error-re@-7 {{OpenCL C version {{3.0|3.1}} does not support the 'generic' type qualifier}} |
57 | 61 | #elif (__OPENCL_CPP_VERSION__ == 202100) |
58 | 62 | // expected-error@-9 {{C++ for OpenCL version 2021 does not support the 'generic' type qualifier}} |
59 | 63 | #endif |
@@ -96,10 +100,10 @@ extern generic float g_generic_extern_var; |
96 | 100 | #if (defined(__OPENCL_C_VERSION__) && __OPENCL_C_VERSION__ < 300) |
97 | 101 | // expected-error@-2 {{OpenCL C version 1.2 does not support the 'generic' type qualifier}} |
98 | 102 | // expected-error@-3 {{extern variable must reside in constant address space}} |
99 | | -#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300) |
| 103 | +#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ >= 300) |
100 | 104 | #if !defined(__opencl_c_generic_address_space) |
101 | | -#if (__OPENCL_C_VERSION__ == 300) |
102 | | -// expected-error@-7 {{OpenCL C version 3.0 does not support the 'generic' type qualifier}} |
| 105 | +#if (__OPENCL_C_VERSION__ >= 300) |
| 106 | +// expected-error-re@-7 {{OpenCL C version {{3.0|3.1}} does not support the 'generic' type qualifier}} |
103 | 107 | #elif (__OPENCL_CPP_VERSION__ == 202100) |
104 | 108 | // expected-error@-9 {{C++ for OpenCL version 2021 does not support the 'generic' type qualifier}} |
105 | 109 | #endif |
@@ -138,7 +142,7 @@ void kernel foo(int x) { |
138 | 142 | #if (__OPENCL_CPP_VERSION__ == 202100) |
139 | 143 | // expected-error@-2{{C++ for OpenCL version 2021 does not support the 'auto' storage class specifier}} |
140 | 144 | #else |
141 | | -// expected-error-re@-4{{OpenCL C version {{1.2|3.0}} does not support the 'auto' storage class specifier}} |
| 145 | +// expected-error-re@-4{{OpenCL C version {{1.2|3.0|3.1}} does not support the 'auto' storage class specifier}} |
142 | 146 | #endif |
143 | 147 | global int L4; // expected-error{{function scope variable cannot be declared in global address space}} |
144 | 148 | __attribute__((address_space(100))) int L5; // expected-error{{automatic variable qualified with an invalid address space}} |
@@ -208,10 +212,10 @@ void f(void) { |
208 | 212 | #if (defined(__OPENCL_C_VERSION__) && __OPENCL_C_VERSION__ < 300) |
209 | 213 | // expected-error@-2 {{OpenCL C version 1.2 does not support the 'generic' type qualifier}} |
210 | 214 | // expected-error@-3 {{variables in function scope cannot be declared static}} |
211 | | -#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300) |
| 215 | +#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ >= 300) |
212 | 216 | #if !defined(__opencl_c_generic_address_space) |
213 | | -#if (__OPENCL_C_VERSION__ == 300) |
214 | | -// expected-error@-7 {{OpenCL C version 3.0 does not support the 'generic' type qualifier}} |
| 217 | +#if (__OPENCL_C_VERSION__ >= 300) |
| 218 | +// expected-error-re@-7 {{OpenCL C version {{3.0|3.1}} does not support the 'generic' type qualifier}} |
215 | 219 | #elif (__OPENCL_CPP_VERSION__ == 202100) |
216 | 220 | // expected-error@-9 {{C++ for OpenCL version 2021 does not support the 'generic' type qualifier}} |
217 | 221 | #endif |
@@ -262,10 +266,10 @@ void f(void) { |
262 | 266 | #if (defined(__OPENCL_C_VERSION__) && __OPENCL_C_VERSION__ < 300) |
263 | 267 | // expected-error@-2 {{OpenCL C version 1.2 does not support the 'generic' type qualifier}} |
264 | 268 | // expected-error@-3 {{extern variable must reside in constant address space}} |
265 | | -#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300) |
| 269 | +#elif (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ >= 300) |
266 | 270 | #if !defined(__opencl_c_generic_address_space) |
267 | | -#if (__OPENCL_C_VERSION__ == 300) |
268 | | -// expected-error@-7 {{OpenCL C version 3.0 does not support the 'generic' type qualifier}} |
| 271 | +#if (__OPENCL_C_VERSION__ >= 300) |
| 272 | +// expected-error-re@-7 {{OpenCL C version {{3.0|3.1}} does not support the 'generic' type qualifier}} |
269 | 273 | #elif (__OPENCL_CPP_VERSION__ == 202100 && !defined(__opencl_c_generic_address_space)) |
270 | 274 | // expected-error@-9 {{C++ for OpenCL version 2021 does not support the 'generic' type qualifier}} |
271 | 275 | #endif |
|
0 commit comments