From 6bc04bca68d27b0975b66d23f231ddcb81342c31 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 24 Aug 2009 22:56:32 +0000 Subject: [PATCH] Add test case for PR 4759. llvm-svn: 79954 --- clang/test/Analysis/null-deref-ps.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clang/test/Analysis/null-deref-ps.c b/clang/test/Analysis/null-deref-ps.c index 4db3633620cc..f3591a3bbde9 100644 --- a/clang/test/Analysis/null-deref-ps.c +++ b/clang/test/Analysis/null-deref-ps.c @@ -272,4 +272,13 @@ void f13() { if (((((int) x) << 2) + 1) >> 1) *x = 1; // no-warning } +// PR 4759 - Attribute non-null checking by the analyzer was not correctly +// handling pointer values that were undefined. +void pr4759_aux(int *p) __attribute__((nonnull)); + +void pr4759() { + int *p; + pr4759_aux(p); // expected-warning{{undefined}} +} +