summaryrefslogtreecommitdiff
path: root/test/Tooling
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2013-06-06 12:35:43 +0000
committerPavel Labath <labath@google.com>2013-06-06 12:35:43 +0000
commit373b807f36871de05a3b83bbc4ed4501317def5a (patch)
treebb33d32b988e1440e76ae1efa94714cbf7ff76d3 /test/Tooling
parent63d5335aea916584b76790af1f1ed7caeaf8efeb (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Tooling')
-rw-r--r--test/Tooling/clang-check-analyzer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Tooling/clang-check-analyzer.cpp b/test/Tooling/clang-check-analyzer.cpp
new file mode 100644
index 0000000000..16cf7ce603
--- /dev/null
+++ b/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; }