llvm-6502/test/MC/MachO/empty-dwarf-lines.s
Rafael Espindola 5d4918dbd1 There are two reasons why we might want to use
foo = a - b
.long foo
instead of just
.long a - b

First, on darwin9 64 bits the assembler produces the wrong result. Second,
if "a" is the end of the section all darwin assemblers (9, 10 and mc) will not
consider a - b to be a constant but will if the dummy foo is created.

Split how we handle these cases. The first one is something MC should take care
of. The second one has to be handled by the caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 03:21:47 +00:00

26 lines
904 B
ArmAsm

// 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', 2)
// CHECK-NEXT: ('flags', 0x2000000)
// CHECK-NEXT: ('reserved1', 0)
// CHECK-NEXT: ('reserved2', 0)
// CHECK-NEXT: ('reserved3', 0)
// CHECK-NEXT: ),