[cfe-commits] r49095 - /cfe/trunk/test/Analysis/null-deref-ps.c

Ted Kremenek kremenek at apple.com
Wed Apr 2 09:54:41 PDT 2008


Author: kremenek
Date: Wed Apr  2 11:54:39 2008
New Revision: 49095

URL: http://llvm.org/viewvc/llvm-project?rev=49095&view=rev
Log:
Added path-sensitive null dereference test case.

Added:
    cfe/trunk/test/Analysis/null-deref-ps.c

Added: cfe/trunk/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=49095&view=auto

==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (added)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Wed Apr  2 11:54:39 2008
@@ -0,0 +1,6 @@
+// RUN: clang -grsimple -verify %s
+
+void f1(int *p) {  
+  if (p) *p = 1;
+  else *p = 0; // expected-warning{{ereference}}
+}





More information about the cfe-commits mailing list