forked from OSchip/llvm-project
Re-submit r338596 with a bug fix and a test.
llvm-svn: 338647
This commit is contained in:
parent
842bdd0071
commit
5530f234f5
|
@ -497,14 +497,11 @@ static Target2Policy getTarget2(opt::InputArgList &Args) {
|
|||
}
|
||||
|
||||
static bool isOutputFormatBinary(opt::InputArgList &Args) {
|
||||
if (auto *Arg = Args.getLastArg(OPT_oformat)) {
|
||||
StringRef S = Arg->getValue();
|
||||
if (S == "binary")
|
||||
return true;
|
||||
if (S.startswith("elf"))
|
||||
return false;
|
||||
StringRef S = Args.getLastArgValue(OPT_oformat, "elf");
|
||||
if (S == "binary")
|
||||
return true;
|
||||
if (!S.startswith("elf"))
|
||||
error("unknown --oformat value: " + S);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
# ERR: unknown --oformat value: foo
|
||||
|
||||
# RUN: ld.lld -o /dev/null %t --oformat elf
|
||||
# RUN: ld.lld -o /dev/null %t --oformat elf-foo
|
||||
|
||||
.text
|
||||
.align 4
|
||||
|
|
Loading…
Reference in New Issue