Skip to content

Commit 518f4c3

Browse files
committed
Add test for union
1 parent 2901b98 commit 518f4c3

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

sycl/source/detail/builtins_relational.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace s = cl::sycl;
1818
namespace d = s::detail;
1919

2020
__SYCL_INLINE_NAMESPACE(cl) {
21-
namespace sycl {
22-
} // namespace sycl
2321
namespace __host_std {
2422
namespace {
2523

sycl/test/basic_tests/types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ template <> inline void checkSizeForFloatingPoint<s::half, sizeof(int16_t)>() {
9090
}
9191

9292
int main() {
93-
// Test for half constexpr default constructors
93+
// Test for creating constexpr expressions
9494
constexpr sycl::specialization_id<sycl::vec<sycl::half, 2>> id(1.0);
9595
constexpr sycl::marray<sycl::half, 2> MH(3);
9696
// Check the size and alignment of the SYCL vectors.

sycl/test/regression/half_union.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %clangxx -fsycl %s -o %t.out
2+
// RUN: %RUN_ON_HOST %t.out
3+
4+
#include <CL/sycl.hpp>
5+
6+
typedef union _u16_to_half {
7+
unsigned short u;
8+
cl::sycl::half h;
9+
} u16_to_sycl_half;
10+
11+
int main() {
12+
u16_to_sycl_half unh;
13+
return 0;
14+
}

0 commit comments

Comments
 (0)