Home | History | Annotate | Download | only in AArch64
      1 // RUN: llvm-mc -triple=arm64-apple-ios -filetype=obj < %s | \
      2 // RUN: llvm-readobj -sections -section-relocations -section-data | \
      3 // RUN: FileCheck %s
      4 //
      5 // rdar://13070556
      6 
      7 // FIXME: we should add compact unwind support to llvm-objdump -unwind-info
      8 
      9 // CHECK:      Section {
     10 // CHECK:        Index: 1
     11 // CHECK-NEXT:   Name: __compact_unwind
     12 // CHECK-NEXT:   Segment: __LD
     13 // CHECK-NEXT:   Address:
     14 // CHECK-NEXT:   Size:
     15 // CHECK-NEXT:   Offset:
     16 // CHECK-NEXT:   Alignment:
     17 // CHECK-NEXT:   RelocationOffset:
     18 // CHECK-NEXT:   RelocationCount:
     19 // CHECK-NEXT:   Type:
     20 // CHECK-NEXT:   Attributes [
     21 // CHECK-NEXT:     Debug
     22 // CHECK-NEXT:   ]
     23 // CHECK-NEXT:   Reserved1:
     24 // CHECK-NEXT:   Reserved2:
     25 // CHECK-NEXT:   Relocations [
     26 // CHECK-NEXT:     0x60 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
     27 // CHECK-NEXT:     0x40 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
     28 // CHECK-NEXT:     0x20 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
     29 // CHECK-NEXT:     0x0 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
     30 // CHECK-NEXT:   ]
     31 // CHECK-NEXT:   SectionData (
     32 // CHECK-NEXT:     0000: 00000000 00000000 08000000 00000002
     33 // CHECK-NEXT:     0010: 00000000 00000000 00000000 00000000
     34 // CHECK-NEXT:     0020: 08000000 00000000 40000000 00900002
     35 // CHECK-NEXT:     0030: 00000000 00000000 00000000 00000000
     36 // CHECK-NEXT:     0040: 48000000 00000000 D4000000 0F400002
     37 // CHECK-NEXT:     0050: 00000000 00000000 00000000 00000000
     38 // CHECK-NEXT:     0060: 1C010000 00000000 54000000 10100202
     39 // CHECK-NEXT:     0070: 00000000 00000000 00000000 00000000
     40 // CHECK-NEXT:   )
     41 // CHECK-NEXT: }
     42 
     43 	.section	__TEXT,__text,regular,pure_instructions
     44 	.globl	_foo1
     45 	.align	2
     46 _foo1:                                  ; @foo1
     47 	.cfi_startproc
     48 ; BB#0:                                 ; %entry
     49 	add	w0, w0, #42             ; =#42
     50 	ret
     51 	.cfi_endproc
     52 
     53 	.globl	_foo2
     54 	.align	2
     55 _foo2:                                  ; @foo2
     56 	.cfi_startproc
     57 ; BB#0:                                 ; %entry
     58 	sub	sp, sp, #144            ; =#144
     59 Ltmp2:
     60 	.cfi_def_cfa_offset 144
     61 	mov	x9, xzr
     62 	mov	x8, sp
     63 LBB1_1:                                 ; %for.body
     64                                         ; =>This Inner Loop Header: Depth=1
     65 	str	w9, [x8, x9, lsl #2]
     66 	add	x9, x9, #1              ; =#1
     67 	cmp	w9, #36                 ; =#36
     68 	b.ne	LBB1_1
     69 ; BB#2:
     70 	mov	x9, xzr
     71 	mov	w0, wzr
     72 LBB1_3:                                 ; %for.body4
     73                                         ; =>This Inner Loop Header: Depth=1
     74 	ldr	w10, [x8, x9]
     75 	add	x9, x9, #4              ; =#4
     76 	cmp	w9, #144                ; =#144
     77 	add	w0, w10, w0
     78 	b.ne	LBB1_3
     79 ; BB#4:                                 ; %for.end9
     80 	add	sp, sp, #144            ; =#144
     81 	ret
     82 	.cfi_endproc
     83 
     84 	.globl	_foo3
     85 	.align	2
     86 _foo3:                                  ; @foo3
     87 	.cfi_startproc
     88 ; BB#0:                                 ; %entry
     89 	stp	x26, x25, [sp, #-64]!
     90 	stp	x24, x23, [sp, #16]
     91 	stp	x22, x21, [sp, #32]
     92 	stp	x20, x19, [sp, #48]
     93 Ltmp3:
     94 	.cfi_def_cfa_offset 64
     95 Ltmp4:
     96 	.cfi_offset w19, -16
     97 Ltmp5:
     98 	.cfi_offset w20, -24
     99 Ltmp6:
    100 	.cfi_offset w21, -32
    101 Ltmp7:
    102 	.cfi_offset w22, -40
    103 Ltmp8:
    104 	.cfi_offset w23, -48
    105 Ltmp9:
    106 	.cfi_offset w24, -56
    107 Ltmp10:
    108 	.cfi_offset w25, -64
    109 Ltmp11:
    110 	.cfi_offset w26, -72
    111 Lloh0:
    112 	adrp	x8, _bar@GOTPAGE
    113 Lloh1:
    114 	ldr	x8, [x8, _bar@GOTPAGEOFF]
    115 	ldr	w9, [x8]
    116 	ldr	w10, [x8]
    117 	ldr	w11, [x8]
    118 	ldr	w12, [x8]
    119 	ldr	w13, [x8]
    120 	ldr	w14, [x8]
    121 	ldr	w15, [x8]
    122 	ldr	w16, [x8]
    123 	ldr	w17, [x8]
    124 	ldr	w0, [x8]
    125 	ldr	w19, [x8]
    126 	ldr	w20, [x8]
    127 	ldr	w21, [x8]
    128 	ldr	w22, [x8]
    129 	ldr	w23, [x8]
    130 	ldr	w24, [x8]
    131 	ldr	w25, [x8]
    132 	ldr	w8, [x8]
    133 	add	w9, w10, w9
    134 	add	w9, w9, w11
    135 	add	w9, w9, w12
    136 	add	w9, w9, w13
    137 	add	w9, w9, w14
    138 	add	w9, w9, w15
    139 	add	w9, w9, w16
    140 	add	w9, w9, w17
    141 	add	w9, w9, w0
    142 	add	w9, w9, w19
    143 	add	w9, w9, w20
    144 	add	w9, w9, w21
    145 	add	w9, w9, w22
    146 	add	w9, w9, w23
    147 	add	w9, w9, w24
    148 	add	w9, w9, w25
    149 	sub	w8, w8, w9
    150 	sub	w8, w8, w7, lsl #1
    151 	sub	w8, w8, w6, lsl #1
    152 	sub	w8, w8, w5, lsl #1
    153 	sub	w8, w8, w4, lsl #1
    154 	sub	w8, w8, w3, lsl #1
    155 	sub	w8, w8, w2, lsl #1
    156 	sub	w0, w8, w1, lsl #1
    157 	ldp	x20, x19, [sp, #48]
    158 	ldp	x22, x21, [sp, #32]
    159 	ldp	x24, x23, [sp, #16]
    160 	ldp	x26, x25, [sp], #64
    161 	ret
    162 	.loh AdrpLdrGot	Lloh0, Lloh1
    163 	.cfi_endproc
    164 
    165 	.globl	_foo4
    166 	.align	2
    167 _foo4:                                  ; @foo4
    168 	.cfi_startproc
    169 ; BB#0:                                 ; %entry
    170 	stp	x28, x27, [sp, #-16]!
    171 	sub	sp, sp, #512            ; =#512
    172 Ltmp12:
    173 	.cfi_def_cfa_offset 528
    174 Ltmp13:
    175 	.cfi_offset w27, -16
    176 Ltmp14:
    177 	.cfi_offset w28, -24
    178                                         ; kill: W0<def> W0<kill> X0<def>
    179 	mov	x9, xzr
    180 	ubfx	x10, x0, #0, #32
    181 	mov	x8, sp
    182 LBB3_1:                                 ; %for.body
    183                                         ; =>This Inner Loop Header: Depth=1
    184 	add	w11, w10, w9
    185 	str	w11, [x8, x9, lsl #2]
    186 	add	x9, x9, #1              ; =#1
    187 	cmp	w9, #128                ; =#128
    188 	b.ne	LBB3_1
    189 ; BB#2:                                 ; %for.cond2.preheader
    190 	mov	x9, xzr
    191 	mov	w0, wzr
    192 	add	x8, x8, w5, sxtw #2
    193 LBB3_3:                                 ; %for.body4
    194                                         ; =>This Inner Loop Header: Depth=1
    195 	ldr	w10, [x8, x9]
    196 	add	x9, x9, #4              ; =#4
    197 	cmp	w9, #512                ; =#512
    198 	add	w0, w10, w0
    199 	b.ne	LBB3_3
    200 ; BB#4:                                 ; %for.end11
    201 	add	sp, sp, #512            ; =#512
    202 	ldp	x28, x27, [sp], #16
    203 	ret
    204 	.cfi_endproc
    205 
    206 	.comm	_bar,4,2                ; @bar
    207 
    208 .subsections_via_symbols
    209