Index: lib/Target/ARM/AsmParser/ARMAsmParser.cpp =================================================================== --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -4330,7 +4330,7 @@ // 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; } Index: test/MC/ARM/invalid-special-reg.s =================================================================== --- /dev/null +++ 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