diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-04 00:31:13 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-04 00:31:13 +0000 |
commit | 1048e75fb9f76233152e3848cef65c18d6d39e03 (patch) | |
tree | c3d24efa5e4c7cb60f071a9966b5dbaa13807198 /llvm/test | |
parent | ce18d7ebb5e17df724c1e0289c9897b0c717a691 (diff) | |
download | bcm5719-llvm-1048e75fb9f76233152e3848cef65c18d6d39e03.tar.gz bcm5719-llvm-1048e75fb9f76233152e3848cef65c18d6d39e03.zip |
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.
llvm-svn: 120866
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/MC/ELF/empty-dwarf-lines.s | 21 | ||||
-rw-r--r-- | llvm/test/MC/MachO/empty-dwarf-lines.s | 25 |
2 files changed, 46 insertions, 0 deletions
diff --git a/llvm/test/MC/ELF/empty-dwarf-lines.s b/llvm/test/MC/ELF/empty-dwarf-lines.s new file mode 100644 index 00000000000..81d98711e9d --- /dev/null +++ b/llvm/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/llvm/test/MC/MachO/empty-dwarf-lines.s b/llvm/test/MC/MachO/empty-dwarf-lines.s new file mode 100644 index 00000000000..29ef218fddc --- /dev/null +++ b/llvm/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: ), |