1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -S -emit-llvm -fsanitize=alignment %s -o - | FileCheck %s
3 struct alignas(32) S1
{
8 struct alignas(32) S2
{
12 struct alignas(32) S3
{
14 S3(int *p
= new int[4]);
17 struct S4
: public S3
{
21 typedef __attribute__((ext_vector_type(8), aligned(32))) float float32x8_t
;
27 void *operator new (unsigned long, void *p
) { return p
; }
28 void *operator new[] (unsigned long, void *p
) { return p
; }
31 // CHECK-LABEL: define {{.*}} @_Z7func_01v
32 // CHECK: and i64 %{{.*}}, 31, !nosanitize
33 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
34 // CHECK: call void @_ZN2S1C1Ev(
35 // CHECK-NOT: and i64 %{{.*}}, 31
41 // CHECK-LABEL: define {{.*}} @_Z7func_02v
42 // CHECK: and i64 %{{.*}}, 31, !nosanitize
43 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
49 // CHECK-LABEL: define {{.*}} @_Z7func_03v
50 // CHECK: and i64 %{{.*}}, 31, !nosanitize
51 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
52 // CHECK-NOT: and i64 %{{.*}}, 31
57 float32x8_t
*func_04() {
58 // CHECK-LABEL: define {{.*}} @_Z7func_04v
59 // CHECK: and i64 %{{.*}}, 31, !nosanitize
60 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
62 return new float32x8_t
;
65 float32x8_t
*func_05() {
66 // CHECK-LABEL: define {{.*}} @_Z7func_05v
67 // CHECK: and i64 %{{.*}}, 31, !nosanitize
68 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
69 // CHECK-NOT: and i64 %{{.*}}, 31
71 return new float32x8_t
[20];
75 // CHECK-LABEL: define {{.*}} @_Z7func_07v
76 // CHECK: and i64 %{{.*}}, 31, !nosanitize
77 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
78 // CHECK: and i64 %{{.*}}, 3, !nosanitize
79 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
85 // CHECK-LABEL: define {{.*}} @_Z7func_08v
86 // CHECK: and i64 %{{.*}}, 31, !nosanitize
87 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
88 // CHECK: and i64 %{{.*}}, 3, !nosanitize
89 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
95 S2
*func_10(void *p
) {
96 // CHECK-LABEL: define {{.*}} @_Z7func_10Pv
97 // CHECK: and i64 %{{.*}}, 31, !nosanitize
98 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
103 S2
*func_11(void *p
) {
104 // CHECK-LABEL: define {{.*}} @_Z7func_11Pv
105 // CHECK: and i64 %{{.*}}, 31, !nosanitize
106 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
107 // CHECK-NOT: and i64 %{{.*}}, 31, !nosanitize
108 // CHECK-NOT: icmp eq i64 %{{.*}}, 0, !nosanitize
110 return new(p
) S2
[10];
113 float32x8_t
*func_12() {
114 // CHECK-LABEL: define {{.*}} @_Z7func_12v
115 // CHECK: and i64 %{{.*}}, 31, !nosanitize
116 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
118 return new float32x8_t
;
121 float32x8_t
*func_13() {
122 // CHECK-LABEL: define {{.*}} @_Z7func_13v
123 // CHECK: and i64 %{{.*}}, 31, !nosanitize
124 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
125 // CHECK-NOT: and i64 %{{.*}}, 31
127 return new float32x8_t
[20];
131 // CHECK-LABEL: define {{.*}} @_Z7func_14v
132 // CHECK: and i64 %{{.*}}, 31, !nosanitize
133 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
134 // CHECK-NOT: and i64 %{{.*}}, 31
139 S5
*func_15(const S5
*ptr
) {
140 // CHECK-LABEL: define {{.*}} @_Z7func_15PK2S5
141 // CHECK: and i64 %{{.*}}, 31, !nosanitize
142 // CHECK: icmp eq i64 %{{.*}}, 0, !nosanitize
143 // CHECK-NOT: and i64