[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / RISCV / scoped-relaxation.s
blob6cb82536fcda8957c76c93ac4e4c7e767fcd8262
1 # RUN: llvm-mc -mattr -relax -triple riscv64 -filetype obj %s -o - | llvm-readobj -d -r - | FileCheck %s
3 .global function
5 # CHECK: .rela.text {
7 # Unrelaxed reference, this would normally fail, but the subsequent scoped
8 # relaxation forces relaxation on the file.
9 .dword function - .
11 # CHECK: 0x0 R_RISCV_ADD64 function 0x0
12 # CHECK-NEXT: 0x0 R_RISCV_SUB64 - 0x0
14 # Relaxed reference, this will resolve to a pair of `RISCV_ADD64` and
15 # `RISCV_SUB64` relocation.
16 .option push
17 .option relax
18 .dword function - .
19 .option pop
21 # CHECK: 0x8 R_RISCV_ADD64 function 0x0
22 # CHECK-NEXT: 0x8 R_RISCV_SUB64 - 0x0
24 # Unrelaxed reference, this will resolve to a pair of `RISCV_ADD64` and
25 # `RISCV_SUB64` relocation due to relaxation being sticky to the file.
26 .option push
27 .option norelax
28 .dword function - .
29 .option pop
31 # CHECK: 0x10 R_RISCV_ADD64 function 0x0
32 # CHECK-NEXT: 0x10 R_RISCV_SUB64 - 0x0
34 # CHECK: }