From ab44ce3d598882e51a25eb82eb7ae6308de85ae6 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 29 May 2017 16:25:25 +0000 Subject: Vendor import of llvm trunk r304149: https://llvm.org/svn/llvm-project/llvm/trunk@304149 --- test/DebugInfo/Generic/empty.ll | 9 +- test/DebugInfo/Generic/nodebug.ll | 13 +- test/DebugInfo/Generic/skeletoncu.ll | 4 +- test/DebugInfo/Inputs/split-dwarf-dwp.cpp | 12 ++ test/DebugInfo/Inputs/split-dwarf-dwp.o | Bin 0 -> 2744 bytes test/DebugInfo/Inputs/split-dwarf-dwp.o.dwp | Bin 0 -> 1256 bytes test/DebugInfo/MIR/X86/empty-inline.mir | 122 +++++++++++++++++ test/DebugInfo/PDB/Inputs/merge-ids-1.yaml | 36 +++++ test/DebugInfo/PDB/Inputs/merge-ids-2.yaml | 31 +++++ .../PDB/Inputs/merge-ids-and-types-1.yaml | 113 ++++++++++++++++ .../PDB/Inputs/merge-ids-and-types-2.yaml | 143 ++++++++++++++++++++ test/DebugInfo/PDB/Inputs/merge-types-1.yaml | 52 +++++++ test/DebugInfo/PDB/Inputs/merge-types-2.yaml | 52 +++++++ test/DebugInfo/PDB/Inputs/merge1.yaml | 52 ------- test/DebugInfo/PDB/Inputs/merge2.yaml | 52 ------- test/DebugInfo/PDB/Inputs/source-names-1.yaml | 8 ++ test/DebugInfo/PDB/Inputs/source-names-2.yaml | 8 ++ .../DebugInfo/PDB/pdbdump-merge-ids-and-types.test | 65 +++++++++ test/DebugInfo/PDB/pdbdump-mergeids.test | 31 +++++ test/DebugInfo/PDB/pdbdump-mergetypes.test | 4 +- test/DebugInfo/PDB/pdbdump-objfilename.yaml | 14 ++ test/DebugInfo/PDB/pdbdump-source-names.test | 20 +++ test/DebugInfo/X86/array.ll | 150 ++++++++++++--------- test/DebugInfo/X86/dbg-value-frame-index.ll | 2 +- test/DebugInfo/X86/debug-loc-offset.ll | 8 +- test/DebugInfo/X86/debug-macro.ll | 72 +++++----- test/DebugInfo/X86/empty.ll | 11 +- test/DebugInfo/X86/fission-hash.ll | 10 +- test/DebugInfo/X86/gnu-public-names-empty.ll | 9 +- test/DebugInfo/X86/gnu-public-names-gmlt.ll | 68 ++++++++++ test/DebugInfo/X86/split-dwarf-multiple-cu-hash.ll | 42 ++++++ test/DebugInfo/X86/split-dwarf-omit-empty.ll | 54 ++++++++ test/DebugInfo/dwo.ll | 4 +- test/DebugInfo/llvm-symbolizer.test | 8 ++ test/DebugInfo/omit-empty.ll | 12 ++ test/DebugInfo/skeletoncu.ll | 4 +- 36 files changed, 1067 insertions(+), 228 deletions(-) create mode 100644 test/DebugInfo/Inputs/split-dwarf-dwp.cpp create mode 100644 test/DebugInfo/Inputs/split-dwarf-dwp.o create mode 100644 test/DebugInfo/Inputs/split-dwarf-dwp.o.dwp create mode 100644 test/DebugInfo/MIR/X86/empty-inline.mir create mode 100644 test/DebugInfo/PDB/Inputs/merge-ids-1.yaml create mode 100644 test/DebugInfo/PDB/Inputs/merge-ids-2.yaml create mode 100644 test/DebugInfo/PDB/Inputs/merge-ids-and-types-1.yaml create mode 100644 test/DebugInfo/PDB/Inputs/merge-ids-and-types-2.yaml create mode 100644 test/DebugInfo/PDB/Inputs/merge-types-1.yaml create mode 100644 test/DebugInfo/PDB/Inputs/merge-types-2.yaml delete mode 100644 test/DebugInfo/PDB/Inputs/merge1.yaml delete mode 100644 test/DebugInfo/PDB/Inputs/merge2.yaml create mode 100644 test/DebugInfo/PDB/Inputs/source-names-1.yaml create mode 100644 test/DebugInfo/PDB/Inputs/source-names-2.yaml create mode 100644 test/DebugInfo/PDB/pdbdump-merge-ids-and-types.test create mode 100644 test/DebugInfo/PDB/pdbdump-mergeids.test create mode 100644 test/DebugInfo/PDB/pdbdump-objfilename.yaml create mode 100644 test/DebugInfo/PDB/pdbdump-source-names.test create mode 100644 test/DebugInfo/X86/gnu-public-names-gmlt.ll create mode 100644 test/DebugInfo/X86/split-dwarf-multiple-cu-hash.ll create mode 100644 test/DebugInfo/X86/split-dwarf-omit-empty.ll create mode 100644 test/DebugInfo/omit-empty.ll (limited to 'test/DebugInfo') diff --git a/test/DebugInfo/Generic/empty.ll b/test/DebugInfo/Generic/empty.ll index d5f738fa0271..79912841fa6d 100644 --- a/test/DebugInfo/Generic/empty.ll +++ b/test/DebugInfo/Generic/empty.ll @@ -13,10 +13,9 @@ ; CHECK-NOT: file_names[ ; CHECK: .debug_pubnames contents: -; CHECK-NOT: Offset +; CHECK-NOT: {{^}}0x -; CHECK: .debug_pubtypes contents: -; CHECK-NOT: Offset +; CHECK: contents: ; Don't emit DW_AT_addr_base when there are no addresses. ; FISSION-NOT: DW_AT_GNU_addr_base [DW_FORM_sec_offset] @@ -24,8 +23,10 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!5} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: FullDebug, file: !4, enums: !2, retainedTypes: !2, globals: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: FullDebug, file: !4, enums: !2, retainedTypes: !6, globals: !2) !2 = !{} !3 = !DIFile(filename: "empty.c", directory: "/home/nlewycky") !4 = !DIFile(filename: "empty.c", directory: "/home/nlewycky") !5 = !{i32 1, !"Debug Info Version", i32 3} +!6 = !{!7} +!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/Generic/nodebug.ll b/test/DebugInfo/Generic/nodebug.ll index f85b00bf9f7e..9b0eb9b4dd07 100644 --- a/test/DebugInfo/Generic/nodebug.ll +++ b/test/DebugInfo/Generic/nodebug.ll @@ -1,6 +1,6 @@ ; REQUIRES: object-emission -; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump - | FileCheck %s ; Test that a nodebug function (a function not appearing in the debug info IR ; metadata subprogram list) with DebugLocs on its IR doesn't cause crashes/does @@ -17,9 +17,16 @@ ; } ; Check that there's no DW_TAG_subprogram, not even for the 'f2' function. +; CHECK: .debug_info contents: ; CHECK: DW_TAG_compile_unit ; CHECK-NOT: DW_TAG_subprogram +; Expect no line table entry since there are no functions and file references in this compile unit +; CHECK: .debug_line contents: +; CHECK: Line table prologue: +; CHECK: total_length: 0x00000019 +; CHECK-NOT: file_names[ + @i = external global i32 ; Function Attrs: uwtable @@ -35,7 +42,7 @@ attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"=" !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !12, globals: !2, imports: !2) !1 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo") !2 = !{} !4 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) @@ -46,3 +53,5 @@ attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"=" !9 = !{i32 2, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5.0 "} !11 = !DILocation(line: 3, scope: !4) +!12 = !{!13} +!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/Generic/skeletoncu.ll b/test/DebugInfo/Generic/skeletoncu.ll index 6d91afd0fa79..b9761b2ab565 100644 --- a/test/DebugInfo/Generic/skeletoncu.ll +++ b/test/DebugInfo/Generic/skeletoncu.ll @@ -7,9 +7,11 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!3, !4} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 2, splitDebugFilename: "my.dwo", emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2, dwoId: 43981) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 2, splitDebugFilename: "my.dwo", emissionKind: FullDebug, enums: !2, retainedTypes: !5, globals: !2, imports: !2, dwoId: 43981) !1 = !DIFile(filename: "", directory: "/") !2 = !{} !3 = !{i32 2, !"Dwarf Version", i32 4} !4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{!6} +!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/Inputs/split-dwarf-dwp.cpp b/test/DebugInfo/Inputs/split-dwarf-dwp.cpp new file mode 100644 index 000000000000..b07a1537d6bf --- /dev/null +++ b/test/DebugInfo/Inputs/split-dwarf-dwp.cpp @@ -0,0 +1,12 @@ +void f1(); +__attribute__((always_inline)) void f2() { + f1(); +} +void f3() { + f2(); +} + +To produce split-dwarf-dwp.o{,dwp}, run: + + $ clang++ split-dwarf-dwp.cpp -gsplit-dwarf -c -Xclang -fdebug-compilation-dir=Output -fno-split-dwarf-inlining + $ llvm-dwp split-dwarf-dwp.dwo -o split-dwarf-dwp.o.dwp diff --git a/test/DebugInfo/Inputs/split-dwarf-dwp.o b/test/DebugInfo/Inputs/split-dwarf-dwp.o new file mode 100644 index 000000000000..614c62040dec Binary files /dev/null and b/test/DebugInfo/Inputs/split-dwarf-dwp.o differ diff --git a/test/DebugInfo/Inputs/split-dwarf-dwp.o.dwp b/test/DebugInfo/Inputs/split-dwarf-dwp.o.dwp new file mode 100644 index 000000000000..16a0af8c062f Binary files /dev/null and b/test/DebugInfo/Inputs/split-dwarf-dwp.o.dwp differ diff --git a/test/DebugInfo/MIR/X86/empty-inline.mir b/test/DebugInfo/MIR/X86/empty-inline.mir new file mode 100644 index 000000000000..1766a8f44616 --- /dev/null +++ b/test/DebugInfo/MIR/X86/empty-inline.mir @@ -0,0 +1,122 @@ +# RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s +# +# This testcase has an implicit def pseudo-iunstruction with a debug location. +# +# CHECK: .debug_info contents: +# CHECK: DW_TAG_subprogram +# CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) +# CHECK-NOT: DW_TAG +# CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn3Ev" +# CHECK-NOT: DW_TAG +# Here should not be an inlined subroutine with 0 length. +# CHECK: NULL +# +# CHECK: Address Line Column File ISA Discriminator Flags +# CHECK-NEXT: --- +# CHECK-NEXT: 25 0 1 0 0 is_stmt +# CHECK-NEXT: 29 28 1 0 0 is_stmt prologue_end +# CHECK-NEXT: 29 28 1 0 0 is_stmt end_sequence +--- | + source_filename = "t.ll" + target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" + target triple = "x86_64-apple-macosx" + + %class.E = type { %class.D } + %class.D = type { %class.B } + %class.B = type { %class.A, %class.A } + %class.A = type { i8 } + %class.C = type <{ %class.E*, %class.B, [2 x i8] }> + + @a = local_unnamed_addr global %class.E* null, align 4 + + define i32 @_ZN1C5m_fn3Ev(%class.C* nocapture) local_unnamed_addr align 2 !dbg !6 { + %2 = alloca %class.B, align 1 + %3 = load %class.E*, %class.E** @a, align 4 + %4 = icmp eq %class.E* %3, null + br i1 %4, label %10, label %5 + + ;