1 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+relax %s \
2 # RUN: | llvm-readobj -r | FileCheck -check-prefix=RELAX %s
3 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=-relax %s \
4 # RUN: | llvm-readobj -r | FileCheck -check-prefix=NORELAX %s
6 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+relax %s \
7 # RUN: | llvm-readobj -r | FileCheck -check-prefix=RELAX %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=-relax %s \
9 # RUN: | llvm-readobj -r | FileCheck -check-prefix=NORELAX %s
11 # Check that subtraction expressions are emitted as two relocations
12 # only when relaxation is enabled
31 # RELAX: 0x0 R_RISCV_ADD64 .L2 0x0
32 # RELAX: 0x0 R_RISCV_SUB64 .L1 0x0
33 # RELAX: 0x8 R_RISCV_ADD64 G2 0x0
34 # RELAX: 0x8 R_RISCV_SUB64 G1 0x0
35 # RELAX: 0x10 R_RISCV_ADD32 .L2 0x0
36 # RELAX: 0x10 R_RISCV_SUB32 .L1 0x0
37 # RELAX: 0x14 R_RISCV_ADD32 G2 0x0
38 # RELAX: 0x14 R_RISCV_SUB32 G1 0x0
39 # RELAX: 0x18 R_RISCV_ADD16 .L2 0x0
40 # RELAX: 0x18 R_RISCV_SUB16 .L1 0x0
41 # RELAX: 0x1A R_RISCV_ADD16 G2 0x0
42 # RELAX: 0x1A R_RISCV_SUB16 G1 0x0
43 # RELAX: 0x1C R_RISCV_ADD8 .L2 0x0
44 # RELAX: 0x1C R_RISCV_SUB8 .L1 0x0
45 # RELAX: 0x1D R_RISCV_ADD8 G2 0x0
46 # RELAX: 0x1D R_RISCV_SUB8 G1 0x0
47 # NORELAX-NOT: R_RISCV