Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / arm-sbrel32.s
blob075dfeb69613d2116849e092188f29e04ffb573d
1 // REQUIRES: arm
2 // RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
3 // RUN: ld.lld %t.o -o %t
4 // RUN: llvm-objdump -d --triple=armv7a-none-linux-gnueabi %t | FileCheck %s
6 // Test the R_ARM_SBREL32 relocation which calculates the offset of the Symbol
7 // from the static base. We define the static base to be the address of the
8 // segment containing the symbol
9 .text
10 .syntax unified
12 .globl _start
13 .p2align 2
14 .type _start,%function
15 _start:
16 .fnstart
17 bx lr
19 .long foo(sbrel)
20 .long foo2(sbrel)
21 .long foo3(sbrel)
22 .long foo4(sbrel)
23 // RW segment starts here
24 .data
25 .p2align 4
26 foo: .word 10
27 foo2: .word 20
29 .bss
30 foo3: .space 4
31 foo4: .space 4
33 // CHECK: Disassembly of section .text:
34 // CHECK-EMPTY:
35 // CHECK-NEXT: <_start>:
36 // CHECK-NEXT: 200d4: e12fff1e bx lr
37 // CHECK: 200d8: 00 00 00 00 .word 0x00000000
38 // CHECK-NEXT: 200dc: 04 00 00 00 .word 0x00000004
39 // CHECK-NEXT: 200e0: 08 00 00 00 .word 0x00000008
40 // CHECK-NEXT: 200e4: 0c 00 00 00 .word 0x0000000c