[PATCH v4] Bug 18833 - ARMAsmParser fails to recognize .req directive alias name in capital letters

Saleem Abdulrasool compnerd at compnerd.org
Tue Feb 18 17:59:48 PST 2014


On Tue, Feb 18, 2014 at 5:43 PM, lin zuojian <manjian2006 at gmail.com> wrote:

> Okay,I think this patch is able to test the unreq behaviour for case
> insensitivity
>
> Index: test/MC/ARM/dot-req-capital.s
> ===================================================================
> --- test/MC/ARM/dot-req-capital.s (revision 0)
> +++ test/MC/ARM/dot-req-capital.s (working copy)
> @@ -0,0 +1,28 @@
> +@ 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
> +
> +_foo3:
> + OBJECT .req r6
> + mov r4, OBJECT
> + .unreq OBJECT
> +
> +@ CHECK-LABEL: _foo:
> +@ CHECK: mov r4, r2
> +@ CHECK: mov r4, r2
> +
> +@ CHECK-LABEL: _foo2:
> +@ CHECK: mov r4, r5
> +
> +@ CHECK-LABEL: _foo3:
> +@ CHECK: mov r4, r6
>

Minor point: I think that moving the unreq from _foo2 to _foo would result
in a much more compact test case.  Its unclear what the the three cases add
as compared to the single case.  It might also be nice to call the test
req_case_insensitivity (as it describes what you are really testing).


> Index: lib/Target/ARM/AsmParser/ARMAsmParser.cpp
> ===================================================================
> --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp (revision 201500)
> +++ lib/Target/ARM/AsmParser/ARMAsmParser.cpp (working copy)
> @@ -8243,7 +8243,7 @@
> 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;
> }
>

LGTM.


> --
> lin zuojian


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140218/3d5354f1/attachment.html>


More information about the llvm-commits mailing list