File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -600,9 +600,11 @@ typedef struct {
600600// C++ for OpenCL - __remove_address_space
601601#if defined(__OPENCL_CPP_VERSION__)
602602template <typename _Tp> struct __remove_address_space { using type = _Tp; };
603+ #if defined(__opencl_c_generic_address_space)
603604template <typename _Tp> struct __remove_address_space <__generic _Tp> {
604605 using type = _Tp;
605606};
607+ #endif
606608template <typename _Tp> struct __remove_address_space <__global _Tp> {
607609 using type = _Tp;
608610};
Original file line number Diff line number Diff line change 1- // RUN: %clang_cc1 %s -cl-std=clc++ -fdeclare-opencl-builtins -finclude-default-header
1+ // RUN: %clang_cc1 %s -cl-std=clc++1.0 -triple spir-unknown-unknown -fdeclare-opencl-builtins -finclude-default-header -verify
2+ // RUN: %clang_cc1 %s -cl-std=clc++2021 -triple spir-unknown-unknown -fdeclare-opencl-builtins -finclude-default-header -verify
3+ // RUN: %clang_cc1 %s -cl-std=clc++2021 -cl-ext=-__opencl_c_generic_address_space,-__opencl_c_pipes -triple spir-unknown-unknown -fdeclare-opencl-builtins -finclude-default-header -verify
4+
5+ // expected-no-diagnostics
26
37template<typename T, typename U>
48struct is_same {
@@ -19,8 +23,10 @@ void test_is_same() {
1923void test_remove_address_space() {
2024 static_assert(is_same<__remove_address_space<int>::type, int>::value,
2125 "type without an address space unexpectedly modified by __remove_address_space");
26+ #if defined(__opencl_c_generic_address_space)
2227 static_assert(is_same<__remove_address_space<__generic int>::type, int>::value,
2328 "__generic address space not removed by __remove_address_space");
29+ #endif
2430 static_assert(is_same<__remove_address_space<__global char>::type, char>::value,
2531 "__global address space not removed by __remove_address_space");
2632 static_assert(is_same<__remove_address_space<__private ulong>::type, ulong>::value,
You can’t perform that action at this time.
0 commit comments