diff options
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 2 | ||||
-rw-r--r-- | test/MC/ARM/basic-thumb-instructions.s | 20 | ||||
-rw-r--r-- | test/MC/ARM/thumb-diagnostics.s | 11 |
3 files changed, 32 insertions, 1 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index fcca436ac5..74d34e1443 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -2693,7 +2693,7 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic, // Next, determine if we have a carry setting bit. We explicitly ignore all // the instructions we know end in 's'. if (Mnemonic.endswith("s") && - !(Mnemonic == "asrs" || Mnemonic == "cps" || Mnemonic == "mls" || + !(Mnemonic == "cps" || Mnemonic == "mls" || Mnemonic == "mrs" || Mnemonic == "smmls" || Mnemonic == "vabs" || Mnemonic == "vcls" || Mnemonic == "vmls" || Mnemonic == "vmrs" || Mnemonic == "vnmls" || Mnemonic == "vqabs" || Mnemonic == "vrecps" || diff --git a/test/MC/ARM/basic-thumb-instructions.s b/test/MC/ARM/basic-thumb-instructions.s index 340743ed09..7899a550f2 100644 --- a/test/MC/ARM/basic-thumb-instructions.s +++ b/test/MC/ARM/basic-thumb-instructions.s @@ -56,3 +56,23 @@ _func: @ CHECK: adr r2, _baz @ encoding: [A,0xa2] @ fixup A - offset: 0, value: _baz, kind: fixup_thumb_adr_pcrel_10 + + +@------------------------------------------------------------------------------ +@ ASR (immediate) +@------------------------------------------------------------------------------ + asrs r2, r3, #32 + asrs r2, r3, #5 + asrs r2, r3, #1 + +@ CHECK: asrs r2, r3, #32 @ encoding: [0x1a,0x10] +@ CHECK: asrs r2, r3, #5 @ encoding: [0x5a,0x11] +@ CHECK: asrs r2, r3, #1 @ encoding: [0x5a,0x10] + + +@------------------------------------------------------------------------------ +@ ASR (register) +@------------------------------------------------------------------------------ + asrs r5, r2 + +@ CHECK: asrs r5, r2 @ encoding: [0x15,0x41] diff --git a/test/MC/ARM/thumb-diagnostics.s b/test/MC/ARM/thumb-diagnostics.s index a08a94689b..8d8edcbfed 100644 --- a/test/MC/ARM/thumb-diagnostics.s +++ b/test/MC/ARM/thumb-diagnostics.s @@ -18,3 +18,14 @@ @ CHECK-ERRORS: error: instruction variant requires ARMv6 or later @ CHECK-ERRORS: mov r2, r3 @ CHECK-ERRORS: ^ + + +@ Out of range immediates for ASR instruction. + asrs r2, r3, #33 + asrs r2, r3, #0 +@ CHECK-ERRORS: error: invalid operand for instruction +@ CHECK-ERRORS: asrs r2, r3, #33 +@ CHECK-ERRORS: ^ +@ CHECK-ERRORS: error: invalid operand for instruction +@ CHECK-ERRORS: asrs r2, r3, #0 +@ CHECK-ERRORS: ^ |