aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-04 00:31:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-04 00:31:13 +0000
commit767b1be3900bdc693aa0ad3e554ba034845f67f7 (patch)
treed3d76fda6dbf4315192bf1d611eee5cad2a56296 /test
parentceab50198ee0d1aa2468d868111e3cf7c0c56ebd (diff)
downloadexternal_llvm-767b1be3900bdc693aa0ad3e554ba034845f67f7.zip
external_llvm-767b1be3900bdc693aa0ad3e554ba034845f67f7.tar.gz
external_llvm-767b1be3900bdc693aa0ad3e554ba034845f67f7.tar.bz2
Next step: Only pad debug_line when the target is darwin. Add a FIXME to avoid
doing that if the target is darwin10 or newer. This fixes *) Direct object emission was producing objects without the workaround on darwin9. *) Assembly printing was producing objects with the workaround on linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/ELF/empty-dwarf-lines.s21
-rw-r--r--test/MC/MachO/empty-dwarf-lines.s25
2 files changed, 46 insertions, 0 deletions
diff --git a/test/MC/ELF/empty-dwarf-lines.s b/test/MC/ELF/empty-dwarf-lines.s
new file mode 100644
index 0000000..81d9871
--- /dev/null
+++ b/test/MC/ELF/empty-dwarf-lines.s
@@ -0,0 +1,21 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
+
+// Test that the dwarf debug_line section contains no line directives.
+
+ .file 1 "test.c"
+ .globl c
+c:
+ .asciz "hi\n"
+
+// CHECK: # Section 0x00000004
+// CHECK-NEXT: (('sh_name', 0x00000012) # '.debug_line'
+// CHECK-NEXT: ('sh_type', 0x00000000)
+// CHECK-NEXT: ('sh_flags', 0x00000000)
+// CHECK-NEXT: ('sh_addr', 0x00000000)
+// CHECK-NEXT: ('sh_offset', 0x00000044)
+// CHECK-NEXT: ('sh_size', 0x00000027)
+// CHECK-NEXT: ('sh_link', 0x00000000)
+// CHECK-NEXT: ('sh_info', 0x00000000)
+// CHECK-NEXT: ('sh_addralign', 0x00000001)
+// CHECK-NEXT: ('sh_entsize', 0x00000000)
+// CHECK-NEXT: ),
diff --git a/test/MC/MachO/empty-dwarf-lines.s b/test/MC/MachO/empty-dwarf-lines.s
new file mode 100644
index 0000000..29ef218
--- /dev/null
+++ b/test/MC/MachO/empty-dwarf-lines.s
@@ -0,0 +1,25 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s
+
+// This tests that when producing files for darwin9 or older we make sure
+// that debug_line sections are of a minimum size to avoid the linker bug
+// described in PR8715.
+
+ .section __DATA,__data
+ .file 1 "test.c"
+ .globl _c ## @c
+_c:
+ .asciz "hi\n"
+
+// CHECK: (('section_name', '__debug_line\x00\x00\x00\x00')
+// CHECK-NEXT: ('segment_name', '__DWARF\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK-NEXT: ('address', 4)
+// CHECK-NEXT: ('size', 44)
+// CHECK-NEXT: ('offset', 452)
+// CHECK-NEXT: ('alignment', 0)
+// CHECK-NEXT: ('reloc_offset', 496)
+// CHECK-NEXT: ('num_reloc', 4)
+// CHECK-NEXT: ('flags', 0x2000000)
+// CHECK-NEXT: ('reserved1', 0)
+// CHECK-NEXT: ('reserved2', 0)
+// CHECK-NEXT: ('reserved3', 0)
+// CHECK-NEXT: ),