OSDN Git Service

Teach assembler to handle capitalised operation values for DSB instructions
authorRichard Barton <richard.barton@arm.com>
Wed, 27 Jun 2012 09:48:23 +0000 (09:48 +0000)
committerRichard Barton <richard.barton@arm.com>
Wed, 27 Jun 2012 09:48:23 +0000 (09:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159259 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/basic-arm-instructions.s

index 830e9c0..68f1281 100644 (file)
@@ -3260,7 +3260,7 @@ parseMemBarrierOptOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
     return MatchOperand_NoMatch;
   StringRef OptStr = Tok.getString();
 
-  unsigned Opt = StringSwitch<unsigned>(OptStr.slice(0, OptStr.size()))
+  unsigned Opt = StringSwitch<unsigned>(OptStr.slice(0, OptStr.size()).lower())
     .Case("sy",    ARM_MB::SY)
     .Case("st",    ARM_MB::ST)
     .Case("sh",    ARM_MB::ISH)
index 0920d71..c62413d 100644 (file)
@@ -601,6 +601,12 @@ Lforward:
 @ CHECK: dsb   oshst                   @ encoding: [0x42,0xf0,0x7f,0xf5]
 @ CHECK: dsb   sy                      @ encoding: [0x4f,0xf0,0x7f,0xf5]
 
+@ With capitals
+        dsb SY
+        dsb OSHST
+
+@ CHECK: dsb   sy                      @ encoding: [0x4f,0xf0,0x7f,0xf5]
+@ CHECK: dsb   oshst                   @ encoding: [0x42,0xf0,0x7f,0xf5]
 @------------------------------------------------------------------------------
 @ EOR
 @------------------------------------------------------------------------------