[llvm] r220294 - Add support for addmod to mri scripts.
Sean Silva
chisophugis at gmail.com
Tue Oct 21 16:09:23 PDT 2014
On Tue, Oct 21, 2014 at 7:46 AM, Rafael Espindola <
rafael.espindola at gmail.com> wrote:
> Author: rafael
> Date: Tue Oct 21 09:46:17 2014
> New Revision: 220294
>
> URL: http://llvm.org/viewvc/llvm-project?rev=220294&view=rev
> Log:
> Add support for addmod to mri scripts.
>
> Added:
> llvm/trunk/test/Object/mri-addmod.test
> Modified:
> llvm/trunk/tools/llvm-ar/llvm-ar.cpp
>
> Added: llvm/trunk/test/Object/mri-addmod.test
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/mri-addmod.test?rev=220294&view=auto
>
> ==============================================================================
> --- llvm/trunk/test/Object/mri-addmod.test (added)
> +++ llvm/trunk/test/Object/mri-addmod.test Tue Oct 21 09:46:17 2014
> @@ -0,0 +1,18 @@
> +; RUN: echo create %t.a > %t.mri
> +; RUN: echo addmod %p/Inputs/trivial-object-test.elf-x86-64 >> %t.mri
> +; RUN: echo save >> %t.mri
> +; RUN: echo end >> %t.mri
>
Would it be possible to use relative paths here and have the MRI script be
the one with the RUN lines? That would be a lot cleaner and avoid the
`REQUIRES: shell`.
-- Sean Silva
> +
> +; RUN: llvm-ar -M < %t.mri
> +; RUN: llvm-nm -M %t.a | FileCheck %s
> +
> +; CHECK: Archive map
> +; CHECK-NEXT: main in trivial-object-test.elf-x86-64
> +
> +; CHECK: trivial-object-test.elf-x86-64:
> +; CHECK-NEXT: U SomeOtherFunction
> +; CHECK-NEXT: 0000000000000000 T main
> +; CHECK-NEXT: U puts
> +
> +; line_iterator is incompatible to CRLF.
> +; REQUIRES: shell
>
> Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=220294&r1=220293&r2=220294&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
> +++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Tue Oct 21 09:46:17 2014
> @@ -178,7 +178,7 @@ static void getMembers() {
> }
>
> namespace {
> -enum class MRICommand { Create, Save, End, Invalid };
> +enum class MRICommand { AddMod, Create, Save, End, Invalid };
> }
>
> static ArchiveOperation parseMRIScript() {
> @@ -192,12 +192,16 @@ static ArchiveOperation parseMRIScript()
> StringRef CommandStr, Rest;
> std::tie(CommandStr, Rest) = Line.split(' ');
> auto Command = StringSwitch<MRICommand>(CommandStr.lower())
> + .Case("addmod", MRICommand::AddMod)
> .Case("create", MRICommand::Create)
> .Case("save", MRICommand::Save)
> .Case("end", MRICommand::End)
> .Default(MRICommand::Invalid);
>
> switch (Command) {
> + case MRICommand::AddMod:
> + Members.push_back(Rest);
> + break;
> case MRICommand::Create:
> Create = true;
> if (!ArchiveName.empty())
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141021/150c4aee/attachment.html>
More information about the llvm-commits
mailing list