1# RUN: llvm-mc -triple=armv7-linux-gnueabi %s | FileCheck --check-prefix=PRINT %s
2# RUN: llvm-mc -triple=armv7eb-linux-gnueabi %s | FileCheck --check-prefix=PRINT %s
3
4# RUN: llvm-mc -filetype=obj -triple=armv7-linux-gnueabi %s -o %t
5# RUN: llvm-readobj -r %t | FileCheck %s
6# RUN: llvm-readelf -x .data %t | FileCheck --check-prefix=HEX %s
7
8# RUN: llvm-mc -filetype=obj -triple=armv7eb-linux-gnueabi %s -o %t
9# RUN: llvm-readobj -r %t | FileCheck %s
10# RUN: llvm-readelf -x .data %t | FileCheck --check-prefix=HEX %s
11
12.text
13  bx lr
14  nop
15  nop
16  .reloc 8, R_ARM_NONE, .data
17  .reloc 4, R_ARM_NONE, foo+4
18  .reloc 0, R_ARM_NONE, 8
19
20  .reloc 0, R_ARM_ALU_PC_G0, .data+2
21  .reloc 0, R_ARM_LDR_PC_G0, foo+3
22  .reloc 0, R_ARM_THM_ALU_PREL_11_0, 5
23
24.data
25.globl foo
26foo:
27  .word 0
28  .word 0
29  .word 0
30
31# PRINT: .reloc 8, R_ARM_NONE, .data
32# PRINT: .reloc 4, R_ARM_NONE, foo+4
33# PRINT: .reloc 0, R_ARM_NONE, 8
34# PRINT: .reloc 0, R_ARM_ALU_PC_G0, .data+2
35# PRINT: .reloc 0, R_ARM_LDR_PC_G0, foo+3
36# PRINT: .reloc 0, R_ARM_THM_ALU_PREL_11_0, 5
37
38# ARM relocations use the Elf32_Rel format. Addends are neither stored in the
39# relocation entries nor applied in the referenced locations.
40# CHECK:      0x8 R_ARM_NONE .data 0x0
41# CHECK-NEXT: 0x4 R_ARM_NONE foo 0x0
42# CHECK-NEXT: 0x0 R_ARM_NONE - 0x0
43# CHECK-NEXT: 0x0 R_ARM_ALU_PC_G0 .data 0x0
44# CHECK-NEXT: 0x0 R_ARM_LDR_PC_G0 foo 0x0
45# CHECK-NEXT: 0x0 R_ARM_THM_ALU_PREL_11_0 - 0x0
46
47# HEX: 0x00000000 00000000 00000000
48