1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/MC/RISCV/hilo-constaddr-expr.s
Saleem Abdulrasool daedfc6daf RISCV: simplify a test case for RISCV (NFCI)
The output of the object file is unimportant and entirely discarded.
Simply redirect the output to `/dev/null` or `NUL` as the case may be.
Additionally, the space between the labels is unimportant.  There is no
need to add space between the labels.  Two labels at the same address
are sufficient to generate the difference expression and should still
test the same behaviour.
2021-06-18 08:19:16 -07:00

20 lines
809 B
ArmAsm

# RUN: not llvm-mc -filetype=obj -triple=riscv32 -mattr=+relax %s -o /dev/null 2>&1 | FileCheck %s
# RUN: not llvm-mc -filetype=obj -triple=riscv32 -mattr=-relax %s -o /dev/null 2>&1 | FileCheck %s
# Check the assembler rejects hi and lo expressions with constant expressions
# involving labels when diff expressions are emitted as relocation pairs.
# Test case derived from test/MC/Mips/hilo-addressing.s
tmp1:
tmp2:
# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
lui t0, %hi(tmp3-tmp1)
# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
lw ra, %lo(tmp3-tmp1)(t0)
tmp3:
# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
lui t1, %hi(tmp2-tmp3)
# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
lw sp, %lo(tmp2-tmp3)(t1)