diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-10-27 22:10:13 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-10-27 22:10:13 +0000 |
commit | 276373df8cb30dde91000d1b3d9dccc6c25aedef (patch) | |
tree | f6161a57e47ae25c834a3757f06103343cd08628 | |
parent | 879c3eaab724689f4e8a05563192ddb52b6208ad (diff) |
With -verify, only exit early on failure.
- Nice if -verify test exercise the various cleanup functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58285 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/clang.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index ca0dc44438..ac5a4b281a 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -1321,7 +1321,8 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF, ParseAST(PP, Consumer.get(), Stats, !DisableFree); if (VerifyDiagnostics) - exit(CheckDiagnostics(PP)); + if (CheckDiagnostics(PP)) + exit(1); if (Stats) { fprintf(stderr, "\nSTATISTICS FOR '%s':\n", InFile.c_str()); @@ -1529,5 +1530,9 @@ int main(int argc, char **argv) { fprintf(stderr, "\n"); } + // If verifying diagnostics and we reached here, all is well. + if (VerifyDiagnostics) + return 0; + return HadErrors || (Diags.getNumErrors() != 0); } |