brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 4c18006 Raw
48 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 62; RUN: opt -S -passes='sroa<preserve-cfg>' %s | FileCheck %s --check-prefixes=CHECK,CHECK-PRESERVE-CFG3; RUN: opt -S -passes='sroa<modify-cfg>' %s | FileCheck %s --check-prefixes=CHECK,CHECK-MODIFY-CFG4 5; This should not crash6 7%class.ar = type { i8 }8%class.anon = type <{ %class.ar, [7 x i8], { i64, i64 } }>9 10define void @caller() {11; CHECK-LABEL: define void @caller() {12; CHECK-NEXT:  [[ENTRY:.*:]]13; CHECK-NEXT:    [[AGG:%.*]] = alloca [[CLASS_ANON:%.*]], align 814; CHECK-NEXT:    [[OFF:%.*]] = getelementptr inbounds [[CLASS_ANON]], ptr [[AGG]], i32 0, i32 215; CHECK-NEXT:    [[DOTFCA_0_GEP:%.*]] = getelementptr inbounds { i64, i64 }, ptr [[OFF]], i32 0, i32 016; CHECK-NEXT:    store i64 1, ptr [[DOTFCA_0_GEP]], align 8, !tbaa [[CHAR_TBAA0:![0-9]+]]17; CHECK-NEXT:    [[DOTFCA_1_GEP:%.*]] = getelementptr inbounds { i64, i64 }, ptr [[OFF]], i32 0, i32 118; CHECK-NEXT:    store i64 2, ptr [[DOTFCA_1_GEP]], align 8, !tbaa [[CHAR_TBAA0]]19; CHECK-NEXT:    call void @use(ptr [[AGG]])20; CHECK-NEXT:    ret void21;22entry:23  %agg = alloca %class.anon, align 824  %off = getelementptr inbounds %class.anon, ptr %agg, i32 0, i32 225  store { i64, i64 } { i64 1, i64 2 }, ptr %off, align 8, !tbaa !726  call void @use(ptr %agg)27  ret void28}29 30declare void @use(ptr %this)31 32!3 = !{!"omnipotent char", !4, i64 0}33!4 = !{!"Simple C++ TBAA"}34 35!7 = !{!8, !3, i64 8}36!8 = !{!"_ZTSZN2ax2baEMS_FvvE2an2arE3$_0", !9, i64 0, !3, i64 8}37!9 = !{!"_ZTS2ar"}38;.39; CHECK: [[CHAR_TBAA0]] = !{[[META1:![0-9]+]], [[META3:![0-9]+]], i64 8}40; CHECK: [[META1]] = !{!"_ZTSZN2ax2baEMS_FvvE2an2arE3$_0", [[META2:![0-9]+]], i64 0, [[META3]], i64 8}41; CHECK: [[META2]] = !{!"_ZTS2ar"}42; CHECK: [[META3]] = !{!"omnipotent char", [[META4:![0-9]+]], i64 0}43; CHECK: [[META4]] = !{!"Simple C++ TBAA"}44;.45;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:46; CHECK-MODIFY-CFG: {{.*}}47; CHECK-PRESERVE-CFG: {{.*}}48