aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-01-21 01:22:37 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-01-21 01:22:37 +0000
commit18c9673c04d101e751ddaf4e7b5ba84a02988375 (patch)
treece41788b6b9a6834790879db9c5751ba73674630
parentde388a56b3a9cdeeb764cc5e21ccf95b6f4fef8a (diff)
ccc: Add --analyze test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62654 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/ccc/test/ccc/analyze.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/ccc/test/ccc/analyze.c b/tools/ccc/test/ccc/analyze.c
new file mode 100644
index 0000000000..b03c6af9c1
--- /dev/null
+++ b/tools/ccc/test/ccc/analyze.c
@@ -0,0 +1,7 @@
+// RUN: xcc --analyze %s -o %t &&
+// RUN: grep '<string>Dereference of null pointer.</string>' %t
+
+void f(int *p) {
+ if (!p)
+ *p = 0;
+}