Debian Codegraph @

clang/test/CodeGenCXX/ext-int.cpp

raw
1 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple x86_64-gnu-linux -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN64,NoNewStructPathTBAA
2 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple x86_64-gnu-linux -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN64,NewStructPathTBAA
3
4 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple x86_64-windows-pc -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN64,NoNewStructPathTBAA
5 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple x86_64-windows-pc -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN64,NewStructPathTBAA
6
7 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple i386-gnu-linux -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN32,NoNewStructPathTBAA
8 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple i386-gnu-linux -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN32,NewStructPathTBAA
9
10 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple i386-windows-pc -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN32,NoNewStructPathTBAA
11 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple i386-windows-pc -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN32,NewStructPathTBAA
12
13 namespace std {
14 class type_info { public: virtual ~type_info(); private: const char * name; };
15 } // namespace std
16
17 // Ensure that the layout for these structs is the same as the normal bitfield
18 // layouts.
19 struct BitFieldsByte {
20 _BitInt(7) A : 3;
21 _BitInt(7) B : 3;
22 _BitInt(7) C : 2;
23 };
24 // CHECK: %struct.BitFieldsByte = type { i8 }
25
26 struct BitFieldsShort {
27 _BitInt(15) A : 3;
28 _BitInt(15) B : 3;
29 _BitInt(15) C : 2;
30 };
31 // LIN: %struct.BitFieldsShort = type { i8, i8 }
32 // WIN: %struct.BitFieldsShort = type { i16 }
33
34 struct BitFieldsInt {
35 _BitInt(31) A : 3;
36 _BitInt(31) B : 3;
37 _BitInt(31) C : 2;
38 };
39 // LIN: %struct.BitFieldsInt = type { i8, [3 x i8] }
40 // WIN: %struct.BitFieldsInt = type { i32 }
41
42 struct BitFieldsLong {
43 _BitInt(63) A : 3;
44 _BitInt(63) B : 3;
45 _BitInt(63) C : 2;
46 };
47 // LIN64: %struct.BitFieldsLong = type { i8, [7 x i8] }
48 // LIN32: %struct.BitFieldsLong = type { i8, [3 x i8] }
49 // WIN: %struct.BitFieldsLong = type { i64 }
50
51 struct HasBitIntFirst {
52 _BitInt(35) A;
53 int B;
54 };
55 // CHECK: %struct.HasBitIntFirst = type { i64, i32 }
56
57 struct HasBitIntLast {
58 int A;
59 _BitInt(35) B;
60 };
61 // CHECK: %struct.HasBitIntLast = type { i32, i64 }
62
63 struct HasBitIntMiddle {
64 int A;
65 _BitInt(35) B;
66 int C;
67 };
68 // CHECK: %struct.HasBitIntMiddle = type { i32, i64, i32 }
69
70 // Force emitting of the above structs.
71 void StructEmit() {
72 BitFieldsByte A;
73 BitFieldsShort B;
74 BitFieldsInt C;
75 BitFieldsLong D;
76
77 HasBitIntFirst E;
78 HasBitIntLast F;
79 HasBitIntMiddle G;
80 }
81
82 void BitfieldAssignment() {
83 // LIN: define{{.*}} void @_Z18BitfieldAssignmentv
84 // WIN: define dso_local void @"?BitfieldAssignment@@YAXXZ"
85 BitFieldsByte B;
86 B.A = 3;
87 B.B = 2;
88 B.C = 1;
89 // First one is used for the lifetime start, skip that.
90 // CHECK: %[[LOADA:.+]] = load i8, ptr %[[BFType:.*]]
91 // CHECK: %[[CLEARA:.+]] = and i8 %[[LOADA]], -8
92 // CHECK: %[[SETA:.+]] = or i8 %[[CLEARA]], 3
93 // CHECK: %[[LOADB:.+]] = load i8, ptr %[[BFType:.*]]
94 // CHECK: %[[CLEARB:.+]] = and i8 %[[LOADB]], -57
95 // CHECK: %[[SETB:.+]] = or i8 %[[CLEARB]], 16
96 // CHECK: %[[LOADC:.+]] = load i8, ptr %[[BFType:.*]]
97 // CHECK: %[[CLEARC:.+]] = and i8 %[[LOADC]], 63
98 // CHECK: %[[SETC:.+]] = or i8 %[[CLEARC]], 64
99 }
100
101 unsigned _BitInt(33) ManglingTestRetParam(unsigned _BitInt(33) Param) {
102 // LIN64: define{{.*}} i64 @_Z20ManglingTestRetParamDU33_(i64 %
103 // LIN32: define{{.*}} i33 @_Z20ManglingTestRetParamDU33_(i33 %
104 // WIN: define dso_local i33 @"?ManglingTestRetParam@@YAU?$_UBitInt@$0CB@@__clang@@U12@@Z"(i33
105 return 0;
106 }
107
108 _BitInt(33) ManglingTestRetParam(_BitInt(33) Param) {
109 // LIN64: define{{.*}} i64 @_Z20ManglingTestRetParamDB33_(i64 %
110 // LIN32: define{{.*}} i33 @_Z20ManglingTestRetParamDB33_(i33 %
111 // WIN: define dso_local i33 @"?ManglingTestRetParam@@YAU?$_BitInt@$0CB@@__clang@@U12@@Z"(i33
112 return 0;
113 }
114
115 typedef unsigned _BitInt(16) uint16_t4 __attribute__((ext_vector_type(4)));
116 typedef _BitInt(32) vint32_t8 __attribute__((vector_size(32)));
117
118 template<typename T>
119 void ManglingTestTemplateParam(T&);
120 template<_BitInt(99) T>
121 void ManglingTestNTTP();
122 template <int N>
123 auto ManglingDependent() -> decltype(_BitInt(N){});
124
125 void ManglingInstantiator() {
126 // LIN: define{{.*}} void @_Z20ManglingInstantiatorv()
127 // WIN: define dso_local void @"?ManglingInstantiator@@YAXXZ"()
128 _BitInt(93) A;
129 ManglingTestTemplateParam(A);
130 // LIN: call void @_Z25ManglingTestTemplateParamIDB93_EvRT_(ptr
131 // WIN64: call void @"??$ManglingTestTemplateParam@U?$_BitInt@$0FN@@__clang@@@@YAXAEAU?$_BitInt@$0FN@@__clang@@@Z"(ptr
132 // WIN32: call void @"??$ManglingTestTemplateParam@U?$_BitInt@$0FN@@__clang@@@@YAXAAU?$_BitInt@$0FN@@__clang@@@Z"(ptr
133 constexpr _BitInt(93) B = 993;
134 ManglingTestNTTP<38>();
135 // LIN: call void @_Z16ManglingTestNTTPILDB99_38EEvv()
136 // WIN: call void @"??$ManglingTestNTTP@$0CG@@@YAXXZ"()
137 ManglingTestNTTP<B>();
138 // LIN: call void @_Z16ManglingTestNTTPILDB99_993EEvv()
139 // WIN: call void @"??$ManglingTestNTTP@$0DOB@@@YAXXZ"()
140 ManglingDependent<4>();
141 // LIN: call signext i4 @_Z17ManglingDependentILi4EEDTtlDBT__EEv()
142 // WIN64: call i4 @"??$ManglingDependent@$03@@YAU?$_BitInt@$03@__clang@@XZ"()
143 // WIN32: call signext i4 @"??$ManglingDependent@$03@@YAU?$_BitInt@$03@__clang@@XZ"()
144 uint16_t4 V;
145 ManglingTestTemplateParam(V);
146 // LIN: call void @_Z25ManglingTestTemplateParamIDv4_DU16_EvRT_(ptr
147 // WIN64: call void @"??$ManglingTestTemplateParam@T?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@@@YAXAEAT?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@@Z"(ptr
148 // WIN32: call void @"??$ManglingTestTemplateParam@T?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@@@YAXAAT?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@@Z"(ptr
149
150 }
151
152 void TakesVarargs(int i, ...) {
153 // LIN: define{{.*}} void @_Z12TakesVarargsiz(i32 %i, ...)
154 // WIN: define dso_local void @"?TakesVarargs@@YAXHZZ"(i32 %i, ...)
155
156 __builtin_va_list args;
157 // LIN64: %[[ARGS:.+]] = alloca [1 x %struct.__va_list_tag]
158 // LIN32: %[[ARGS:.+]] = alloca ptr
159 // WIN: %[[ARGS:.+]] = alloca ptr
160 __builtin_va_start(args, i);
161 // LIN64: %[[STARTAD:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %[[ARGS]]
162 // LIN64: call void @llvm.va_start.p0(ptr %[[STARTAD]])
163 // LIN32: call void @llvm.va_start.p0(ptr %[[ARGS]])
164 // WIN: call void @llvm.va_start.p0(ptr %[[ARGS]])
165
166 _BitInt(92) A = __builtin_va_arg(args, _BitInt(92));
167 // LIN64: %[[AD1:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %[[ARGS]]
168 // LIN64: %[[OFA_P1:.+]] = getelementptr inbounds nuw %struct.__va_list_tag, ptr %[[AD1]], i32 0, i32 0
169 // LIN64: %[[GPOFFSET:.+]] = load i32, ptr %[[OFA_P1]]
170 // LIN64: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 32
171 // LIN64: br i1 %[[FITSINGP]]
172 // LIN64: %[[BC1:.+]] = phi ptr
173 // LIN64: %[[LOAD1:.+]] = load i128, ptr %[[BC1]]
174 // LIN64: %[[T:.+]] = trunc i128 %[[LOAD1]] to i92
175 // LIN64: %[[S:.+]] = sext i92 %[[T]] to i128
176 // LIN64: store i128 %[[S]], ptr
177
178 // LIN32: %[[CUR1:.+]] = load ptr, ptr %[[ARGS]]
179 // LIN32: %[[NEXT1:.+]] = getelementptr inbounds i8, ptr %[[CUR1]], i32 12
180 // LIN32: store ptr %[[NEXT1]], ptr %[[ARGS]]
181 // LIN32: %[[LOADV1:.+]] = load i96, ptr %[[CUR1]]
182 // LIN32: %[[TR:.+]] = trunc i96 %[[LOADV1]] to i92
183 // LIN32: %[[SEXT:.+]] = sext i92 %[[TR]] to i96
184 // LIN32: store i96 %[[SEXT]], ptr
185
186 // WIN64: %[[CUR1:.+]] = load ptr, ptr %[[ARGS]]
187 // WIN64: %[[NEXT1:.+]] = getelementptr inbounds i8, ptr %[[CUR1]], i64 8
188 // WIN64: store ptr %[[NEXT1]], ptr %[[ARGS]]
189 // WIN64: %[[LOADP1:.+]] = load ptr, ptr %[[CUR1]]
190 // WIN64: %[[LOADV1:.+]] = load i128, ptr %[[LOADP1]]
191 // WIN64: %[[TR:.+]] = trunc i128 %[[LOADV1]] to i92
192 // WIN64: %[[SEXT:.+]] = sext i92 %[[TR]] to i128
193 // WIN64: store i128 %[[SEXT]], ptr
194
195 // WIN32: %[[CUR1:.+]] = load ptr, ptr %[[ARGS]]
196 // WIN32: %[[NEXT1:.+]] = getelementptr inbounds i8, ptr %[[CUR1]], i32 16
197 // WIN32: store ptr %[[NEXT1]], ptr %[[ARGS]]
198 // WIN32: %[[LOADV1:.+]] = load i128, ptr %[[CUR1]]
199 // WIN32: %[[TR:.+]] = trunc i128 %[[LOADV1]] to i92
200 // WIN32: %[[SEXT:.+]] = sext i92 %[[TR]] to i128
201 // WIN32: store i128 %[[SEXT]], ptr
202
203
204 _BitInt(31) B = __builtin_va_arg(args, _BitInt(31));
205 // LIN64: %[[AD2:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %[[ARGS]]
206 // LIN64: %[[OFA_P2:.+]] = getelementptr inbounds nuw %struct.__va_list_tag, ptr %[[AD2]], i32 0, i32 0
207 // LIN64: %[[GPOFFSET:.+]] = load i32, ptr %[[OFA_P2]]
208 // LIN64: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 40
209 // LIN64: br i1 %[[FITSINGP]]
210 // LIN64: %[[BC1:.+]] = phi ptr
211 // LIN64: %[[LOAD1:.+]] = load i32, ptr %[[BC1]]
212 // LIN64: %[[T:.+]] = trunc i32 %[[LOAD1]] to i31
213 // LIN64: %[[S:.+]] = sext i31 %[[T]] to i32
214 // LIN64: store i32 %[[S]], ptr
215
216 // LIN32: %[[CUR2:.+]] = load ptr, ptr %[[ARGS]]
217 // LIN32: %[[NEXT2:.+]] = getelementptr inbounds i8, ptr %[[CUR2]], i32 4
218 // LIN32: store ptr %[[NEXT2]], ptr %[[ARGS]]
219 // LIN32: %[[LOADV2:.+]] = load i32, ptr %[[CUR2]]
220 // LIN32: %[[T:.+]] = trunc i32 %[[LOADV2]] to i31
221 // LIN32: %[[S:.+]] = sext i31 %[[T]] to i32
222 // LIN32: store i32 %[[S]], ptr
223
224 // WIN64: %[[CUR2:.+]] = load ptr, ptr %[[ARGS]]
225 // WIN64: %[[NEXT2:.+]] = getelementptr inbounds i8, ptr %[[CUR2]], i64 8
226 // WIN64: store ptr %[[NEXT2]], ptr %[[ARGS]]
227 // WIN64: %[[LOADV2:.+]] = load i32, ptr %[[CUR2]]
228 // WIN64: %[[T:.+]] = trunc i32 %[[LOADV2]] to i31
229 // WIN64: %[[S:.+]] = sext i31 %[[T]] to i32
230 // WIN64: store i32 %[[S]], ptr
231
232 // WIN32: %[[CUR2:.+]] = load ptr, ptr %[[ARGS]]
233 // WIN32: %[[NEXT2:.+]] = getelementptr inbounds i8, ptr %[[CUR2]], i32 4
234 // WIN32: store ptr %[[NEXT2]], ptr %[[ARGS]]
235 // WIN32: %[[LOADV2:.+]] = load i32, ptr %[[CUR2]]
236 // WIN32: %[[T:.+]] = trunc i32 %[[LOADV2]] to i31
237 // WIN32: %[[S:.+]] = sext i31 %[[T]] to i32
238 // WIN32: store i32 %[[S]], ptr
239
240 _BitInt(16) C = __builtin_va_arg(args, _BitInt(16));
241 // LIN64: %[[AD3:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %[[ARGS]]
242 // LIN64: %[[OFA_P3:.+]] = getelementptr inbounds nuw %struct.__va_list_tag, ptr %[[AD3]], i32 0, i32 0
243 // LIN64: %[[GPOFFSET:.+]] = load i32, ptr %[[OFA_P3]]
244 // LIN64: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 40
245 // LIN64: br i1 %[[FITSINGP]]
246 // LIN64: %[[BC1:.+]] = phi ptr
247 // LIN64: %[[LOAD1:.+]] = load i16, ptr %[[BC1]]
248 // LIN64: store i16 %[[LOAD1]], ptr
249
250 // LIN32: %[[CUR3:.+]] = load ptr, ptr %[[ARGS]]
251 // LIN32: %[[NEXT3:.+]] = getelementptr inbounds i8, ptr %[[CUR3]], i32 4
252 // LIN32: store ptr %[[NEXT3]], ptr %[[ARGS]]
253 // LIN32: %[[LOADV3:.+]] = load i16, ptr %[[CUR3]]
254 // LIN32: store i16 %[[LOADV3]], ptr
255
256 // WIN64: %[[CUR3:.+]] = load ptr, ptr %[[ARGS]]
257 // WIN64: %[[NEXT3:.+]] = getelementptr inbounds i8, ptr %[[CUR3]], i64 8
258 // WIN64: store ptr %[[NEXT3]], ptr %[[ARGS]]
259 // WIN64: %[[LOADV3:.+]] = load i16, ptr %[[CUR3]]
260 // WIN64: store i16 %[[LOADV3]], ptr
261
262 // WIN32: %[[CUR3:.+]] = load ptr, ptr %[[ARGS]]
263 // WIN32: %[[NEXT3:.+]] = getelementptr inbounds i8, ptr %[[CUR3]], i32 4
264 // WIN32: store ptr %[[NEXT3]], ptr %[[ARGS]]
265 // WIN32: %[[LOADV3:.+]] = load i16, ptr %[[CUR3]]
266 // WIN32: store i16 %[[LOADV3]], ptr
267
268 uint16_t4 D = __builtin_va_arg(args, uint16_t4);
269 // LIN64: %[[AD4:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %[[ARGS]]
270 // LIN64: %[[OFA_P4:.+]] = getelementptr inbounds nuw %struct.__va_list_tag, ptr %[[AD4]], i32 0, i32 1
271 // LIN64: %[[GPOFFSET:.+]] = load i32, ptr %[[OFA_P4]]
272 // LIN64: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 160
273 // LIN64: br i1 %[[FITSINGP]]
274 // LIN64: %[[BC4:.+]] = phi ptr
275 // LIN64: %[[LOADV4:.+]] = load <4 x i16>, ptr %[[BC4]]
276 // LIN64: store <4 x i16> %[[LOADV4]], ptr
277
278 // LIN32: %[[CUR4:.+]] = load ptr, ptr %[[ARGS]]
279 // LIN32: %[[NEXT4:.+]] = getelementptr inbounds i8, ptr %[[CUR4]], i32 8
280 // LIN32: store ptr %[[NEXT4]], ptr %[[ARGS]]
281 // LIN32: %[[LOADV4:.+]] = load <4 x i16>, ptr %[[CUR4]]
282 // LIN32: store <4 x i16> %[[LOADV4]], ptr %
283
284 // WIN: %[[CUR4:.+]] = load ptr, ptr %[[ARGS]]
285 // WIN64: %[[NEXT4:.+]] = getelementptr inbounds i8, ptr %[[CUR4]], i64 8
286 // WIN32: %[[NEXT4:.+]] = getelementptr inbounds i8, ptr %[[CUR4]], i32 8
287 // WIN: store ptr %[[NEXT4]], ptr %[[ARGS]]
288 // WIN: %[[LOADV4:.+]] = load <4 x i16>, ptr %[[CUR4]]
289 // WIN: store <4 x i16> %[[LOADV4]], ptr
290
291 vint32_t8 E = __builtin_va_arg(args, vint32_t8);
292 // LIN64: %[[AD5:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %[[ARGS]]
293 // LIN64: %[[OFAA_P4:.+]] = getelementptr inbounds nuw %struct.__va_list_tag, ptr %[[AD5]], i32 0, i32 2
294 // LIN64: %[[OFAA:.+]] = load ptr, ptr %[[OFAA_P4]]
295
296 // LIN64: [[OFAA_GEP:%.*]] = getelementptr inbounds i8, ptr %[[OFAA]], i32 31
297 // LIN64: %[[OFAA_ALIGNED:.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[OFAA_GEP]], i64 -32)
298 // LIN64: %[[LOADV5:.+]] = load <8 x i32>, ptr %[[OFAA_ALIGNED]]
299 // LIN64: store <8 x i32> %[[LOADV5]], ptr
300
301 // LIN32: %[[CUR5:.+]] = load ptr, ptr %[[ARGS]]
302
303 // LIN32: [[GEP_CUR5:%.*]] = getelementptr inbounds i8, ptr %[[CUR5]], i32 31
304 // LIN32: %[[CUR5_ALIGNED:.*]] = call ptr @llvm.ptrmask.p0.i32(ptr [[GEP_CUR5]], i32 -32)
305 // LIN32: %[[NEXT5:.+]] = getelementptr inbounds i8, ptr %[[CUR5_ALIGNED]], i32 32
306 // LIN32: store ptr %[[NEXT5]], ptr %[[ARGS]]
307 // LIN32: %[[LOADV5:.+]] = load <8 x i32>, ptr %[[CUR5_ALIGNED]]
308 // LIN32: store <8 x i32> %[[LOADV5]], ptr
309
310 // WIN: %[[CUR5:.+]] = load ptr, ptr %[[ARGS]]
311 // WIN64: %[[NEXT5:.+]] = getelementptr inbounds i8, ptr %[[CUR5]], i64 8
312 // WIN32: %[[NEXT5:.+]] = getelementptr inbounds i8, ptr %[[CUR5]], i32 32
313 // WIN: store ptr %[[NEXT5]], ptr %[[ARGS]]
314 // WIN64: %[[LOADP5:.+]] = load ptr, ptr %[[CUR5]]
315 // WIN64: %[[LOADV5:.+]] = load <8 x i32>, ptr %[[LOADP5]]
316 // WIN32: %[[LOADV5:.+]] = load <8 x i32>, ptr %argp.cur9
317 // WIN: store <8 x i32> %[[LOADV5]], ptr
318
319 __builtin_va_end(args);
320 // LIN64: %[[ENDAD:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %[[ARGS]]
321 // LIN64: call void @llvm.va_end.p0(ptr %[[ENDAD]])
322 // LIN32: call void @llvm.va_end.p0(ptr %[[ARGS]])
323 // WIN: call void @llvm.va_end.p0(ptr %[[ARGS]])
324 }
325 void typeid_tests() {
326 // LIN: define{{.*}} void @_Z12typeid_testsv()
327 // WIN: define dso_local void @"?typeid_tests@@YAXXZ"()
328 unsigned _BitInt(33) U33_1, U33_2;
329 _BitInt(33) S33_1, S33_2;
330 _BitInt(32) S32_1, S32_2;
331
332 auto A = typeid(U33_1);
333 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDU33_)
334 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDU33_)
335 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0U?$_UBitInt@$0CB@@__clang@@@8")
336 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0U?$_UBitInt@$0CB@@__clang@@@8")
337 auto B = typeid(U33_2);
338 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDU33_)
339 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDU33_)
340 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0U?$_UBitInt@$0CB@@__clang@@@8")
341 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0U?$_UBitInt@$0CB@@__clang@@@8")
342 auto C = typeid(S33_1);
343 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDB33_)
344 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDB33_)
345 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0U?$_BitInt@$0CB@@__clang@@@8")
346 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0U?$_BitInt@$0CB@@__clang@@@8")
347 auto D = typeid(S33_2);
348 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDB33_)
349 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDB33_)
350 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0U?$_BitInt@$0CB@@__clang@@@8")
351 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0U?$_BitInt@$0CB@@__clang@@@8")
352 auto E = typeid(S32_1);
353 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDB32_)
354 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDB32_)
355 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0U?$_BitInt@$0CA@@__clang@@@8")
356 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0U?$_BitInt@$0CA@@__clang@@@8")
357 auto F = typeid(S32_2);
358 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDB32_)
359 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDB32_)
360 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0U?$_BitInt@$0CA@@__clang@@@8")
361 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0U?$_BitInt@$0CA@@__clang@@@8")
362 auto G = typeid(uint16_t4);
363 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDv4_DU16_)
364 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDv4_DU16_)
365 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0T?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@@8")
366 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0T?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@@8")
367 auto H = typeid(vint32_t8);
368 // LIN64: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @_ZTIDv8_DB32_)
369 // LIN32: call void @_ZNSt9type_infoC1ERKS_(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @_ZTIDv8_DB32_)
370 // WIN64: call ptr @"??0type_info@std@@QEAA@AEBV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 8 dereferenceable(16) @"??_R0?AT?$__vector@U?$_BitInt@$0CA@@__clang@@$07@__clang@@@8")
371 // WIN32: call x86_thiscallcc ptr @"??0type_info@std@@QAE@ABV01@@Z"(ptr {{[^,]*}} %{{.+}}, ptr nonnull align 4 dereferenceable(8) @"??_R0?AT?$__vector@U?$_BitInt@$0CA@@__clang@@$07@__clang@@@8")
372 }
373
374 void ExplicitCasts() {
375 // LIN: define{{.*}} void @_Z13ExplicitCastsv()
376 // WIN: define dso_local void @"?ExplicitCasts@@YAXXZ"()
377
378 _BitInt(33) a;
379 _BitInt(31) b;
380 int i;
381
382 a = i;
383 // CHECK: %[[CONV:.+]] = sext i32 %{{.+}} to i33
384 b = i;
385 // CHECK: %[[CONV:.+]] = trunc i32 %{{.+}} to i31
386 i = a;
387 // CHECK: %[[CONV:.+]] = trunc i33 %{{.+}} to i32
388 i = b;
389 // CHECK: %[[CONV:.+]] = sext i31 %{{.+}} to i32
390 uint16_t4 c;
391 c = i;
392 // CHECK: %[[CONV:.+]] = trunc i32 %{{.+}} to i16
393 // CHECK: %[[VEC:.+]] = insertelement <4 x i16> poison, i16 %[[CONV]], i64 0
394 // CHECK: %[[Splat:.+]] = shufflevector <4 x i16> %[[VEC]], <4 x i16> poison, <4 x i32> zeroinitializer
395 }
396
397 struct S {
398 _BitInt(17) A;
399 _BitInt(128) B;
400 _BitInt(17) C;
401 uint16_t4 D;
402 vint32_t8 E;
403 };
404
405 void OffsetOfTest() {
406 // LIN: define{{.*}} void @_Z12OffsetOfTestv()
407 // WIN: define dso_local void @"?OffsetOfTest@@YAXXZ"()
408
409 auto A = __builtin_offsetof(S,A);
410 // CHECK: store i{{.+}} 0, ptr %{{.+}}
411 auto B = __builtin_offsetof(S,B);
412 // LIN64: store i{{.+}} 8, ptr %{{.+}}
413 // LIN32: store i{{.+}} 4, ptr %{{.+}}
414 // WIN: store i{{.+}} 8, ptr %{{.+}}
415 auto C = __builtin_offsetof(S,C);
416 // LIN64: store i{{.+}} 24, ptr %{{.+}}
417 // LIN32: store i{{.+}} 20, ptr %{{.+}}
418 // WIN: store i{{.+}} 24, ptr %{{.+}}
419 auto D = __builtin_offsetof(S,D);
420 // LIN64: store i64 32, ptr %{{.+}}
421 // LIN32: store i32 24, ptr %{{.+}}
422 // WIN: store i{{.+}} 32, ptr %{{.+}}
423 auto E = __builtin_offsetof(S,E);
424 // LIN64: store i64 64, ptr %{{.+}}
425 // LIN32: store i32 32, ptr %{{.+}}
426 // WIN: store i{{.+}} 64, ptr %{{.+}}
427 }
428
429
430 void ShiftBitIntByConstant(_BitInt(28) Ext) {
431 // LIN: define{{.*}} void @_Z21ShiftBitIntByConstantDB28_
432 // WIN: define dso_local void @"?ShiftBitIntByConstant@@YAXU?$_BitInt@$0BM@@__clang@@@Z"
433 Ext << 7;
434 // CHECK: shl i28 %{{.+}}, 7
435 Ext >> 7;
436 // CHECK: ashr i28 %{{.+}}, 7
437 Ext << -7;
438 // CHECK: shl i28 %{{.+}}, -7
439 Ext >> -7;
440 // CHECK: ashr i28 %{{.+}}, -7
441
442 // UB in C/C++, Defined in OpenCL.
443 Ext << 29;
444 // CHECK: shl i28 %{{.+}}, 29
445 Ext >> 29;
446 // CHECK: ashr i28 %{{.+}}, 29
447 }
448 void ShiftBitIntByConstant(uint16_t4 Ext) {
449 // LIN64: define{{.*}} void @_Z21ShiftBitIntByConstantDv4_DU16_(double %
450 // LIN32: define dso_local void @_Z21ShiftBitIntByConstantDv4_DU16_(i64 %
451 // WIN: define dso_local void @"?ShiftBitIntByConstant@@YAXT?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@@Z"(<4 x i16>
452 Ext << 7;
453 // CHECK: shl <4 x i16> %{{.+}}, splat (i16 7)
454 Ext >> 7;
455 // CHECK: lshr <4 x i16> %{{.+}}, splat (i16 7)
456 Ext << -7;
457 // CHECK: shl <4 x i16> %{{.+}}, splat (i16 -7)
458 Ext >> -7;
459 // CHECK: lshr <4 x i16> %{{.+}}, splat (i16 -7)
460
461 // UB in C/C++, Defined in OpenCL.
462 Ext << 29;
463 // CHECK: shl <4 x i16> %{{.+}}, splat (i16 29)
464 Ext >> 29;
465 // CHECK: lshr <4 x i16> %{{.+}}, splat (i16 29)
466 }
467 void ShiftBitIntByConstant(vint32_t8 Ext) {
468 // LIN64: define{{.*}} void @_Z21ShiftBitIntByConstantDv8_DB32_(ptr byval(<8 x i32>) align 32 %
469 // LIN32: define dso_local void @_Z21ShiftBitIntByConstantDv8_DB32_(<8 x i32> %
470 // WIN: define dso_local void @"?ShiftBitIntByConstant@@YAXT?$__vector@U?$_BitInt@$0CA@@__clang@@$07@__clang@@@Z"(<8 x i32>
471 Ext << 7;
472 // CHECK: shl <8 x i32> %{{.+}}, splat (i32 7)
473 Ext >> 7;
474 // CHECK: ashr <8 x i32> %{{.+}}, splat (i32 7)
475 Ext << -7;
476 // CHECK: shl <8 x i32> %{{.+}}, splat (i32 -7)
477 Ext >> -7;
478 // CHECK: ashr <8 x i32> %{{.+}}, splat (i32 -7)
479
480 // UB in C/C++, Defined in OpenCL.
481 Ext << 29;
482 // CHECK: shl <8 x i32> %{{.+}}, splat (i32 29)
483 Ext >> 29;
484 // CHECK: ashr <8 x i32> %{{.+}}, splat (i32 29)
485 }
486
487 void ConstantShiftByBitInt(_BitInt(28) Ext, _BitInt(65) LargeExt) {
488 // LIN: define{{.*}} void @_Z21ConstantShiftByBitIntDB28_DB65_
489 // WIN: define dso_local void @"?ConstantShiftByBitInt@@YAXU?$_BitInt@$0BM@@__clang@@U?$_BitInt@$0EB@@2@@Z"
490 10 << Ext;
491 // CHECK: %[[PROMO:.+]] = zext i28 %{{.+}} to i32
492 // CHECK: shl i32 10, %[[PROMO]]
493 10 >> Ext;
494 // CHECK: %[[PROMO:.+]] = zext i28 %{{.+}} to i32
495 // CHECK: ashr i32 10, %[[PROMO]]
496 10 << LargeExt;
497 // CHECK: %[[PROMO:.+]] = trunc i65 %{{.+}} to i32
498 // CHECK: shl i32 10, %[[PROMO]]
499 10 >> LargeExt;
500 // CHECK: %[[PROMO:.+]] = trunc i65 %{{.+}} to i32
501 // CHECK: ashr i32 10, %[[PROMO]]
502 }
503
504 void Shift(_BitInt(28) Ext, _BitInt(65) LargeExt, int i) {
505 // LIN: define{{.*}} void @_Z5ShiftDB28_DB65_
506 // WIN: define dso_local void @"?Shift@@YAXU?$_BitInt@$0BM@@__clang@@U?$_BitInt@$0EB@@2@H@Z"
507 i << Ext;
508 // CHECK: %[[PROMO:.+]] = zext i28 %{{.+}} to i32
509 // CHECK: shl i32 {{.+}}, %[[PROMO]]
510 i >> Ext;
511 // CHECK: %[[PROMO:.+]] = zext i28 %{{.+}} to i32
512 // CHECK: ashr i32 {{.+}}, %[[PROMO]]
513
514 i << LargeExt;
515 // CHECK: %[[PROMO:.+]] = trunc i65 %{{.+}} to i32
516 // CHECK: shl i32 {{.+}}, %[[PROMO]]
517 i >> LargeExt;
518 // CHECK: %[[PROMO:.+]] = trunc i65 %{{.+}} to i32
519 // CHECK: ashr i32 {{.+}}, %[[PROMO]]
520
521 Ext << i;
522 // CHECK: %[[BI:.+]] = trunc i32 %{{.+}} to i28
523 // CHECK: %[[PROMO:.+]] = trunc i32 %{{.+}} to i28
524 // CHECK: shl i28 %[[BI]], %[[PROMO]]
525 Ext >> i;
526 // CHECK: %[[BI:.+]] = trunc i32 %{{.+}} to i28
527 // CHECK: %[[PROMO:.+]] = trunc i32 %{{.+}} to i28
528 // CHECK: ashr i28 %[[BI]], %[[PROMO]]
529
530 LargeExt << i;
531 // CHECK: %[[PROMO:.+]] = zext i32 %{{.+}} to i65
532 // CHECK: shl i65 {{.+}}, %[[PROMO]]
533 LargeExt >> i;
534 // CHECK: %[[PROMO:.+]] = zext i32 %{{.+}} to i65
535 // CHECK: ashr i65 {{.+}}, %[[PROMO]]
536
537 Ext << LargeExt;
538 // CHECK: %[[PROMO:.+]] = trunc i65 %{{.+}} to i28
539 // CHECK: shl i28 {{.+}}, %[[PROMO]]
540 Ext >> LargeExt;
541 // CHECK: %[[PROMO:.+]] = trunc i65 %{{.+}} to i28
542 // CHECK: ashr i28 {{.+}}, %[[PROMO]]
543
544 LargeExt << Ext;
545 // CHECK: %[[PROMO:.+]] = zext i28 %{{.+}} to i65
546 // CHECK: shl i65 {{.+}}, %[[PROMO]]
547 LargeExt >> Ext;
548 // CHECK: %[[PROMO:.+]] = zext i28 %{{.+}} to i65
549 // CHECK: ashr i65 {{.+}}, %[[PROMO]]
550 }
551
552 typedef _BitInt(64) vint64_t16 __attribute__((vector_size(16)));
553 void VectorTest(vint64_t16 first, vint64_t16 second) {
554 // LIN: define{{.*}} void @_Z10VectorTestDv2_DB64_S0_(<2 x i64> %{{.+}}, <2 x i64> %{{.+}})
555 // WIN64: define dso_local void @"?VectorTest@@YAXT?$__vector@U?$_BitInt@$0EA@@__clang@@$01@__clang@@0@Z"(<2 x i64> %{{.+}}, <2 x i64> %{{.+}})
556 // WIN32: define dso_local void @"?VectorTest@@YAXT?$__vector@U?$_BitInt@$0EA@@__clang@@$01@__clang@@0@Z"(<2 x i64> inreg %{{.+}}, <2 x i64> inreg %{{.+}})
557 __builtin_shufflevector (first, first, 1, 3, 2) + __builtin_shufflevector (second, second, 1, 3, 2);
558 // CHECK: %[[Shuffle:.+]] = shufflevector <2 x i64> %{{.+}}, <2 x i64> %{{.+}}, <3 x i32> <i32 1, i32 3, i32 2>
559 // CHECK: %[[Shuffle1:.+]] = shufflevector <2 x i64> %{{.+}}, <2 x i64> %{{.+}}, <3 x i32> <i32 1, i32 3, i32 2>
560 // CHECK: %[[ADD:.+]] = add <3 x i64> %[[Shuffle]], %[[Shuffle1]]
561 }
562
563 void VectorTest(uint16_t4 first, uint16_t4 second) {
564 // LIN64: define{{.*}} void @_Z10VectorTestDv4_DU16_S0_(double %{{.+}}, double %{{.+}})
565 // LIN32: define{{.*}} void @_Z10VectorTestDv4_DU16_S0_(i64 %{{.+}}, i64 %{{.+}})
566 // WIN64: define dso_local void @"?VectorTest@@YAXT?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@0@Z"(<4 x i16> %{{.+}}, <4 x i16> %{{.+}})
567 // WIN32: define dso_local void @"?VectorTest@@YAXT?$__vector@U?$_UBitInt@$0BA@@__clang@@$03@__clang@@0@Z"(<4 x i16> inreg %{{.+}}, <4 x i16> inreg %{{.+}})
568 first.xzw + second.zwx;
569 // CHECK: %[[Shuffle:.+]] = shufflevector <4 x i16> %{{.+}}, <4 x i16> poison, <3 x i32> <i32 0, i32 2, i32 3>
570 // CHECK: %[[Shuffle1:.+]] = shufflevector <4 x i16> %{{.+}}, <4 x i16> poison, <3 x i32> <i32 2, i32 3, i32 0>
571 // CHECK: %[[ADD:.+]] = add <3 x i16> %[[Shuffle]], %[[Shuffle1]]
572 }
573
574 typedef unsigned _BitInt(4) uint4_t4 __attribute__((ext_vector_type(4)));
575 void VectorTest(uint4_t4 first, uint4_t4 second) {
576 // LIN64: define{{.*}} void @_Z10VectorTestDv4_DU4_S0_(i32 %{{.+}}, i32 %{{.+}})
577 // LIN32: define{{.*}} void @_Z10VectorTestDv4_DU4_S0_(<4 x i4> %{{.+}}, <4 x i4> %{{.+}})
578 // WIN64: define dso_local void @"?VectorTest@@YAXT?$__vector@U?$_UBitInt@$03@__clang@@$03@__clang@@0@Z"(<4 x i4> %{{.+}}, <4 x i4> %{{.+}})
579 // WIN32: define dso_local void @"?VectorTest@@YAXT?$__vector@U?$_UBitInt@$03@__clang@@$03@__clang@@0@Z"(<4 x i4> inreg %{{.+}}, <4 x i4> inreg %{{.+}})
580 first.xzw + second.zwx;
581 // CHECK: %[[Shuffle:.+]] = shufflevector <4 x i4> %{{.+}}, <4 x i4> poison, <3 x i32> <i32 0, i32 2, i32 3>
582 // CHECK: %[[Shuffle1:.+]] = shufflevector <4 x i4> %{{.+}}, <4 x i4> poison, <3 x i32> <i32 2, i32 3, i32 0>
583 // CHECK: %[[ADD:.+]] = add <3 x i4> %[[Shuffle]], %[[Shuffle1]]
584 }
585
586 typedef unsigned _BitInt(2) uint2_t2 __attribute__((ext_vector_type(2)));
587 uint2_t2 TestBitIntVector2x2Alloca(uint2_t2 v1, uint2_t2 v2) {
588 // LIN64: define dso_local i16 @_Z25TestBitIntVector2x2AllocaDv2_DU2_S0_(i16 %[[V1Coerce:.+]], i16 %[[V2Coerce:.+]])
589 // LIN64: %[[RetVal:.+]] = alloca <2 x i2>, align 2
590 // LIN64: %[[V1Addr:.+]] = alloca <2 x i2>, align 2
591 // LIN64: %[[V2Addr:.+]] = alloca <2 x i2>, align 2
592 // LIN64: %[[RetValCoerce:.+]] = alloca i16, align 2
593 // LIN64: call void @llvm.memcpy.p0.p0.i64(ptr align 2 %[[RetValCoerce]], ptr align 2 %[[RetVal]], i64 1, i1 false)
594 // LIN64: %[[Ret:.+]] = load i16, ptr %[[RetValCoerce]], align 2
595 // LIN64: ret i16 %[[Ret]]
596
597 // LIN32: define dso_local <2 x i2> @_Z25TestBitIntVector2x2AllocaDv2_DU2_S0_(<2 x i2> %{{.+}}, <2 x i2> %{{.+}})
598 // LIN32: %[[V1Addr:.+]] = alloca <2 x i2>, align 2
599 // LIN32: %[[V2Addr:.+]] = alloca <2 x i2>, align 2
600 // LIN32: ret <2 x i2> %[[Ret:.+]]
601
602 // WIN: define dso_local <2 x i2> @"?TestBitIntVector2x2Alloca@@YAT?$__vector@U?$_UBitInt@$01@__clang@@$01@__clang@@T12@0@Z"(<2 x i2>{{.*}}, <2 x i2>{{.*}})
603 // WIN: %[[V1:.+]] = alloca <2 x i2>, align 2
604 // WIN: %[[V2:.+]] = alloca <2 x i2>, align 2
605 // WIN: ret <2 x i2> %[[Ret:.+]]
606 return v1 + v2;
607 }
608
609 // Ensure that these types don't alias the normal int types.
610 void TBAATest(_BitInt(sizeof(int) * 8) ExtInt,
611 unsigned _BitInt(sizeof(int) * 8) ExtUInt,
612 _BitInt(6) Other) {
613 // CHECK-DAG: store i32 %{{.+}}, ptr %{{.+}}, align 4, !tbaa ![[EXTINT_TBAA:.+]]
614 // CHECK-DAG: store i32 %{{.+}}, ptr %{{.+}}, align 4, !tbaa ![[EXTINT_TBAA]]
615 // CHECK-DAG: store i8 %{{.+}}, ptr %{{.+}}, align 1, !tbaa ![[EXTINT6_TBAA:.+]]
616 ExtInt = 5;
617 ExtUInt = 5;
618 Other = 5;
619 }
620
621 // NoNewStructPathTBAA-DAG: ![[CHAR_TBAA_ROOT:.+]] = !{!"omnipotent char", ![[TBAA_ROOT:.+]], i64 0}
622 // NoNewStructPathTBAA-DAG: ![[TBAA_ROOT]] = !{!"Simple C++ TBAA"}
623 // NoNewStructPathTBAA-DAG: ![[EXTINT_TBAA]] = !{![[EXTINT_TBAA_ROOT:.+]], ![[EXTINT_TBAA_ROOT]], i64 0}
624 // NoNewStructPathTBAA-DAG: ![[EXTINT_TBAA_ROOT]] = !{!"_BitInt(32)", ![[CHAR_TBAA_ROOT]], i64 0}
625 // NoNewStructPathTBAA-DAG: ![[EXTINT6_TBAA]] = !{![[EXTINT6_TBAA_ROOT:.+]], ![[EXTINT6_TBAA_ROOT]], i64 0}
626 // NoNewStructPathTBAA-DAG: ![[EXTINT6_TBAA_ROOT]] = !{!"_BitInt(6)", ![[CHAR_TBAA_ROOT]], i64 0}
627
628 // NewStructPathTBAA-DAG: ![[CHAR_TBAA_ROOT:.+]] = !{![[TBAA_ROOT:.+]], i64 1, !"omnipotent char"}
629 // NewStructPathTBAA-DAG: ![[TBAA_ROOT]] = !{!"Simple C++ TBAA"}
630 // NewStructPathTBAA-DAG: ![[EXTINT_TBAA]] = !{![[EXTINT_TBAA_ROOT:.+]], ![[EXTINT_TBAA_ROOT]], i64 0, i64 4}
631 // NewStructPathTBAA-DAG: ![[EXTINT_TBAA_ROOT]] = !{![[CHAR_TBAA_ROOT]], i64 4, !"_BitInt(32)"}
632 // NewStructPathTBAA-DAG: ![[EXTINT6_TBAA]] = !{![[EXTINT6_TBAA_ROOT:.+]], ![[EXTINT6_TBAA_ROOT]], i64 0, i64 1}
633 // NewStructPathTBAA-DAG: ![[EXTINT6_TBAA_ROOT]] = !{![[CHAR_TBAA_ROOT]], i64 1, !"_BitInt(6)"}
634
635 namespace A {
636 template <int N> struct S {
637 using T = _BitInt(N);
638 T Data;
639 };
640 template <int N> void foo(S<N> B) {
641 const auto Var = B.Data;
642 }
643
644 void bar() {
645 S<2080> a;
646 foo(a);
647 }
648 }