1; RUN: llc < %s -filetype=obj -debug-entry-values 2 3target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" 4target triple = "thumbv7-unknown-linux-gnueabi" 5 6%class.z = type { i8, i8 } 7%struct.y = type { %class.ac } 8%class.ac = type { %"struct.ac::m" } 9%"struct.ac::m" = type { i8 } 10%class.ae = type { i8 } 11%class.o = type { i8 } 12 13@l = dso_local local_unnamed_addr global i8 0, align 1, !dbg !0 14 15; Function Attrs: nounwind 16define dso_local zeroext i1 @_ZN1z2agEv(ptr nocapture readonly %this) local_unnamed_addr align 2 !dbg !17 { 17entry: 18 %a = alloca %struct.y, align 1 19 %b = alloca %struct.y, align 1 20 %c = alloca %class.ae, align 1 21 call void @llvm.dbg.value(metadata ptr %this, metadata !28, metadata !DIExpression()), !dbg !75 22 %0 = load i8, ptr %this, align 1, !dbg !75 23 %tobool = icmp eq i8 %0, 0, !dbg !75 24 br i1 %tobool, label %if.end, label %if.then, !dbg !75 25 26if.then: ; preds = %entry 27 %call.i.i = call ptr @_ZN2ac1mC1EPc(ptr nonnull %a, ptr null), !dbg !82 28 %call2.i.i = call ptr @_ZN2ac2adEv(ptr nonnull %a), !dbg !82 29 %cmp.i.i = icmp eq ptr %call2.i.i, null, !dbg !82 30 %frombool.i.i = zext i1 %cmp.i.i to i8, !dbg !82 31 store i8 %frombool.i.i, ptr @l, align 1, !dbg !82 32 br i1 %cmp.i.i, label %_ZN1yC2Ev.exit, label %if.then.i.i, !dbg !82 33 34if.then.i.i: ; preds = %if.then 35 call void @llvm.dbg.value(metadata i32 1, metadata !144, metadata !DIExpression()), !dbg !145 36 call void @_ZdlPv(ptr null), !dbg !145 37 br label %_ZN1yC2Ev.exit, !dbg !145 38 39_ZN1yC2Ev.exit: ; preds = %if.then, %if.then.i.i 40 call void @llvm.dbg.value(metadata i8 1, metadata !31, metadata !DIExpression()), !dbg !75 41 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a), !dbg !75 42 br label %cleanup 43 44if.end: ; preds = %entry 45 %ah = getelementptr inbounds %class.z, ptr %this, i32 0, i32 1, !dbg !150 46 %1 = load i8, ptr %ah, align 1, !dbg !150 47 %tobool3 = icmp eq i8 %1, 0, !dbg !150 48 br i1 %tobool3, label %if.end7, label %if.then4, !dbg !150 49 50if.then4: ; preds = %if.end 51 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b), !dbg !153 52 %call.i.i13 = call ptr @_ZN2ac1mC1EPc(ptr nonnull %b, ptr null), !dbg !153 53 %call2.i.i14 = call ptr @_ZN2ac2adEv(ptr nonnull %b), !dbg !153 54 %cmp.i.i15 = icmp eq ptr %call2.i.i14, null, !dbg !153 55 %frombool.i.i16 = zext i1 %cmp.i.i15 to i8, !dbg !153 56 store i8 %frombool.i.i16, ptr @l, align 1, !dbg !153 57 br i1 %cmp.i.i15, label %_ZN1yC2Ev.exit18, label %if.then.i.i17, !dbg !153 58 59if.then.i.i17: ; preds = %if.then4 60 call void @_ZdlPv(ptr null), !dbg !170 61 br label %_ZN1yC2Ev.exit18, !dbg !170 62 63_ZN1yC2Ev.exit18: ; preds = %if.then4, %if.then.i.i17 64 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b), !dbg !173 65 br label %cleanup 66 67if.end7: ; preds = %if.end 68 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c), !dbg !173 69 %call8 = call ptr @_ZN2aeC1Ei(ptr nonnull %c, i32 1), !dbg !173 70 call void @_ZN2ae1xES_(ptr nonnull %c, [1 x i32] zeroinitializer), !dbg !173 71 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c), !dbg !173 72 br label %cleanup 73 74cleanup: ; preds = %if.end7, %_ZN1yC2Ev.exit18, %_ZN1yC2Ev.exit 75 %retval.0 = phi i1 [ true, %_ZN1yC2Ev.exit ], [ true, %_ZN1yC2Ev.exit18 ], [ false, %if.end7 ], !dbg !75 76 ret i1 %retval.0, !dbg !75 77} 78 79; Function Attrs: argmemonly nounwind willreturn 80declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) 81 82; Function Attrs: argmemonly nounwind willreturn 83declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) 84 85declare dso_local ptr @_ZN2aeC1Ei(ptr returned, i32) unnamed_addr 86 87declare dso_local void @_ZN2ae1xES_(ptr, [1 x i32]) local_unnamed_addr 88 89declare dso_local ptr @_ZN2ac1mC1EPc(ptr returned, ptr) unnamed_addr 90 91declare dso_local ptr @_ZN2ac2adEv(ptr) local_unnamed_addr 92 93; Function Attrs: nobuiltin nounwind 94declare !dbg !6 dso_local void @_ZdlPv(ptr) local_unnamed_addr 95 96; Function Attrs: nounwind readnone speculatable willreturn 97declare void @llvm.dbg.value(metadata, metadata, metadata) 98 99!llvm.dbg.cu = !{!2} 100!llvm.module.flags = !{!12, !13, !14, !15} 101!llvm.ident = !{!16} 102 103!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 104!1 = distinct !DIGlobalVariable(name: "l", scope: !2, file: !3, line: 14, type: !11, isLocal: false, isDefinition: true) 105!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 11.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !5, globals: !10, splitDebugInlining: false, nameTableKind: None) 106!3 = !DIFile(filename: "crash.cpp", directory: "/") 107!4 = !{} 108!5 = !{!6} 109!6 = !DISubprogram(name: "operator delete", linkageName: "_ZdlPv", scope: !3, file: !3, type: !7, flags: DIFlagArtificial | DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !4) 110!7 = !DISubroutineType(types: !8) 111!8 = !{null, !9} 112!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 32) 113!10 = !{!0} 114!11 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean) 115!12 = !{i32 7, !"Dwarf Version", i32 4} 116!13 = !{i32 2, !"Debug Info Version", i32 3} 117!14 = !{i32 1, !"wchar_size", i32 4} 118!15 = !{i32 1, !"min_enum_size", i32 4} 119!16 = !{!"clang version 11.0.0"} 120!17 = distinct !DISubprogram(name: "ag", linkageName: "_ZN1z2agEv", scope: !18, file: !3, line: 45, type: !24, scopeLine: 45, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, declaration: !23, retainedNodes: !27) 121!18 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "z", file: !3, line: 40, size: 16, flags: DIFlagTypePassByValue, elements: !19, identifier: "_ZTS1z") 122!19 = !{!20, !22, !23} 123!20 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !18, file: !3, line: 42, baseType: !21, size: 8) 124!21 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char) 125!22 = !DIDerivedType(tag: DW_TAG_member, name: "ah", scope: !18, file: !3, line: 43, baseType: !21, size: 8, offset: 8) 126!23 = !DISubprogram(name: "ag", linkageName: "_ZN1z2agEv", scope: !18, file: !3, line: 41, type: !24, scopeLine: 41, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized) 127!24 = !DISubroutineType(types: !25) 128!25 = !{!11, !26} 129!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer) 130!27 = !{!28, !30, !31, !32, !55, !58} 131!28 = !DILocalVariable(name: "this", arg: 1, scope: !17, type: !29, flags: DIFlagArtificial | DIFlagObjectPointer) 132!29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 32) 133!30 = !DILocalVariable(name: "w", scope: !17, file: !3, line: 46, type: !11) 134!31 = !DILocalVariable(name: "v", scope: !17, file: !3, line: 46, type: !11) 135!32 = !DILocalVariable(name: "a", scope: !33, file: !3, line: 48, type: !35) 136!33 = distinct !DILexicalBlock(scope: !34, file: !3, line: 47, column: 10) 137!34 = distinct !DILexicalBlock(scope: !17, file: !3, line: 47, column: 7) 138!35 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "y", file: !3, line: 37, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !36, identifier: "_ZTS1y") 139!36 = !{!37} 140!37 = !DIDerivedType(tag: DW_TAG_member, name: "u", scope: !35, file: !3, line: 38, baseType: !38, size: 8) 141!38 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "ac", file: !3, line: 15, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !39, identifier: "_ZTS2ac") 142!39 = !{!40, !48, !52} 143!40 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !38, file: !3, line: 18, baseType: !41, size: 8) 144!41 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "m", scope: !38, file: !3, line: 16, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !42, identifier: "_ZTSN2ac1mE") 145!42 = !{!43} 146!43 = !DISubprogram(name: "m", scope: !41, file: !3, line: 17, type: !44, scopeLine: 17, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized) 147!44 = !DISubroutineType(types: !45) 148!45 = !{null, !46, !47} 149!46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !41, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer) 150!47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 32) 151!48 = !DISubprogram(name: "ad", linkageName: "_ZN2ac2adEv", scope: !38, file: !3, line: 19, type: !49, scopeLine: 19, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized) 152!49 = !DISubroutineType(types: !50) 153!50 = !{!47, !51} 154!51 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !38, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer) 155!52 = !DISubprogram(name: "ac", scope: !38, file: !3, line: 22, type: !53, scopeLine: 22, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) 156!53 = !DISubroutineType(types: !54) 157!54 = !{null, !51} 158!55 = !DILocalVariable(name: "b", scope: !56, file: !3, line: 53, type: !35) 159!56 = distinct !DILexicalBlock(scope: !57, file: !3, line: 52, column: 11) 160!57 = distinct !DILexicalBlock(scope: !17, file: !3, line: 52, column: 7) 161!58 = !DILocalVariable(name: "c", scope: !17, file: !3, line: 57, type: !59) 162!59 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "ae", file: !3, line: 30, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !60, identifier: "_ZTS2ae") 163!60 = !{!61, !62, !68, !72} 164!61 = !DIDerivedType(tag: DW_TAG_member, name: "af", scope: !59, file: !3, line: 32, baseType: !21, size: 8, flags: DIFlagPublic) 165!62 = !DISubprogram(name: "ae", scope: !59, file: !3, line: 33, type: !63, scopeLine: 33, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) 166!63 = !DISubroutineType(types: !64) 167!64 = !{null, !65, !66} 168!65 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !59, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer) 169!66 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !67, size: 32) 170!67 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !21) 171!68 = !DISubprogram(name: "ae", scope: !59, file: !3, line: 34, type: !69, scopeLine: 34, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) 172!69 = !DISubroutineType(types: !70) 173!70 = !{null, !65, !71} 174!71 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 175!72 = !DISubprogram(name: "x", linkageName: "_ZN2ae1xES_", scope: !59, file: !3, line: 35, type: !73, scopeLine: 35, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) 176!73 = !DISubroutineType(types: !74) 177!74 = !{null, !65, !59} 178!75 = !DILocation(line: 0, scope: !17) 179!82 = !DILocation(line: 48, column: 5, scope: !33) 180!84 = !DILocalVariable(name: "this", arg: 1, scope: !85, type: !91, flags: DIFlagArtificial | DIFlagObjectPointer) 181!85 = distinct !DISubprogram(name: "y", linkageName: "_ZN1yC2Ev", scope: !35, file: !3, line: 37, type: !86, scopeLine: 37, flags: DIFlagArtificial | DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, declaration: !89, retainedNodes: !90) 182!86 = !DISubroutineType(types: !87) 183!87 = !{null, !88} 184!88 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !35, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer) 185!89 = !DISubprogram(name: "y", scope: !35, type: !86, flags: DIFlagArtificial | DIFlagPrototyped, spFlags: DISPFlagOptimized) 186!90 = !{!84} 187!91 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !35, size: 32) 188!93 = distinct !DILocation(line: 48, column: 7, scope: !33) 189!94 = !DILocation(line: 37, column: 8, scope: !85, inlinedAt: !93) 190!95 = !DILocalVariable(name: "this", arg: 1, scope: !96, type: !114, flags: DIFlagArtificial | DIFlagObjectPointer) 191!96 = distinct !DISubprogram(name: "ac", linkageName: "_ZN2acC2Ev", scope: !38, file: !3, line: 22, type: !53, scopeLine: 22, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, declaration: !52, retainedNodes: !97) 192!97 = !{!95, !98} 193!98 = !DILocalVariable(name: "t", scope: !99, file: !3, line: 25, type: !102) 194!99 = distinct !DILexicalBlock(scope: !100, file: !3, line: 24, column: 13) 195!100 = distinct !DILexicalBlock(scope: !101, file: !3, line: 24, column: 9) 196!101 = distinct !DILexicalBlock(scope: !96, file: !3, line: 22, column: 15) 197!102 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "o<char>", file: !3, line: 6, size: 8, flags: DIFlagTypePassByValue, elements: !103, templateParams: !112, identifier: "_ZTS1oIcE") 198!103 = !{!104} 199!104 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !102, baseType: !105, flags: DIFlagPublic, extraData: i32 0) 200!105 = !DIDerivedType(tag: DW_TAG_typedef, name: "d<char>", file: !3, line: 5, baseType: !106) 201!106 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "i", file: !3, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !107, identifier: "_ZTS1i") 202!107 = !{!108} 203!108 = !DISubprogram(name: "j", linkageName: "_ZN1i1jEPci", scope: !106, file: !3, line: 3, type: !109, scopeLine: 3, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagOptimized) 204!109 = !DISubroutineType(types: !110) 205!110 = !{null, !111, !47, !71} 206!111 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !106, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer) 207!112 = !{!113} 208!113 = !DITemplateTypeParameter(type: !21) 209!114 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !38, size: 32) 210!116 = distinct !DILocation(line: 37, column: 8, scope: !85, inlinedAt: !93) 211!124 = !DILocalVariable(name: "k", arg: 1, scope: !125, file: !3, line: 10, type: !102) 212!125 = distinct !DISubprogram(name: "p", linkageName: "_ZN2aaI1oIcEE1pES1_Pci", scope: !126, file: !3, line: 10, type: !129, scopeLine: 10, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, declaration: !128, retainedNodes: !133) 213!126 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "aa<o<char> >", file: !3, line: 9, size: 8, flags: DIFlagTypePassByValue, elements: !127, templateParams: !131, identifier: "_ZTS2aaI1oIcEE") 214!127 = !{!128} 215!128 = !DISubprogram(name: "p", linkageName: "_ZN2aaI1oIcEE1pES1_Pci", scope: !126, file: !3, line: 10, type: !129, scopeLine: 10, flags: DIFlagPrototyped | DIFlagStaticMember, spFlags: DISPFlagOptimized) 216!129 = !DISubroutineType(types: !130) 217!130 = !{null, !102, !47, !71} 218!131 = !{!132} 219!132 = !DITemplateTypeParameter(type: !102) 220!133 = !{!124, !134, !135} 221!134 = !DILocalVariable(name: "ab", arg: 2, scope: !125, file: !3, line: 10, type: !47) 222!135 = !DILocalVariable(name: "q", arg: 3, scope: !125, file: !3, line: 10, type: !71) 223!136 = !DILocation(line: 10, column: 22, scope: !125, inlinedAt: !137) 224!137 = distinct !DILocation(line: 26, column: 7, scope: !99, inlinedAt: !116) 225!138 = !DILocation(line: 0, scope: !125, inlinedAt: !137) 226!139 = !DILocalVariable(name: "k", arg: 2, scope: !140, file: !3, line: 3, type: !47) 227!140 = distinct !DISubprogram(name: "j", linkageName: "_ZN1i1jEPci", scope: !106, file: !3, line: 3, type: !109, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, declaration: !108, retainedNodes: !141) 228!141 = !{!142, !139, !144} 229!142 = !DILocalVariable(name: "this", arg: 1, scope: !140, type: !143, flags: DIFlagArtificial | DIFlagObjectPointer) 230!143 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !106, size: 32) 231!144 = !DILocalVariable(arg: 3, scope: !140, file: !3, line: 3, type: !71) 232!145 = !DILocation(line: 0, scope: !140, inlinedAt: !146) 233!146 = distinct !DILocation(line: 10, column: 43, scope: !125, inlinedAt: !137) 234!150 = !DILocation(line: 52, column: 7, scope: !57) 235!153 = !DILocation(line: 53, column: 5, scope: !56) 236!156 = distinct !DILocation(line: 53, column: 7, scope: !56) 237!159 = distinct !DILocation(line: 37, column: 8, scope: !85, inlinedAt: !156) 238!166 = distinct !DILocation(line: 26, column: 7, scope: !99, inlinedAt: !159) 239!167 = !DILocation(line: 0, scope: !125, inlinedAt: !166) 240!169 = distinct !DILocation(line: 10, column: 43, scope: !125, inlinedAt: !166) 241!170 = !DILocation(line: 3, column: 26, scope: !140, inlinedAt: !169) 242!173 = !DILocation(line: 57, column: 3, scope: !17) 243