This parsing code was incorrectly checking for invalid characters, so an
invalid instruction like:
msr spsr_w, r0
would be emitted as:
msr spsr_cxsf, r0
Differential revision: https://reviews.llvm.org/D30462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296607
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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;
}
--- /dev/null
+@ 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