[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / RISCV / reloc-directive.s
blob98c0efd06b44d87d5520fe7c245435e035ff3962
1 # RUN: llvm-mc -triple=riscv32 %s | FileCheck --check-prefix=PRINT %s
2 # RUN: llvm-mc -triple=riscv64 %s | FileCheck --check-prefix=PRINT %s
3 # RUN: llvm-mc -filetype=obj -triple=riscv32 %s | llvm-readobj -r - | FileCheck %s
4 # RUN: llvm-mc -filetype=obj -triple=riscv64 %s | llvm-readobj -r - | FileCheck %s
6 # PRINT: .reloc 8, R_RISCV_NONE, .data
7 # PRINT: .reloc 4, R_RISCV_NONE, foo+4
8 # PRINT: .reloc 0, R_RISCV_NONE, 8
9 # PRINT: .reloc 0, R_RISCV_32, .data+2
10 # PRINT: .reloc 0, R_RISCV_SET32, foo+3
11 # PRINT: .reloc 0, R_RISCV_32_PCREL, 5
12 # PRINT: .reloc 0, BFD_RELOC_NONE, 9
13 # PRINT-NEXT: .reloc 0, BFD_RELOC_32, 9
14 # PRINT-NEXT: .reloc 0, BFD_RELOC_64, 9
16 # CHECK: 0x8 R_RISCV_NONE .data 0x0
17 # CHECK-NEXT: 0x4 R_RISCV_NONE foo 0x4
18 # CHECK-NEXT: 0x0 R_RISCV_NONE - 0x8
19 # CHECK-NEXT: 0x0 R_RISCV_32 .data 0x2
20 # CHECK-NEXT: 0x0 R_RISCV_SET32 foo 0x3
21 # CHECK-NEXT: 0x0 R_RISCV_32_PCREL - 0x5
22 # CHECK-NEXT: 0x0 R_RISCV_NONE - 0x9
23 # CHECK-NEXT: 0x0 R_RISCV_32 - 0x9
24 # CHECK-NEXT: 0x0 R_RISCV_64 - 0x9
25 .text
26 ret
27 nop
28 nop
29 .reloc 8, R_RISCV_NONE, .data
30 .reloc 4, R_RISCV_NONE, foo+4
31 .reloc 0, R_RISCV_NONE, 8
33 .reloc 0, R_RISCV_32, .data+2
34 .reloc 0, R_RISCV_SET32, foo+3
35 .reloc 0, R_RISCV_32_PCREL, 5
37 .reloc 0, BFD_RELOC_NONE, 9
38 .reloc 0, BFD_RELOC_32, 9
39 .reloc 0, BFD_RELOC_64, 9
41 .data
42 .globl foo
43 foo:
44 .word 0
45 .word 0
46 .word 0