Add a test case for r156840, a fix to llvm-objdump when disassembling using
[oota-llvm.git] / test / MC / MachO / debug_frame.s
1 // RUN: llvm-mc -triple i386-apple-darwin %s -filetype=obj -o - | macho-dump | FileCheck %s
2
3 // Make sure MC can handle file level .cfi_startproc and .cfi_endproc that creates
4 // an empty frame.
5 // rdar://10017184
6 .cfi_startproc
7 .cfi_endproc
8
9 // Check that we don't produce a relocation for the CIE pointer and therefore
10 // we have only one relocation in __debug_frame.
11
12         .section        __TEXT,__text,regular,pure_instructions
13         .globl  _f
14         .align  4, 0x90
15 _f:                                     ## @f
16 Ltmp0:
17         .cfi_startproc
18 ## BB#0:                                ## %entry
19         movl    $42, %eax
20         ret
21 Ltmp1:
22         .cfi_endproc
23 Leh_func_end0:
24
25         .cfi_sections .debug_frame
26 Ltext_end:
27
28 // CHECK:       (('section_name', '__debug_frame\x00\x00\x00')
29 // CHECK-NEXT:   ('segment_name', '__DWARF\x00\x00\x00\x00\x00\x00\x00\x00\x00')
30 // CHECK-NEXT:   ('address', 8)
31 // CHECK-NEXT:   ('size', 52)
32 // CHECK-NEXT:   ('offset', 332)
33 // CHECK-NEXT:   ('alignment', 2)
34 // CHECK-NEXT:   ('reloc_offset', 384)
35 // CHECK-NEXT:   ('num_reloc', 2)
36 // CHECK-NEXT:   ('flags', 0x2000000)
37 // CHECK-NEXT:   ('reserved1', 0)
38 // CHECK-NEXT:   ('reserved2', 0)
39 // CHECK-NEXT:  ),
40 // CHECK-NEXT: ('_relocations', [
41 // CHECK-NEXT:   # Relocation 0
42 // CHECK-NEXT:   (('word-0', 0x2c),
43 // CHECK-NEXT:    ('word-1', 0x4000001)),
44 // CHECK-NEXT:   # Relocation 1
45 // CHECK-NEXT:   (('word-0', 0x1c),
46 // CHECK-NEXT:    ('word-1', 0x4000001)),
47 // CHECK-NEXT: ])