Add support for static analysis to clang-check
Summary:
This adds a command line argument '-analyze' to clang-check which runs the
clang static analyzer on the source files.
Reviewers: klimek
CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D926
llvm-svn: 183399
diff --git a/clang/test/Tooling/clang-check-analyzer.cpp b/clang/test/Tooling/clang-check-analyzer.cpp
new file mode 100644
index 0000000..16cf7ce
--- /dev/null
+++ b/clang/test/Tooling/clang-check-analyzer.cpp
@@ -0,0 +1,4 @@
+// RUN: clang-check -analyze "%s" -- -c 2>&1 | FileCheck %s
+
+// CHECK: Dereference of null pointer
+int a(int *x) { if(x){} *x = 47; }