1 // RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
3 template<typename T
, unsigned int n
> struct my_vector_base
;
6 struct my_vector_base
<T
, 1> {
7 typedef T Native_vec_
__attribute__((ext_vector_type(1)));
17 template<typename T
, unsigned int rank
>
18 struct my_vector_type
: public my_vector_base
<T
, rank
> {
19 using my_vector_base
<T
, rank
>::data
;
20 using typename my_vector_base
<T
, rank
>::Native_vec_
;
23 my_vector_type(U x
) noexcept
25 for (auto i
= 0u; i
!= rank
; ++i
) data
[i
] = x
;
27 my_vector_type
& operator+=(const my_vector_type
& x
) noexcept
34 template<typename T
, unsigned int n
>
36 my_vector_type
<T
, n
> operator+(
37 const my_vector_type
<T
, n
>& x
, const my_vector_type
<T
, n
>& y
) noexcept
39 return my_vector_type
<T
, n
>{x
} += y
;
42 using char1
= my_vector_type
<char, 1>;
49 // CHECK: [[TMP:%.+]] = alloca i16
50 // CHECK: [[COERCE:%.+]] = addrspacecast ptr addrspace(5) [[TMP]] to ptr
51 // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %{{.+}}, ptr align 2 [[COERCE]], i64 1, i1 false)