[cfe-commits] r60544 - /cfe/trunk/test/Analysis/null-deref-ps.c
Ted Kremenek
kremenek at apple.com
Thu Dec 4 10:35:53 PST 2008
Author: kremenek
Date: Thu Dec 4 12:35:53 2008
New Revision: 60544
URL: http://llvm.org/viewvc/llvm-project?rev=60544&view=rev
Log:
Add another test case for attribute(nonnull) checking.
Modified:
cfe/trunk/test/Analysis/null-deref-ps.c
Modified: cfe/trunk/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=60544&r1=60543&r2=60544&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Thu Dec 4 12:35:53 2008
@@ -65,6 +65,15 @@
: bar(p, 0); // no-warning
}
+int bar2(int* p, int q) __attribute__((nonnull(1)));
+
+int f6b(int *p) {
+ return !p ? bar2(p, 1) // expected-warning {{Null pointer passed as an argument to a 'nonnull' parameter}}
+ : bar2(p, 0); // no-warning
+}
+
+
+
int* qux();
int f7(int x) {
More information about the cfe-commits
mailing list