summaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-02-14 19:27:53 +0000
committerDiego Novillo <dnovillo@google.com>2014-02-14 19:27:53 +0000
commit837c54fa7bc1873fc739cbc163b8b5f207bc996c (patch)
tree1cff438c31507646df2508056f43170bc0febfc2 /test/MC
parentfba2a769a1f9a05437b1d98c99bb827fb7b44482 (diff)
downloadllvm-837c54fa7bc1873fc739cbc163b8b5f207bc996c.tar.gz
llvm-837c54fa7bc1873fc739cbc163b8b5f207bc996c.tar.bz2
llvm-837c54fa7bc1873fc739cbc163b8b5f207bc996c.tar.xz
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/ELF/discriminator.s61
-rw-r--r--test/MC/MachO/gen-dwarf-cpp.s6
-rw-r--r--test/MC/MachO/gen-dwarf.s14
3 files changed, 71 insertions, 10 deletions
diff --git a/test/MC/ELF/discriminator.s b/test/MC/ELF/discriminator.s
new file mode 100644
index 0000000000..8a695b96ed
--- /dev/null
+++ b/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/test/MC/MachO/gen-dwarf-cpp.s b/test/MC/MachO/gen-dwarf-cpp.s
index e42a63a191..69c49c6235 100644
--- a/test/MC/MachO/gen-dwarf-cpp.s
+++ b/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/test/MC/MachO/gen-dwarf.s b/test/MC/MachO/gen-dwarf.s
index d763dd120a..997c83498e 100644
--- a/test/MC/MachO/gen-dwarf.s
+++ b/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