blob: 20bfd8dde2e7c95b71c397ee42edce31383167b6 [file] [log] [blame]
Rafael Espindola99f67352011-05-10 20:59:42 +00001// RUN: llvm-mc -triple i386-apple-darwin %s -filetype=obj -o - | macho-dump | FileCheck %s
2
Evan Chengeee86452011-08-24 22:31:37 +00003// 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
Rafael Espindola99f67352011-05-10 20:59:42 +00009// 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
16Ltmp0:
17 .cfi_startproc
18## BB#0: ## %entry
19 movl $42, %eax
20 ret
21Ltmp1:
22 .cfi_endproc
23Leh_func_end0:
24
25 .cfi_sections .debug_frame
26Ltext_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)
Evan Chengeee86452011-08-24 22:31:37 +000031// CHECK-NEXT: ('size', 52)
Rafael Espindola99f67352011-05-10 20:59:42 +000032// CHECK-NEXT: ('offset', 332)
33// CHECK-NEXT: ('alignment', 2)
Evan Chengeee86452011-08-24 22:31:37 +000034// CHECK-NEXT: ('reloc_offset', 384)
35// CHECK-NEXT: ('num_reloc', 2)
Rafael Espindola99f67352011-05-10 20:59:42 +000036// 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
Evan Chengeee86452011-08-24 22:31:37 +000042// CHECK-NEXT: (('word-0', 0x2c),
43// CHECK-NEXT: ('word-1', 0x4000001)),
44// CHECK-NEXT: # Relocation 1
Rafael Espindola99f67352011-05-10 20:59:42 +000045// CHECK-NEXT: (('word-0', 0x1c),
46// CHECK-NEXT: ('word-1', 0x4000001)),
47// CHECK-NEXT: ])