From: Ted Kremenek Date: Fri, 1 May 2009 23:35:18 +0000 (+0000) Subject: Add another test case found due to an analyzer regression. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=956a37dd8360054247b9b10615697e80bdda8741;p=clang Add another test case found due to an analyzer regression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70600 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m index 005109fb73..fe603d6345 100644 --- a/test/Analysis/misc-ps.m +++ b/test/Analysis/misc-ps.m @@ -272,3 +272,15 @@ next_opcode: } } +// Test invalidating pointers-to-pointers with slightly different types. This +// example came from a recent false positive due to a regression where the +// branch condition was falsely reported as being uninitialized. +void invalidate_by_ref(char **x); +int test_invalidate_by_ref() { + unsigned short y; + invalidate_by_ref((char**) &y); + if (y) // no-warning + return 1; + return 0; +} +