]> granicus.if.org Git - clang/commitdiff
Add another test case found due to an analyzer regression.
authorTed Kremenek <kremenek@apple.com>
Fri, 1 May 2009 23:35:18 +0000 (23:35 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 1 May 2009 23:35:18 +0000 (23:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70600 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/misc-ps.m

index 005109fb734f7afb39bb6ebef6b4d5ce036faef3..fe603d6345bd657e0f17f60057855552b4d00019 100644 (file)
@@ -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;  
+}
+