ARM: Make .unreq directives case-insensitive
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 7 Mar 2014 16:16:52 +0000 (16:16 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 7 Mar 2014 16:16:52 +0000 (16:16 +0000)
Be case-insensitive when processing .unreq directives.

Patch by Lin Zuojian!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203251 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/dot-req-case-insensitive.s [new file with mode: 0644]

index 7dc4d18a072401692f6c60ae3f7c159aa6be42b3..4b41a0dd0bb8ab481c236ebce7c263f0b59e9e9e 100644 (file)
@@ -8255,7 +8255,7 @@ bool ARMAsmParser::parseDirectiveUnreq(SMLoc L) {
     Error(L, "unexpected input in .unreq directive.");
     return false;
   }
-  RegisterReqs.erase(Parser.getTok().getIdentifier());
+  RegisterReqs.erase(Parser.getTok().getIdentifier().lower());
   Parser.Lex(); // Eat the identifier.
   return false;
 }
diff --git a/test/MC/ARM/dot-req-case-insensitive.s b/test/MC/ARM/dot-req-case-insensitive.s
new file mode 100644 (file)
index 0000000..c1ca566
--- /dev/null
@@ -0,0 +1,20 @@
+@ RUN: llvm-mc -triple=arm < %s | FileCheck %s
+ .syntax unified
+_foo:
+
+ OBJECT .req r2
+ mov r4, OBJECT
+ mov r4, oBjEcT
+ .unreq oBJECT
+
+_foo2:
+ OBJECT .req r5
+ mov r4, OBJECT
+ .unreq OBJECT
+
+@ CHECK-LABEL: _foo:
+@ CHECK: mov r4, r2
+@ CHECK: mov r4, r2
+
+@ CHECK-LABEL: _foo2:
+@ CHECK: mov r4, r5