aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-12-04 18:35:53 +0000
committerTed Kremenek <kremenek@apple.com>2008-12-04 18:35:53 +0000
commita96ac060debe3b83caa5c4ddba0c44a44b4499fe (patch)
tree2a6b7a618e26d005e05c4a50e75be490826132dd
parent636a7c42d42800f69caadcdea433312fd642a4b3 (diff)
Add another test case for attribute(nonnull) checking.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60544 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/null-deref-ps.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c
index c3bf444420..3d912dcd08 100644
--- a/test/Analysis/null-deref-ps.c
+++ b/test/Analysis/null-deref-ps.c
@@ -65,6 +65,15 @@ int f6(int *p) {
: 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) {