#include "clang/Driver/Options.inc"
#undef SIMPLE_ENUM_VALUE_TABLE
-static llvm::Optional<bool> normalizeSimpleFlag(OptSpecifier Opt,
- unsigned TableIndex,
- const ArgList &Args,
- DiagnosticsEngine &Diags) {
+static llvm::Optional<bool>
+normalizeSimpleFlag(OptSpecifier Opt, unsigned TableIndex, const ArgList &Args,
+ DiagnosticsEngine &Diags, bool &Success) {
if (Args.hasArg(Opt))
return true;
return None;
static Optional<bool> normalizeSimpleNegativeFlag(OptSpecifier Opt, unsigned,
const ArgList &Args,
- DiagnosticsEngine &) {
+ DiagnosticsEngine &,
+ bool &Success) {
if (Args.hasArg(Opt))
return false;
return None;
std::enable_if_t<!is_uint64_t_convertible<T>(), bool> = false>
static auto makeFlagToValueNormalizer(T Value) {
return [Value](OptSpecifier Opt, unsigned, const ArgList &Args,
- DiagnosticsEngine &) -> Optional<T> {
+ DiagnosticsEngine &, bool &Success) -> Optional<T> {
if (Args.hasArg(Opt))
return Value;
return None;
static auto makeBooleanOptionNormalizer(bool Value, bool OtherValue,
OptSpecifier OtherOpt) {
return [Value, OtherValue, OtherOpt](OptSpecifier Opt, unsigned,
- const ArgList &Args,
- DiagnosticsEngine &) -> Optional<bool> {
+ const ArgList &Args, DiagnosticsEngine &,
+ bool &Success) -> Optional<bool> {
if (const Arg *A = Args.getLastArg(Opt, OtherOpt)) {
return A->getOption().matches(Opt) ? Value : OtherValue;
}
return None;
}
-static llvm::Optional<unsigned> normalizeSimpleEnum(OptSpecifier Opt,
- unsigned TableIndex,
- const ArgList &Args,
- DiagnosticsEngine &Diags) {
+static llvm::Optional<unsigned>
+normalizeSimpleEnum(OptSpecifier Opt, unsigned TableIndex, const ArgList &Args,
+ DiagnosticsEngine &Diags, bool &Success) {
assert(TableIndex < SimpleEnumValueTablesSize);
const SimpleEnumValueTable &Table = SimpleEnumValueTables[TableIndex];
if (auto MaybeEnumVal = findValueTableByName(Table, ArgValue))
return MaybeEnumVal->Value;
+ Success = false;
Diags.Report(diag::err_drv_invalid_value)
<< Arg->getAsString(Args) << ArgValue;
return None;
static Optional<std::string> normalizeString(OptSpecifier Opt, int TableIndex,
const ArgList &Args,
- DiagnosticsEngine &Diags) {
+ DiagnosticsEngine &Diags,
+ bool &Success) {
auto *Arg = Args.getLastArg(Opt);
if (!Arg)
return None;
}
template <typename IntTy>
-static Optional<IntTy> normalizeStringIntegral(OptSpecifier Opt, int,
- const ArgList &Args,
- DiagnosticsEngine &Diags) {
+static Optional<IntTy>
+normalizeStringIntegral(OptSpecifier Opt, int, const ArgList &Args,
+ DiagnosticsEngine &Diags, bool &Success) {
auto *Arg = Args.getLastArg(Opt);
if (!Arg)
return None;
IntTy Res;
if (StringRef(Arg->getValue()).getAsInteger(0, Res)) {
+ Success = false;
Diags.Report(diag::err_drv_invalid_int_value)
<< Arg->getAsString(Args) << Arg->getValue();
}
static Optional<std::vector<std::string>>
normalizeStringVector(OptSpecifier Opt, int, const ArgList &Args,
- DiagnosticsEngine &) {
+ DiagnosticsEngine &, bool &Success) {
return Args.getAllArgValues(Opt);
}
static Optional<std::string> normalizeTriple(OptSpecifier Opt, int TableIndex,
const ArgList &Args,
- DiagnosticsEngine &Diags) {
+ DiagnosticsEngine &Diags,
+ bool &Success) {
auto *Arg = Args.getLastArg(Opt);
if (!Arg)
return None;
bool CompilerInvocation::parseSimpleArgs(const ArgList &Args,
DiagnosticsEngine &Diags) {
+ bool Success = true;
+
#define OPTION_WITH_MARSHALLING( \
PREFIX_TYPE, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
HELPTEXT, METAVAR, VALUES, SPELLING, SHOULD_PARSE, ALWAYS_EMIT, KEYPATH, \
if (IMPLIED_CHECK) \
this->KEYPATH = MERGER(this->KEYPATH, IMPLIED_VALUE); \
if (SHOULD_PARSE) \
- if (auto MaybeValue = NORMALIZER(OPT_##ID, TABLE_INDEX, Args, Diags)) \
+ if (auto MaybeValue = \
+ NORMALIZER(OPT_##ID, TABLE_INDEX, Args, Diags, Success)) \
this->KEYPATH = MERGER( \
this->KEYPATH, static_cast<decltype(this->KEYPATH)>(*MaybeValue)); \
}
#include "clang/Driver/Options.inc"
#undef OPTION_WITH_MARSHALLING
- return true;
+
+ return Success;
}
bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagNotPresent) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getFrontendOpts().UseTemporary);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagPresent) {
const char *Args[] = {"-fno-temp-file"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getFrontendOpts().UseTemporary);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagUnknownPresent) {
const char *Args[] = {"-ftemp-file"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
// Driver-only flag.
- ASSERT_TRUE(Diags->hasErrorOccurred());
+ ASSERT_FALSE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getFrontendOpts().UseTemporary);
}
TEST_F(CommandLineTest, BoolOptionDefaultTruePresentNone) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getCodeGenOpts().Autolink);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultTruePresentNegChange) {
const char *Args[] = {"-fno-autolink"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getCodeGenOpts().Autolink);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultTruePresentPosReset) {
const char *Args[] = {"-fautolink"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_TRUE(Diags->hasErrorOccurred()); // Driver-only flag.
+ // Driver-only flag.
+ ASSERT_FALSE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getCodeGenOpts().Autolink);
}
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNone) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getCodeGenOpts().NoInlineLineTables);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNegChange) {
const char *Args[] = {"-gno-inline-line-tables"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getCodeGenOpts().NoInlineLineTables);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentPosReset) {
const char *Args[] = {"-ginline-line-tables"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_TRUE(Diags->hasErrorOccurred()); // Driver-only flag.
+ // Driver-only flag.
+ ASSERT_FALSE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getCodeGenOpts().NoInlineLineTables);
}
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNoneX) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getCodeGenOpts().CodeViewGHash);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentPosChange) {
const char *Args[] = {"-gcodeview-ghash"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getCodeGenOpts().CodeViewGHash);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNegReset) {
const char *Args[] = {"-gno-codeview-ghash"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_TRUE(Diags->hasErrorOccurred()); // Driver-only flag.
+ // Driver-only flag.
+ ASSERT_FALSE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getCodeGenOpts().CodeViewGHash);
}
TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentNone) {
const char *Args = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getCodeGenOpts().LegacyPassManager, PassManagerDefault);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentChange) {
const char *Args[] = {PassManagerChangedByFlag};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getCodeGenOpts().LegacyPassManager, !PassManagerDefault);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentReset) {
const char *Args[] = {PassManagerResetByFlag};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getCodeGenOpts().LegacyPassManager, PassManagerDefault);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionCC1ViaLetPresentNone) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getCodeGenOpts().DebugPassManager);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionCC1ViaLetPresentPos) {
const char *Args[] = {"-fdebug-pass-manager"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getCodeGenOpts().DebugPassManager);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, BoolOptionCC1ViaLetPresentNeg) {
const char *Args[] = {"-fno-debug-pass-manager"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getCodeGenOpts().DebugPassManager);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, CanGenerateCC1CommandLineFlag) {
const char *Args[] = {"-fmodules-strict-context-hash"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
const char *TripleCStr = "i686-apple-darwin9";
const char *Args[] = {"-triple", TripleCStr};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple());
const char *Args[] = {"-triple", DefaultTriple.c_str()};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple());
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, SeparateEnumNonDefault) {
const char *Args[] = {"-mrelocation-model", "static"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getCodeGenOpts().RelocationModel, Reloc::Model::Static);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, SeparateEnumDefault) {
const char *Args[] = {"-mrelocation-model", "pic"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getCodeGenOpts().RelocationModel, Reloc::Model::PIC_);
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, JoinedEnumNonDefault) {
const char *Args[] = {"-fobjc-dispatch-method=non-legacy"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getCodeGenOpts().getObjCDispatchMethod(),
CodeGenOptions::NonLegacy);
TEST_F(CommandLineTest, JoinedEnumDefault) {
const char *Args[] = {"-fobjc-dispatch-method=legacy"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getCodeGenOpts().getObjCDispatchMethod(),
CodeGenOptions::Legacy);
TEST_F(CommandLineTest, StringVectorEmpty) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getFrontendOpts().ModuleMapFiles.empty());
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, StringVectorSingle) {
const char *Args[] = {"-fmodule-map-file=a"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getFrontendOpts().ModuleMapFiles,
std::vector<std::string>({"a"}));
TEST_F(CommandLineTest, StringVectorMultiple) {
const char *Args[] = {"-fmodule-map-file=a", "-fmodule-map-file=b"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getFrontendOpts().ModuleMapFiles ==
std::vector<std::string>({"a", "b"}));
TEST_F(CommandLineTest, StringVectorCommaJoinedNone) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getLangOpts()->CommentOpts.BlockCommandNames.empty());
Invocation.generateCC1CommandLine(GeneratedArgs, *this);
TEST_F(CommandLineTest, StringVectorCommaJoinedSingle) {
const char *Args[] = {"-fcomment-block-commands=x,y"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getLangOpts()->CommentOpts.BlockCommandNames,
std::vector<std::string>({"x", "y"}));
const char *Args[] = {"-fcomment-block-commands=x,y",
"-fcomment-block-commands=a,b"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_EQ(Invocation.getLangOpts()->CommentOpts.BlockCommandNames,
std::vector<std::string>({"x", "y", "a", "b"}));
TEST_F(CommandLineTest, ImpliedBoolOptionsNoFlagPresent) {
const char *Args[] = {""};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getLangOpts()->CLUnsafeMath);
ASSERT_FALSE(Invocation.getCodeGenOpts().LessPreciseFPMAD);
ASSERT_FALSE(Invocation.getLangOpts()->UnsafeFPMath);
TEST_F(CommandLineTest, ImpliedBoolOptionsRootFlagPresent) {
const char *Args[] = {"-cl-unsafe-math-optimizations"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
// Explicitly provided root flag.
ASSERT_TRUE(Invocation.getLangOpts()->CLUnsafeMath);
// Directly implied by explicitly provided root flag.
const char *Args[] = {"-cl-unsafe-math-optimizations", "-cl-mad-enable",
"-menable-unsafe-fp-math", "-freciprocal-math"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_TRUE(Invocation.getLangOpts()->CLUnsafeMath);
ASSERT_TRUE(Invocation.getCodeGenOpts().LessPreciseFPMAD);
ASSERT_TRUE(Invocation.getLangOpts()->UnsafeFPMath);
const char *Args[] = {"-cl-mad-enable", "-menable-unsafe-fp-math",
"-freciprocal-math"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
ASSERT_FALSE(Invocation.getLangOpts()->CLUnsafeMath);
ASSERT_TRUE(Invocation.getCodeGenOpts().LessPreciseFPMAD);
ASSERT_TRUE(Invocation.getLangOpts()->UnsafeFPMath);
TEST_F(CommandLineTest, PresentAndNotImpliedGenerated) {
const char *Args[] = {"-cl-mad-enable", "-menable-unsafe-fp-math"};
- CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
-
- ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
Invocation.generateCC1CommandLine(GeneratedArgs, *this);