llvm-project/llvm/test/MC
Roger Ferrer Ibanez b621f04135 [RISCV] Diagnose invalid second input register operand when using %tprel_add
RISCVMCCodeEmitter::expandAddTPRel asserts that the second operand must be
x4/tp. As we are not currently checking this in the RISCVAsmParser, the assert
is easy to trigger due to wrong assembly input.

This patch does a late check of this constraint.

An alternative could be using a singleton register class for x4/tp similar to
the current one for sp. Unfortunately it does not result in a good diagnostic.
Because add is an overloaded mnemonic, if no matching is possible, the
diagnostic of the first failing alternative seems to be used as the diagnostic
itself. This means that this case the %tprel_add is diagnosed as an invalid
operand (because the real add instruction only has 3 operands).

Differential Revision: https://reviews.llvm.org/D60528

llvm-svn: 358183
2019-04-11 15:13:12 +00:00
..
AArch64 [AArch64][AsmParser] Fix .arch_extension directive parsing 2019-04-04 09:11:17 +00:00
AMDGPU [AMDGPU][MC] Corrected conversion rules for inlinable constants to match rules for literals 2019-03-29 14:50:20 +00:00
ARM Revert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5."" 2019-03-26 20:05:27 +00:00
AVR [AVR] Fix the inst-cbr test 2019-01-18 10:11:33 +00:00
AsmParser [MC] Fix floating-point literal lexing. 2019-03-28 21:12:28 +00:00
BPF bpf: disassembler support for XADD under sub-register mode 2019-02-28 19:22:34 +00:00
COFF [llvm-objdump] - Print LMAs when dumping section headers. 2019-01-28 14:11:35 +00:00
Disassembler [AArch64] Update v8.5a MTE LDG/STG instructions 2019-04-03 14:12:13 +00:00
ELF Revert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5."" 2019-03-26 20:05:27 +00:00
Hexagon [Hexagon] Add instruction definitions for Hexagon V66 2018-12-05 21:01:07 +00:00
Lanai
MSP430 [MSP430] Recognize '{' as a line separator 2019-01-15 20:10:46 +00:00
MachO [MC][MachO] Emit an error for emitting relocations of the form -SYM + cst 2019-03-06 18:10:41 +00:00
Mips [mips] Fix crash on recursive using of .set 2019-03-19 15:15:35 +00:00
PowerPC [PowerPC] Fix reversed bit issue in DCMX mask for "xvtstdcdp" and "xvtstdcsp" P9 implementation 2019-04-02 16:56:01 +00:00
RISCV [RISCV] Diagnose invalid second input register operand when using %tprel_add 2019-04-11 15:13:12 +00:00
Sparc [Sparc] Add membar assembler tags 2018-12-13 15:29:12 +00:00
SystemZ [SystemZ] Implement SystemZOperand::print() 2018-10-26 00:36:00 +00:00
WebAssembly [WebAssembly] Add new explicit relocation types for PIC relocations 2019-04-04 17:43:50 +00:00
X86 [X86] Move the 2 byte VEX optimization for MOV instructions back to the X86AsmParser::processInstruction where it used to be. Block when {vex3} prefix is present. 2019-04-10 05:43:20 +00:00