summaryrefslogtreecommitdiff
path: root/test/MC/MachO
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2012-01-10 17:52:29 +0000
committerKevin Enderby <enderby@apple.com>2012-01-10 17:52:29 +0000
commit38fdb7d9fc40e9f29c3156b6625cac8d91d562e1 (patch)
tree57d0e053f65e0c6840e28e007af6bb1c33f9fe12 /test/MC/MachO
parent4ba0e75e4b1c557a9de5a3675357c2a4bf699a6a (diff)
downloadllvm-38fdb7d9fc40e9f29c3156b6625cac8d91d562e1.tar.gz
llvm-38fdb7d9fc40e9f29c3156b6625cac8d91d562e1.tar.bz2
llvm-38fdb7d9fc40e9f29c3156b6625cac8d91d562e1.tar.xz
Various crash reporting tools have a problem with the dwarf generated for
assembly source when it generates the TAG_subprogram dwarf debug info for the labels that have nothing between them as in this bit of assembly source: % cat ZeroLength.s _func1: _func2: nop One solution would be to not emit the subsequent labels with the same address and use the next label with a different address or the end of the section for the AT_high_pc value of the TAG_subprogram. Turns out in llvm-mc it is not possible in all cases to determine of two symbols have the same value at the point we put out the TAG_subprogram dwarf debug info. So we will have llvm-mc instead of putting out TAG_subprogram's put out DW_TAG_label's. And the DW_TAG_label does not have a AT_high_pc value which avoids the problem. This commit is only the functional change to make the diffs clear as to what is really being changed. The next commit will be to clean up the names of such things like MCGenDwarfSubprogramEntry to something like MCGenDwarfLabelEntry. rdar://10666925 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/MachO')
-rw-r--r--test/MC/MachO/gen-dwarf.s25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/MC/MachO/gen-dwarf.s b/test/MC/MachO/gen-dwarf.s
index a443d75ae0..4fbc32d295 100644
--- a/test/MC/MachO/gen-dwarf.s
+++ b/test/MC/MachO/gen-dwarf.s
@@ -7,6 +7,7 @@ _bar:
L1: leave
ret
_foo:
+_baz:
nop
.data
_x: .long 1
@@ -24,12 +25,11 @@ _x: .long 1
// CHECK: DW_AT_producer DW_FORM_string
// CHECK: DW_AT_language DW_FORM_data2
-// CHECK: [2] DW_TAG_subprogram DW_CHILDREN_yes
+// CHECK: [2] DW_TAG_label DW_CHILDREN_yes
// CHECK: DW_AT_name DW_FORM_string
// CHECK: DW_AT_decl_file DW_FORM_data4
// CHECK: DW_AT_decl_line DW_FORM_data4
// CHECK: DW_AT_low_pc DW_FORM_addr
-// CHECK: DW_AT_high_pc DW_FORM_addr
// CHECK: DW_AT_prototyped DW_FORM_flag
// CHECK: [3] DW_TAG_unspecified_parameters DW_CHILDREN_no
@@ -48,24 +48,33 @@ _x: .long 1
// CHECK: DW_AT_producer [DW_FORM_string] ("llvm-mc (based on {{.*}})")
// CHECK: DW_AT_language [DW_FORM_data2] (0x8001)
-// CHECK: DW_TAG_subprogram [2] *
+// CHECK: DW_TAG_label [2] *
// CHECK: DW_AT_name [DW_FORM_string] ("bar")
// CHECK: DW_AT_decl_file [DW_FORM_data4] (0x00000001)
// CHECK: DW_AT_decl_line [DW_FORM_data4] (0x00000005)
// CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
-// CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000007)
// CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
// CHECK: DW_TAG_unspecified_parameters [3]
// CHECK: NULL
-// CHECK: DW_TAG_subprogram [2] *
+// CHECK: DW_TAG_label [2] *
// CHECK: DW_AT_name [DW_FORM_string] ("foo")
// CHECK: DW_AT_decl_file [DW_FORM_data4] (0x00000001)
// CHECK: DW_AT_decl_line [DW_FORM_data4] (0x00000009)
// CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000007)
-// CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008)
+// CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
+
+// CHECK: DW_TAG_unspecified_parameters [3]
+
+// CHECK: NULL
+
+// CHECK: DW_TAG_label [2] *
+// CHECK: DW_AT_name [DW_FORM_string] ("baz")
+// CHECK: DW_AT_decl_file [DW_FORM_data4] (0x00000001)
+// CHECK: DW_AT_decl_line [DW_FORM_data4] (0x0000000a)
+// CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000007)
// CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
// CHECK: DW_TAG_unspecified_parameters [3]
@@ -109,5 +118,5 @@ _x: .long 1
// 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 10 0 1 0 is_stmt
-// CHECK: 0x0000000000000008 10 0 1 0 is_stmt end_sequence
+// CHECK: 0x0000000000000007 11 0 1 0 is_stmt
+// CHECK: 0x0000000000000008 11 0 1 0 is_stmt end_sequence