1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -sroa %s | FileCheck %s
4 ; This should not crash
6 %class.ar = type { i8 }
7 %class.anon = type <{ %class.ar, [7 x i8], { i64, i64 } }>
9 define void @caller() {
10 ; CHECK-LABEL: @caller(
12 ; CHECK-NEXT: [[AGG:%.*]] = alloca [[CLASS_ANON:%.*]], align 8
13 ; CHECK-NEXT: [[OFF:%.*]] = getelementptr inbounds [[CLASS_ANON]], %class.anon* [[AGG]], i32 0, i32 2
14 ; CHECK-NEXT: [[DOTFCA_0_GEP:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[OFF]], i32 0, i32 0
15 ; CHECK-NEXT: store i64 1, i64* [[DOTFCA_0_GEP]], align 8, !tbaa [[TBAA0:![0-9]+]]
16 ; CHECK-NEXT: [[DOTFCA_1_GEP:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[OFF]], i32 0, i32 1
17 ; CHECK-NEXT: store i64 2, i64* [[DOTFCA_1_GEP]], align 8, !tbaa [[TBAA0]]
18 ; CHECK-NEXT: call void @use(%class.anon* [[AGG]])
19 ; CHECK-NEXT: ret void
22 %agg = alloca %class.anon, align 8
23 %off = getelementptr inbounds %class.anon, %class.anon* %agg, i32 0, i32 2
24 store { i64, i64 } { i64 1, i64 2 }, { i64, i64 }* %off, align 8, !tbaa !7
25 call void @use(%class.anon* %agg)
29 declare void @use(%class.anon* %this)
31 !3 = !{!"omnipotent char", !4, i64 0}
32 !4 = !{!"Simple C++ TBAA"}
35 !8 = !{!"_ZTSZN2ax2baEMS_FvvE2an2arE3$_0", !9, i64 0, !3, i64 8}