mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 02:24:29 +00:00
[dsymutil] Support multiple input files on the command line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243777 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
12
test/tools/dsymutil/X86/multiple-inputs.test
Normal file
12
test/tools/dsymutil/X86/multiple-inputs.test
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
REQUIRES: shell
|
||||||
|
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
|
||||||
|
RUN: cat %p/../Inputs/basic-archive.macho.x86_64 > %t2
|
||||||
|
RUN: cat %p/../Inputs/basic-lto.macho.x86_64 > %t3
|
||||||
|
RUN: cat %p/../Inputs/basic-lto-dw4.macho.x86_64 > %t4
|
||||||
|
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1 %t2 %t3 %t4
|
||||||
|
RUN: llvm-dwarfdump %t1.dwarf \
|
||||||
|
| FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=BASIC
|
||||||
|
RUN: llvm-dwarfdump %t2.dwarf \
|
||||||
|
| FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=ARCHIVE
|
||||||
|
RUN: llvm-dwarfdump %t3.dwarf | FileCheck %S/basic-lto-linking-x86.test
|
||||||
|
RUN: llvm-dwarfdump %t4.dwarf | FileCheck %S/basic-lto-dw4-linking-x86.test
|
@ -1,6 +1,7 @@
|
|||||||
RUN: llvm-dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
|
RUN: llvm-dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
|
||||||
RUN: llvm-dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
|
RUN: llvm-dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
|
||||||
RUN: llvm-dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
|
RUN: llvm-dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
|
||||||
|
RUN: llvm-dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 %p/Inputs/basic-lto.macho.x86_64 %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-LTO --check-prefix=CHECK-ARCHIVE
|
||||||
|
|
||||||
This test check the basic Dwarf linking process through the debug dumps.
|
This test check the basic Dwarf linking process through the debug dumps.
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ OptionCategory DsymCategory("Specific Options");
|
|||||||
static opt<bool> Help("h", desc("Alias for -help"), Hidden);
|
static opt<bool> Help("h", desc("Alias for -help"), Hidden);
|
||||||
static opt<bool> Version("v", desc("Alias for -version"), Hidden);
|
static opt<bool> Version("v", desc("Alias for -version"), Hidden);
|
||||||
|
|
||||||
static opt<std::string> InputFile(Positional, desc("<input file>"),
|
static list<std::string> InputFiles(Positional, OneOrMore,
|
||||||
init("a.out"), cat(DsymCategory));
|
desc("<input files>"), cat(DsymCategory));
|
||||||
|
|
||||||
static opt<std::string>
|
static opt<std::string>
|
||||||
OutputFileOpt("o",
|
OutputFileOpt("o",
|
||||||
@ -90,9 +90,6 @@ int main(int argc, char **argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto DebugMapPtrOrErr =
|
|
||||||
parseDebugMap(InputFile, OsoPrependPath, Verbose, InputIsYAMLDebugMap);
|
|
||||||
|
|
||||||
Options.Verbose = Verbose;
|
Options.Verbose = Verbose;
|
||||||
Options.NoOutput = NoOutput;
|
Options.NoOutput = NoOutput;
|
||||||
Options.NoODR = NoODR;
|
Options.NoODR = NoODR;
|
||||||
@ -102,27 +99,40 @@ int main(int argc, char **argv) {
|
|||||||
llvm::InitializeAllTargets();
|
llvm::InitializeAllTargets();
|
||||||
llvm::InitializeAllAsmPrinters();
|
llvm::InitializeAllAsmPrinters();
|
||||||
|
|
||||||
if (auto EC = DebugMapPtrOrErr.getError()) {
|
if (InputFiles.size() > 1 && !OutputFileOpt.empty()) {
|
||||||
llvm::errs() << "error: cannot parse the debug map for \"" << InputFile
|
llvm::errs() << "error: cannot use -o with multiple inputs\n";
|
||||||
<< "\": " << EC.message() << '\n';
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Verbose || DumpDebugMap)
|
for (auto &InputFile : InputFiles) {
|
||||||
(*DebugMapPtrOrErr)->print(llvm::outs());
|
auto DebugMapPtrOrErr =
|
||||||
|
parseDebugMap(InputFile, OsoPrependPath, Verbose, InputIsYAMLDebugMap);
|
||||||
|
|
||||||
if (DumpDebugMap)
|
if (auto EC = DebugMapPtrOrErr.getError()) {
|
||||||
return 0;
|
llvm::errs() << "error: cannot parse the debug map for \"" << InputFile
|
||||||
|
<< "\": " << EC.message() << '\n';
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
std::string OutputFile;
|
if (Verbose || DumpDebugMap)
|
||||||
if (OutputFileOpt.empty()) {
|
(*DebugMapPtrOrErr)->print(llvm::outs());
|
||||||
if (InputFile == "-")
|
|
||||||
OutputFile = "a.out.dwarf";
|
if (DumpDebugMap)
|
||||||
else
|
continue;
|
||||||
OutputFile = InputFile + ".dwarf";
|
|
||||||
} else {
|
std::string OutputFile;
|
||||||
OutputFile = OutputFileOpt;
|
if (OutputFileOpt.empty()) {
|
||||||
|
if (InputFile == "-")
|
||||||
|
OutputFile = "a.out.dwarf";
|
||||||
|
else
|
||||||
|
OutputFile = InputFile + ".dwarf";
|
||||||
|
} else {
|
||||||
|
OutputFile = OutputFileOpt;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!linkDwarf(OutputFile, **DebugMapPtrOrErr, Options))
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !linkDwarf(OutputFile, **DebugMapPtrOrErr, Options);
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user