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) {
|
static bool isOutputFormatBinary(opt::InputArgList &Args) {
|
||||||
if (auto *Arg = Args.getLastArg(OPT_oformat)) {
|
StringRef S = Args.getLastArgValue(OPT_oformat, "elf");
|
||||||
StringRef S = Arg->getValue();
|
if (S == "binary")
|
||||||
if (S == "binary")
|
return true;
|
||||||
return true;
|
if (!S.startswith("elf"))
|
||||||
if (S.startswith("elf"))
|
|
||||||
return false;
|
|
||||||
error("unknown --oformat value: " + S);
|
error("unknown --oformat value: " + S);
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
# ERR: unknown --oformat value: foo
|
# ERR: unknown --oformat value: foo
|
||||||
|
|
||||||
# RUN: ld.lld -o /dev/null %t --oformat elf
|
# RUN: ld.lld -o /dev/null %t --oformat elf
|
||||||
|
# RUN: ld.lld -o /dev/null %t --oformat elf-foo
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.align 4
|
.align 4
|
||||||
|
|
Loading…
Reference in New Issue