Skip to content

Commit 6e62d01

Browse files
committed
add a regression test
1 parent 4b68393 commit 6e62d01

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %clang %s -c -S -emit-llvm -O2 -march=x86-64-v3 -o - | FileCheck %s
2+
3+
using UInt64x2 = unsigned long long __attribute__((__vector_size__(16), may_alias));
4+
5+
template<int id>
6+
struct XMM1 {
7+
UInt64x2 x;
8+
};
9+
10+
struct XMM2 : XMM1<0>, XMM1<1> {
11+
};
12+
13+
// CHECK: define{{.*}} @_Z3foov({{.*}} [[ARG:%.*]]){{.*}}
14+
// CHECK-NEXT: entry:
15+
// CHECK-NEXT: store {{.*}}, ptr [[ARG]]{{.*}}
16+
// CHECK-NEXT: [[TMP1:%.*]] = getelementptr {{.*}}, ptr [[ARG]]{{.*}}
17+
// CHECK-NEXT: store {{.*}}, ptr [[TMP1]]{{.*}}
18+
XMM2 foo() {
19+
XMM2 result;
20+
((XMM1<0>*)&result)->x = UInt64x2{1, 2};
21+
((XMM1<1>*)&result)->x = UInt64x2{3, 4};
22+
return result;
23+
}

0 commit comments

Comments
 (0)