[Mips] Error if a non-immediate operand is used while an immediate is expected
authorWang Rui <wangrui@loongson.cn>
Sat, 20 Jun 2020 05:05:28 +0000 (22:05 -0700)
committerFangrui Song <i@maskray.me>
Sat, 20 Jun 2020 05:08:59 +0000 (22:08 -0700)
commitdd48c57da35e069c739361ce822b98c6e42f555e
treef63d68794f0525d9c458124f8b5128deba200089
parent058ec2067724ee7d973af4201c7f53157d9810aa
[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
llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
llvm/test/MC/Mips/imm-operand-err.s [new file with mode: 0644]