Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / ARM / pcrel-global.s
blob91ef3b6ca7b15ac79cdb9e83337db8ceec8fc002
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
7 @ CHECK: There are no relocations in this file.
9 @ DISASM-LABEL: <bar>:
10 @ DISASM-NEXT: adr.w r0, #-4
11 @ DISASM-NEXT: adr.w r0, #-8
12 @ DISASM-NEXT: ldr.w pc, [pc, #-0xc] @ 0x10 <bar>
13 @ DISASM-NEXT: ldr r0, [pc, #0x0] @ 0x20 <bar+0x10>
14 @ DISASM-NEXT: add r0, pc
15 @ DISASM-NEXT: .word 0xffffffef
16 @@ GNU assembler creates an R_ARM_REL32 referencing bar.
17 @ DISASM-NOT: {{.}}
19 .syntax unified
21 .globl foo
22 foo:
23 ldrd r0, r1, foo @ arm_pcrel_10_unscaled
24 vldr d0, foo @ arm_pcrel_10
25 adr r2, foo @ arm_adr_pcrel_12
26 ldr r0, foo @ arm_ldst_pcrel_12
28 .thumb
29 .thumb_func
30 .type bar, %function
31 .globl bar
32 bar:
33 adr r0, bar @ thumb_adr_pcrel_10
34 adr.w r0, bar @ t2_adr_pcrel_12
35 ldr.w pc, bar @ t2_ldst_pcrel_12
37 ldr r0, .LCPI
38 .LPC0_1:
39 add r0, pc
41 .LCPI:
42 .long bar-(.LPC0_1+4) @ if there is no relocation, the value should be odd