blob: d185127f4b17dd8ea628037a930375001b5cbd3a [file] [log] [blame]
Davide Italiano591b5a52015-09-05 01:02:05 +00001// RUN: llvm-mc -triple i386-apple-darwin %s -filetype=obj -o - | llvm-readobj -s -sd -r | FileCheck %s
Rafael Espindola99f67352011-05-10 20:59:42 +00002
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
Davide Italiano591b5a52015-09-05 01:02:05 +000029// CHECK: Section {
30// CHECK: Index: 1
31// CHECK: Name: __debug_frame (5F 5F 64 65 62 75 67 5F 66 72 61 6D 65 00 00 00)
32// CHECK: Segment: __DWARF (5F 5F 44 57 41 52 46 00 00 00 00 00 00 00 00 00)
33// CHECK: Address: 0x8
34// CHECK: Size: 0x34
35// CHECK: Offset: 332
36// CHECK: Alignment: 2
37// CHECK: RelocationOffset: 0x180
38// CHECK: RelocationCount: 2
39// CHECK: Type: 0x0
40// CHECK: Attributes [ (0x20000)
41// CHECK: Debug (0x20000)
42// CHECK: ]
43// CHECK: Reserved1: 0x0
44// CHECK: Reserved2: 0x0
45// CHECK: SectionData (
46// CHECK: 0000: 10000000 FFFFFFFF 04000400 017C080C |.............|..|
47// CHECK: 0010: 04048801 0C000000 00000000 00000000 |................|
48// CHECK: 0020: 00000000 0C000000 00000000 00000000 |................|
49// CHECK: 0030: 06000000 |....|
50// CHECK: )
51// CHECK: }
52// CHECK: ]
53// CHECK: Relocations [
54// CHECK: Section __debug_frame {
55// CHECK: 0x2C 0 2 0 GENERIC_RELOC_VANILLA 0 __text
56// CHECK: 0x1C 0 2 0 GENERIC_RELOC_VANILLA 0 __text
57// CHECK: }
58// CHECK: ]