blob: 247347d252a7e1cd38aefe2e07df6cde704a9e73 [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
Quentin Colombet97c05b52014-04-15 01:17:45 +00006_proc:
Evan Chengeee86452011-08-24 22:31:37 +00007.cfi_startproc
8.cfi_endproc
9
Rafael Espindola99f67352011-05-10 20:59:42 +000010// Check that we don't produce a relocation for the CIE pointer and therefore
11// we have only one relocation in __debug_frame.
12
13 .section __TEXT,__text,regular,pure_instructions
14 .globl _f
15 .align 4, 0x90
16_f: ## @f
17Ltmp0:
18 .cfi_startproc
19## BB#0: ## %entry
20 movl $42, %eax
21 ret
22Ltmp1:
23 .cfi_endproc
24Leh_func_end0:
25
26 .cfi_sections .debug_frame
27Ltext_end:
28
29// CHECK: (('section_name', '__debug_frame\x00\x00\x00')
30// CHECK-NEXT: ('segment_name', '__DWARF\x00\x00\x00\x00\x00\x00\x00\x00\x00')
31// CHECK-NEXT: ('address', 8)
Evan Chengeee86452011-08-24 22:31:37 +000032// CHECK-NEXT: ('size', 52)
Rafael Espindola99f67352011-05-10 20:59:42 +000033// CHECK-NEXT: ('offset', 332)
34// CHECK-NEXT: ('alignment', 2)
Evan Chengeee86452011-08-24 22:31:37 +000035// CHECK-NEXT: ('reloc_offset', 384)
36// CHECK-NEXT: ('num_reloc', 2)
Rafael Espindola99f67352011-05-10 20:59:42 +000037// CHECK-NEXT: ('flags', 0x2000000)
38// CHECK-NEXT: ('reserved1', 0)
39// CHECK-NEXT: ('reserved2', 0)
40// CHECK-NEXT: ),
41// CHECK-NEXT: ('_relocations', [
42// CHECK-NEXT: # Relocation 0
Evan Chengeee86452011-08-24 22:31:37 +000043// CHECK-NEXT: (('word-0', 0x2c),
44// CHECK-NEXT: ('word-1', 0x4000001)),
45// CHECK-NEXT: # Relocation 1
Rafael Espindola99f67352011-05-10 20:59:42 +000046// CHECK-NEXT: (('word-0', 0x1c),
47// CHECK-NEXT: ('word-1', 0x4000001)),
48// CHECK-NEXT: ])