Skip to content

Commit

Permalink
Check for tied operands
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D50592

llvm-svn: 339567
  • Loading branch information
Sid Manning committed Aug 13, 2018
1 parent 4b3a8bd commit 8d4a661
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
Expand Up @@ -581,6 +581,7 @@ bool HexagonAsmParser::matchOneInstruction(MCInst &MCI, SMLoc IDLoc,
case Match_MnemonicFail:
return Error(IDLoc, "unrecognized instruction");
case Match_InvalidOperand:
case Match_InvalidTiedOperand:
SMLoc ErrorLoc = IDLoc;
if (ErrorInfo != ~0U) {
if (ErrorInfo >= InstOperands.size())
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/MC/Hexagon/tied-ops.s
@@ -0,0 +1,6 @@
# RUN: llvm-mc -arch=hexagon -filetype=asm %s 2> %t; FileCheck %s < %t

# Check that tied operands are caught

{ r0 = sub(##_start, asl(r1, #1)) }
# CHECK: error: invalid operand for instruction

0 comments on commit 8d4a661

Please sign in to comment.