summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp2
-rw-r--r--llvm/test/MC/ARM/invalid-special-reg.s11
2 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index dae8618fa07..c7d0709a1a7 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -4330,7 +4330,7 @@ ARMAsmParser::parseMSRMaskOperand(OperandVector &Operands) {
// If some specific flag is already set, it means that some letter is
// present more than once, this is not acceptable.
- if (FlagsVal == ~0U || (FlagsVal & Flag))
+ if (Flag == ~0U || (FlagsVal & Flag))
return MatchOperand_NoMatch;
FlagsVal |= Flag;
}
diff --git a/llvm/test/MC/ARM/invalid-special-reg.s b/llvm/test/MC/ARM/invalid-special-reg.s
new file mode 100644
index 00000000000..7a192e7d335
--- /dev/null
+++ b/llvm/test/MC/ARM/invalid-special-reg.s
@@ -0,0 +1,11 @@
+@ RUN: not llvm-mc -triple armv7a--none-eabi < %s |& FileCheck %s
+@ RUN: not llvm-mc -triple thumbv7a--none-eabi < %s |& FileCheck %s
+
+ msr apsr_c, r0
+@ CHECK: invalid operand for instruction
+ msr cpsr_w
+@ CHECK: invalid operand for instruction
+ msr cpsr_cc
+@ CHECK: invalid operand for instruction
+ msr xpsr_c
+@ CHECK: invalid operand for instruction
OpenPOWER on IntegriCloud