diff options
author | Diego Novillo <dnovillo@google.com> | 2014-02-14 19:27:53 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2014-02-14 19:27:53 +0000 |
commit | 5b5cf503b53ff103c9c0ecb735479366d79a47bf (patch) | |
tree | 59bf9ac85d7945b610df04f2c8049dde58b792c4 /llvm/test | |
parent | 4cdaa7d778e6b61df85a4b870b3b959cd40a5911 (diff) | |
download | bcm5719-llvm-5b5cf503b53ff103c9c0ecb735479366d79a47bf.tar.gz bcm5719-llvm-5b5cf503b53ff103c9c0ecb735479366d79a47bf.zip |
Support DWARF discriminators in object streamer.
Summary:
This adds support for emitting DWARF path discriminator values in
the object streamer. It also changes the DWARF dumper to show
discriminator values in the line table output.
Reviewers: echristo
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2794
llvm-svn: 201427
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/DebugInfo/X86/ending-run.ll | 4 | ||||
-rw-r--r-- | llvm/test/DebugInfo/X86/line-info.ll | 2 | ||||
-rw-r--r-- | llvm/test/MC/ELF/discriminator.s | 61 | ||||
-rw-r--r-- | llvm/test/MC/MachO/gen-dwarf-cpp.s | 6 | ||||
-rw-r--r-- | llvm/test/MC/MachO/gen-dwarf.s | 14 |
5 files changed, 74 insertions, 13 deletions
diff --git a/llvm/test/DebugInfo/X86/ending-run.ll b/llvm/test/DebugInfo/X86/ending-run.ll index c18af8ac7f5..2d3e74112db 100644 --- a/llvm/test/DebugInfo/X86/ending-run.ll +++ b/llvm/test/DebugInfo/X86/ending-run.ll @@ -4,9 +4,9 @@ ; Check that the line table starts at 7, not 4, but that the first ; statement isn't until line 8. -; CHECK-NOT: 0x0000000000000000 7 0 1 0 is_stmt +; CHECK-NOT: 0x0000000000000000 7 0 1 0 0 is_stmt ; CHECK: 0x0000000000000000 7 0 1 0 -; CHECK: 0x0000000000000004 8 18 1 0 is_stmt prologue_end +; CHECK: 0x0000000000000004 8 18 1 0 0 is_stmt prologue_end define i32 @callee(i32 %x) nounwind uwtable ssp { entry: diff --git a/llvm/test/DebugInfo/X86/line-info.ll b/llvm/test/DebugInfo/X86/line-info.ll index 149ecc1e202..f6deee9ff16 100644 --- a/llvm/test/DebugInfo/X86/line-info.ll +++ b/llvm/test/DebugInfo/X86/line-info.ll @@ -2,7 +2,7 @@ ; RUN: llvm-dwarfdump %t | FileCheck %s ; CHECK: [[FILEID:[0-9]+]]]{{.*}}list0.h -; CHECK: [[FILEID]] 0 1 0 is_stmt{{$}} +; CHECK: [[FILEID]] 0 1 0 0 is_stmt{{$}} ; IR generated from clang -g -emit-llvm with the following source: ; list0.h: diff --git a/llvm/test/MC/ELF/discriminator.s b/llvm/test/MC/ELF/discriminator.s new file mode 100644 index 00000000000..8a695b96ede --- /dev/null +++ b/llvm/test/MC/ELF/discriminator.s @@ -0,0 +1,61 @@ +# RUN: llvm-mc -triple i386-unknown-unknown %s -filetype=obj -o %t.o +# RUN: llvm-readobj -r %t.o | FileCheck %s +# RUN: llvm-dwarfdump -debug-dump=line %t.o | FileCheck %s -check-prefix=DWARF-DUMP + + .file 1 "foo.c" + .text + .globl foo + .type foo, @function + .align 4 +foo: + .loc 1 2 discriminator 1 + ret + .size foo, .-foo + + .section .debug_info,"",@progbits +.L.debug_info_begin0: + .long 34 # Length of Unit + .short 4 # DWARF version number + .long .L.debug_abbrev_begin # Offset Into Abbrev. Section + .byte 8 # Address Size (in bytes) + .byte 1 # Abbrev [1] 0xb:0x1b DW_TAG_compile_unit + .long .Linfo_string0 # DW_AT_producer + .short 12 # DW_AT_language + .long .Linfo_string1 # DW_AT_name + .quad 0 # DW_AT_low_pc + .long 0 # DW_AT_stmt_list + .long .Linfo_string2 # DW_AT_comp_dir + # DW_AT_APPLE_optimized + .section .debug_abbrev,"",@progbits +.L.debug_abbrev_begin: + .byte 1 # Abbreviation Code + .byte 17 # DW_TAG_compile_unit + .byte 0 # DW_CHILDREN_no + .byte 37 # DW_AT_producer + .byte 14 # DW_FORM_strp + .byte 19 # DW_AT_language + .byte 5 # DW_FORM_data2 + .byte 3 # DW_AT_name + .byte 14 # DW_FORM_strp + .byte 17 # DW_AT_low_pc + .byte 1 # DW_FORM_addr + .byte 16 # DW_AT_stmt_list + .byte 23 # DW_FORM_sec_offset + .byte 27 # DW_AT_comp_dir + .byte 14 # DW_FORM_strp + .ascii "\341\177" # DW_AT_APPLE_optimized + .byte 25 # DW_FORM_flag_present + .byte 0 # EOM(1) + .byte 0 # EOM(2) + .byte 0 # EOM(3) +.L.debug_abbrev_end: + + +# CHECK: Relocations [ +# CHECK: Section ({{[^ ]+}}) .rel.debug_line { +# CHECK-NEXT: 0x2D R_386_32 .text 0x0 +# CHECK-NEXT: } + +# DWARF-DUMP: Address Line Column File ISA Discriminator Flags +# DWARF-DUMP: ------------------ ------ ------ ------ --- ------------- ------------- +# DWARF-DUMP: 0x0001021300000000 1 0 1 0 1 is_stmt diff --git a/llvm/test/MC/MachO/gen-dwarf-cpp.s b/llvm/test/MC/MachO/gen-dwarf-cpp.s index e42a63a191b..69c49c6235c 100644 --- a/llvm/test/MC/MachO/gen-dwarf-cpp.s +++ b/llvm/test/MC/MachO/gen-dwarf-cpp.s @@ -17,6 +17,6 @@ L1: leave // CHECK: file_names[ 2] 0 0x00000000 0x00000000 t.s // We check that the source line number 100 is picked up before the "movl" -// CHECK: Address Line Column File ISA Flags -// CHECK: ------------------ ------ ------ ------ --- ------------- -// CHECK: 0x0000000000000000 102 0 2 0 is_stmt +// CHECK: Address Line Column File ISA Discriminator Flags +// CHECK: ------------------ ------ ------ ------ --- ------------- ------------- +// CHECK: 0x0000000000000000 102 0 2 0 0 is_stmt diff --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s index d763dd120ab..997c83498ef 100644 --- a/llvm/test/MC/MachO/gen-dwarf.s +++ b/llvm/test/MC/MachO/gen-dwarf.s @@ -113,10 +113,10 @@ _x: .long 1 // CHECK: ---- ---------- ---------- --------------------------- // CHECK: file_names[ 1] 1 0x00000000 0x00000000 gen-dwarf.s -// CHECK: Address Line Column File ISA Flags -// CHECK: ------------------ ------ ------ ------ --- ------------- -// CHECK: 0x0000000000000000 6 0 1 0 is_stmt -// CHECK: 0x0000000000000005 7 0 1 0 is_stmt -// CHECK: 0x0000000000000006 8 0 1 0 is_stmt -// CHECK: 0x0000000000000007 11 0 1 0 is_stmt -// CHECK: 0x0000000000000008 11 0 1 0 is_stmt end_sequence +// CHECK: Address Line Column File ISA Discriminator Flags +// CHECK: ------------------ ------ ------ ------ --- ------------- ------------- +// CHECK: 0x0000000000000000 6 0 1 0 0 is_stmt +// CHECK: 0x0000000000000005 7 0 1 0 0 is_stmt +// CHECK: 0x0000000000000006 8 0 1 0 0 is_stmt +// CHECK: 0x0000000000000007 11 0 1 0 0 is_stmt +// CHECK: 0x0000000000000008 11 0 1 0 0 is_stmt end_sequence |