--- /dev/null
+// RUN: not %clang_cc1 %s -cake-is-lie 2> %t.log
+// RUN: FileCheck %s -input-file=%t.log
+
+// CHECK: unknown argument
bool Success;
Success = CompilerInvocation::CreateFromArgs(Clang->getInvocation(),
ArgBegin, ArgEnd, Diags);
- if (!Success)
- return 1;
// Infer the builtin include path if unspecified.
if (Clang->getHeaderSearchOpts().UseBuiltinIncludes &&
static_cast<void*>(&Clang->getDiagnostics()));
DiagsBuffer->FlushDiagnostics(Clang->getDiagnostics());
+ if (!Success)
+ return 1;
// Execute the frontend actions.
Success = ExecuteCompilerInvocation(Clang.get());