forked from OSchip/llvm-project
[mach-o] Add support for -mllvm to darwin driver
llvm-svn: 191594
This commit is contained in:
parent
209b17cdaa
commit
0932c004a9
|
@ -245,6 +245,13 @@ bool DarwinLdDriver::parse(int argc, const char *argv[],
|
|||
}
|
||||
}
|
||||
|
||||
// Handle -mllvm
|
||||
for (llvm::opt::arg_iterator it = parsedArgs->filtered_begin(OPT_mllvm),
|
||||
ie = parsedArgs->filtered_end();
|
||||
it != ie; ++it) {
|
||||
ctx.appendLLVMOption((*it)->getValue());
|
||||
}
|
||||
|
||||
std::unique_ptr<InputGraph> inputGraph(new InputGraph());
|
||||
|
||||
// Handle input files
|
||||
|
|
|
@ -222,4 +222,13 @@ TEST_F(DarwinLdParserTest, deadStrippableDylibInvalidType) {
|
|||
EXPECT_FALSE(parse("ld", "-mark_dead_strippable_dylib", "a.o", nullptr));
|
||||
}
|
||||
|
||||
TEST_F(DarwinLdParserTest, llvmOptions) {
|
||||
EXPECT_TRUE(parse("ld", "-mllvm", "-debug-only", "-mllvm", "foo", "a.o", nullptr));
|
||||
const std::vector<const char *> &options = _context.llvmOptions();
|
||||
EXPECT_EQ(options.size(), 2UL);
|
||||
EXPECT_EQ(strcmp(options[0],"-debug-only"), 0);
|
||||
EXPECT_EQ(strcmp(options[1],"foo"), 0);
|
||||
}
|
||||
|
||||
|
||||
} // end anonymous namespace
|
||||
|
|
Loading…
Reference in New Issue