forked from OSchip/llvm-project
[mach-o] Fix so no options causes usage message to be printed
llvm-svn: 217409
This commit is contained in:
parent
b7035ae367
commit
4ce63c2a54
|
@ -253,7 +253,11 @@ bool DarwinLdDriver::parse(int argc, const char *argv[],
|
|||
break;
|
||||
}
|
||||
if (arch == MachOLinkingContext::arch_unknown) {
|
||||
diagnostics << "error: -arch not specified and could not be inferred\n";
|
||||
// If no -arch and no options at all, print usage message.
|
||||
if (parsedArgs->size() == 0)
|
||||
table.PrintHelp(llvm::outs(), argv[0], "LLVM Linker", false);
|
||||
else
|
||||
diagnostics << "error: -arch not specified and could not be inferred\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -635,10 +639,6 @@ bool DarwinLdDriver::parse(int argc, const char *argv[],
|
|||
}
|
||||
|
||||
if (!inputGraph->size()) {
|
||||
if (parsedArgs->size() == 0) {
|
||||
table.PrintHelp(llvm::outs(), "lld", "LLVM Linker", false);
|
||||
return false;
|
||||
}
|
||||
diagnostics << "No input files\n";
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# RUN: not lld -flavor darwin | FileCheck %s
|
||||
#
|
||||
# Test that running darwin linker with no option prints out usage message.
|
||||
#
|
||||
|
||||
|
||||
# CHECK: USAGE:
|
||||
# CHECK: -arch
|
Loading…
Reference in New Issue