]> granicus.if.org Git - clang/commitdiff
ccc: Add --analyze test case.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 21 Jan 2009 01:22:37 +0000 (01:22 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 21 Jan 2009 01:22:37 +0000 (01:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62654 91177308-0d34-0410-b5e6-96231b3b80d8

tools/ccc/test/ccc/analyze.c [new file with mode: 0644]

diff --git a/tools/ccc/test/ccc/analyze.c b/tools/ccc/test/ccc/analyze.c
new file mode 100644 (file)
index 0000000..b03c6af
--- /dev/null
@@ -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;
+}