[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / ARM / reloc-directive.s
blob682f0e1185c72dc3e0bbfee80ebb292234489143
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
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
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
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
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
24 .reloc 0, BFD_RELOC_NONE, 9
25 .reloc 0, BFD_RELOC_8, 9
26 .reloc 0, BFD_RELOC_16, 9
27 .reloc 0, BFD_RELOC_32, 9
29 .data
30 .globl foo
31 foo:
32 .word 0
33 .word 0
34 .word 0
36 # PRINT: .reloc 8, R_ARM_NONE, .data
37 # PRINT: .reloc 4, R_ARM_NONE, foo+4
38 # PRINT: .reloc 0, R_ARM_NONE, 8
39 # PRINT: .reloc 0, R_ARM_ALU_PC_G0, .data+2
40 # PRINT: .reloc 0, R_ARM_LDR_PC_G0, foo+3
41 # PRINT: .reloc 0, R_ARM_THM_ALU_PREL_11_0, 5
42 # PRINT: .reloc 0, BFD_RELOC_NONE, 9
43 # PRINT-NEXT: .reloc 0, BFD_RELOC_8, 9
44 # PRINT-NEXT: .reloc 0, BFD_RELOC_16, 9
45 # PRINT-NEXT: .reloc 0, BFD_RELOC_32, 9
47 # ARM relocations use the Elf32_Rel format. Addends are neither stored in the
48 # relocation entries nor applied in the referenced locations.
49 # CHECK: 0x8 R_ARM_NONE .data
50 # CHECK-NEXT: 0x4 R_ARM_NONE foo
51 # CHECK-NEXT: 0x0 R_ARM_NONE -
52 # CHECK-NEXT: 0x0 R_ARM_ALU_PC_G0 .data
53 # CHECK-NEXT: 0x0 R_ARM_LDR_PC_G0 foo
54 # CHECK-NEXT: 0x0 R_ARM_THM_ALU_PREL_11_0 -
55 # CHECK-NEXT: 0x0 R_ARM_NONE -
56 # CHECK-NEXT: 0x0 R_ARM_ABS8 -
57 # CHECK-NEXT: 0x0 R_ARM_ABS16 -
58 # CHECK-NEXT: 0x0 R_ARM_ABS32 -
60 # HEX: 0x00000000 00000000 00000000