patch for Bug 18833 - ARMAsmParser fails to recognize .req directive alias name in capital letters

Saleem Abdulrasool compnerd at compnerd.org
Mon Feb 17 20:59:05 PST 2014


On Mon, Feb 17, 2014 at 8:30 PM, lin zuojian <manjian2006 at gmail.com> wrote:

> patch v2:
>
> 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,14 @@
> +@ RUN: llvm-mc -triple=arm-linux-androideabi < %s | FileCheck %s
>

I think you should be able to relax the triple further to arm.  The
redirection is also unnecessary.

@ 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
>
> Your check statements are missing, so this test does nothing.  The tests
don't cover the unregistration code path that you just fixed up.


> 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;
> }
>
>
>
>
> 于 2014年02月18日 12:01, Duncan P. N. Exon Smith 写道:
> > On 2014 Feb 17, at 18:31, lin zuojian <manjian2006 at gmail.com> wrote:
> >
> >> And here is my test case.This test case has been posted in
> >>
> >> http://llvm.org/bugs/show_bug.cgi?id=18833
> >>
> >>
> >> cat 1.s
> >>  .thumb
> >> _foo:
> >>
> >>   OBJECT .req r2
> >>   mov r4, OBJECT
> >>   mov r4, oBjEcT
> >>   .unreq OBJECT
> >>
> >> _foo2:
> >>   OBJECT .req r5
> >>   mov r4, OBJECT
> >>   .unreq OBJECT
> >>
> >>
> >> bin/clang -target arm-linux-androideabi -march=armv7-a -c 1.s
> >> 1.s:12:15: error: redefinition of 'object' does not match original.
> >>   OBJECT .req r5
> > Great!  Now reduce that to a testcase against llvm-mc (or whatever
> fails), add a
> > RUN line and appropriate CHECK lines, and resubmit your patch with the
> testcase
> > included.  There are lots of examples in test/MC/ARM/, and lots of
> documentation
> > on the test infrastructure, e.g., here:
> >
> > http://llvm.org/docs/TestingGuide.html#regression-test-structure
> >
> > Be sure that the test fails (i.e., "make check" fails) without your
> change, and
> > passes with your change.
> >
> > Duncan
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



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


More information about the llvm-commits mailing list