mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Add support for addmod to mri scripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220294 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
41454cc88b
commit
2afb0e4d2c
18
test/Object/mri-addmod.test
Normal file
18
test/Object/mri-addmod.test
Normal file
@ -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
|
||||
|
||||
; 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
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user