summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSid Manning <sidneym@codeaurora.org>2018-08-13 14:01:25 +0000
committerSid Manning <sidneym@codeaurora.org>2018-08-13 14:01:25 +0000
commit8d4a6615e17fec9555e44f5ece87fc75900e25d2 (patch)
tree909a02c140d06b9165842a242547502a24ebbf95
parent4b3a8bd91e1c0a4bb9309ff2928c623ef4e74ad8 (diff)
downloadbcm5719-llvm-8d4a6615e17fec9555e44f5ece87fc75900e25d2.tar.gz
bcm5719-llvm-8d4a6615e17fec9555e44f5ece87fc75900e25d2.zip
Check for tied operands
Differential Revision: https://reviews.llvm.org/D50592 llvm-svn: 339567
-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