xref: /llvm-project/llvm/test/MC/ARM/pcrel-global.s (revision c0944f52c17a30762b81446183967ce3ef6b9aed)
1@ RUN: llvm-mc -filetype=obj -triple=armv7 %s -o %t
2@ RUN: llvm-readelf -r %t | FileCheck %s
3@ RUN: llvm-objdump -dr --triple=armv7 %t | FileCheck %s --check-prefix=DISASM
4@ RUN: llvm-mc -filetype=obj -triple=armebv7 %s -o %t
5@ RUN: llvm-readelf -r %t | FileCheck %s
6
7@ CHECK: There are no relocations in this file.
8
9@ DISASM-LABEL: <bar>:
10@ DISASM-NEXT:    ldr     r0, [pc, #0x0]          @ 0x4 <bar+0x4>
11@ DISASM-NEXT:    add     r0, pc
12@ DISASM-NEXT:   .word   0xfffffffb
13@@ GNU assembler creates an R_ARM_REL32 referencing bar.
14@ DISASM-NOT:    {{.}}
15
16.syntax unified
17
18.thumb
19.thumb_func
20.type bar, %function
21.globl bar
22bar:
23  ldr r0, .LCPI
24.LPC0_1:
25  add r0, pc
26
27.LCPI:
28  .long bar-(.LPC0_1+4)  @ if there is no relocation, the value should be odd
29