166 lines · plain
1; For some reason, the output when targetting sparc is not quite as expected.2; XFAIL: target=sparc{{.*}}3 4; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck %s --implicit-check-not=DW_TAG5 6; IR generated from clang -O0 with:7; struct C {8; ~C();9; };10; extern bool b;11; void fun4() { b && (C(), 1); }12; __attribute__((always_inline)) C::~C() { }13 14; CHECK: DW_TAG_compile_unit15 16; CHECK: DW_TAG_structure_type17; CHECK: DW_AT_name ("C")18; CHECK: DW_TAG_subprogram19; CHECK: DW_AT_name ("~C")20; CHECK: DW_TAG_formal_parameter21; CHECK: DW_TAG_pointer_type22 23; CHECK: DW_TAG_subprogram24; CHECK: DW_AT_linkage_name ("_ZN1CD1Ev")25; CHECK: DW_TAG_formal_parameter26; CHECK: DW_AT_name ("this")27; CHECK: DW_TAG_pointer_type28 29; CHECK: DW_TAG_subprogram30; CHECK: DW_AT_name ("fun4")31; CHECK: DW_TAG_inlined_subroutine32; CHECK: DW_AT_abstract_origin {{.*}} "_ZN1CD1Ev"33; CHECK: DW_TAG_formal_parameter34; CHECK: DW_AT_abstract_origin {{.*}} "this"35 36; CHECK: DW_TAG_subprogram37; CHECK: DW_AT_abstract_origin {{.*}} "_ZN1CD1Ev"38; CHECK: DW_TAG_formal_parameter39; CHECK: DW_AT_abstract_origin {{.*}} "this"40 41; CHECK: DW_TAG_subprogram42; CHECK: DW_AT_linkage_name ("_ZN1CD2Ev")43; CHECK: DW_AT_specification {{.*}} "~C"44; CHECK: DW_TAG_formal_parameter45; CHECK: DW_AT_name ("this")46 47%struct.C = type { i8 }48 49@b = external global i850 51; Function Attrs: nounwind52define void @_Z4fun4v() #0 !dbg !12 {53entry:54 %this.addr.i.i = alloca ptr, align 8, !dbg !2155 %this.addr.i = alloca ptr, align 8, !dbg !2256 %agg.tmp.ensured = alloca %struct.C, align 157 %cleanup.cond = alloca i158 %0 = load i8, ptr @b, align 1, !dbg !2459 %tobool = trunc i8 %0 to i1, !dbg !2460 store i1 false, ptr %cleanup.cond61 br i1 %tobool, label %land.rhs, label %land.end, !dbg !2462 63land.rhs: ; preds = %entry64 store i1 true, ptr %cleanup.cond, !dbg !2565 br label %land.end66 67land.end: ; preds = %land.rhs, %entry68 %1 = phi i1 [ false, %entry ], [ true, %land.rhs ]69 %cleanup.is_active = load i1, ptr %cleanup.cond, !dbg !2770 br i1 %cleanup.is_active, label %cleanup.action, label %cleanup.done, !dbg !2771 72cleanup.action: ; preds = %land.end73 store ptr %agg.tmp.ensured, ptr %this.addr.i, align 8, !dbg !2274 call void @llvm.dbg.declare(metadata ptr %this.addr.i, metadata !129, metadata !DIExpression()), !dbg !3175 %this1.i = load ptr, ptr %this.addr.i, !dbg !2276 store ptr %this1.i, ptr %this.addr.i.i, align 8, !dbg !2177 call void @llvm.dbg.declare(metadata ptr %this.addr.i.i, metadata !132, metadata !DIExpression()), !dbg !3378 %this1.i.i = load ptr, ptr %this.addr.i.i, !dbg !2179 br label %cleanup.done, !dbg !2280 81cleanup.done: ; preds = %cleanup.action, %land.end82 ret void, !dbg !3483}84 85; Function Attrs: alwaysinline nounwind86define void @_ZN1CD1Ev(ptr %this) unnamed_addr #1 align 2 !dbg !17 {87entry:88 %this.addr.i = alloca ptr, align 8, !dbg !3789 %this.addr = alloca ptr, align 890 store ptr %this, ptr %this.addr, align 891 call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !29, metadata !DIExpression()), !dbg !3892 %this1 = load ptr, ptr %this.addr93 store ptr %this1, ptr %this.addr.i, align 8, !dbg !3794 call void @llvm.dbg.declare(metadata ptr %this.addr.i, metadata !232, metadata !DIExpression()), !dbg !3995 %this1.i = load ptr, ptr %this.addr.i, !dbg !3796 ret void, !dbg !3797}98 99; Function Attrs: alwaysinline nounwind100define void @_ZN1CD2Ev(ptr %this) unnamed_addr #1 align 2 !dbg !16 {101entry:102 %this.addr = alloca ptr, align 8103 store ptr %this, ptr %this.addr, align 8104 call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !32, metadata !DIExpression()), !dbg !40105 %this1 = load ptr, ptr %this.addr106 ret void, !dbg !41107}108 109; Function Attrs: nounwind readnone110declare void @llvm.dbg.declare(metadata, metadata, metadata) #2111 112attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "use-soft-float"="false" }113attributes #1 = { alwaysinline nounwind "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "use-soft-float"="false" }114attributes #2 = { nounwind readnone }115 116!llvm.dbg.cu = !{!0}117!llvm.module.flags = !{!18, !19}118!llvm.ident = !{!20}119 120!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)121!1 = !DIFile(filename: "<stdin>", directory: "/tmp/dbginfo")122!2 = !{}123!3 = !{!4}124!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS1C")125!5 = !DIFile(filename: "PR20038.cpp", directory: "/tmp/dbginfo")126!6 = !{!7}127!7 = !DISubprogram(name: "~C", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !4, type: !8)128!8 = !DISubroutineType(types: !9)129!9 = !{null, !10}130!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)131!12 = distinct !DISubprogram(name: "fun4", linkageName: "_Z4fun4v", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !5, scope: !13, type: !14, retainedNodes: !2)132!13 = !DIFile(filename: "PR20038.cpp", directory: "/tmp/dbginfo")133!14 = !DISubroutineType(types: !15)134!15 = !{null}135!16 = distinct !DISubprogram(name: "~C", linkageName: "_ZN1CD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !5, scope: !4, type: !8, declaration: !7, retainedNodes: !2)136!17 = distinct !DISubprogram(name: "~C", linkageName: "_ZN1CD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !5, scope: !4, type: !8, declaration: !7, retainedNodes: !2)137!18 = !{i32 2, !"Dwarf Version", i32 4}138!19 = !{i32 2, !"Debug Info Version", i32 3}139!20 = !{!"clang version 3.5.0 "}140!21 = !DILocation(line: 6, scope: !17, inlinedAt: !22)141!22 = !DILocation(line: 5, scope: !23)142!23 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)143!24 = !DILocation(line: 5, scope: !12)144!25 = !DILocation(line: 5, scope: !26)145!26 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)146!27 = !DILocation(line: 5, scope: !28)147!28 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)148!29 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30)149!30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)150!31 = !DILocation(line: 0, scope: !17, inlinedAt: !22)151!32 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30)152!33 = !DILocation(line: 0, scope: !16, inlinedAt: !21)153 154!129 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30)155!132 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30)156!232 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30)157 158!34 = !DILocation(line: 5, scope: !35)159!35 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !36)160!36 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)161!37 = !DILocation(line: 6, scope: !17)162!38 = !DILocation(line: 0, scope: !17)163!39 = !DILocation(line: 0, scope: !16, inlinedAt: !37)164!40 = !DILocation(line: 0, scope: !16)165!41 = !DILocation(line: 6, scope: !16)166