1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/MC/Mips/imm-operand-err.s
Wang Rui 070b3d06c0 [Mips] Error if a non-immediate operand is used while an immediate is expected
The 32-bit type relocation (R_MIPS_32) cannot be used for instructions below:

ori $4, $4, start
ori $4, $4, (start - .)

We should print an error instead.

Reviewed By: atanasyan, MaskRay

Differential Revision: https://reviews.llvm.org/D81908
2020-06-19 22:08:59 -07:00

16 lines
580 B
ArmAsm

## Print an error if a non-immediate operand is used while an immediate is expected
# RUN: not llvm-mc -filetype=obj -triple=mips -o /dev/null %s 2>&1 | FileCheck %s
# RUN: not llvm-mc -filetype=obj -triple=mips64 -o /dev/null %s 2>&1 | FileCheck %s
# CHECK: [[#@LINE+1]]:16: error: expected an immediate
ori $4, $4, start
# CHECK: [[#@LINE+1]]:17: error: expected an immediate
ori $4, $4, (start - .)
# CHECK: [[#@LINE+1]]:18: error: expected an immediate
addiu $4, $4, start
# CHECK: [[#@LINE+1]]:19: error: expected an immediate
addiu $4, $4, (start - .)
start: