summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/tools/ccc/test/ccc/analyze.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/tools/ccc/test/ccc/analyze.c b/clang/tools/ccc/test/ccc/analyze.c
new file mode 100644
index 00000000000..b03c6af9c1c
--- /dev/null
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud