summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp1
-rw-r--r--llvm/test/MC/Hexagon/tied-ops.s6
2 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
index 92bda224f3d..dcab9bfb019 100644
--- a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
+++ b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
@@ -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())
diff --git a/llvm/test/MC/Hexagon/tied-ops.s b/llvm/test/MC/Hexagon/tied-ops.s
new file mode 100644
index 00000000000..a18e9e475c2
--- /dev/null
+++ b/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
OpenPOWER on IntegriCloud