summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-24 00:48:11 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-24 00:48:11 +0000
commit284d76441878d22e55386cb5f0612710a0c2a9f3 (patch)
treebdb4e5718505f79ed10d2743f951f61d049f5e11 /clang/test
parent589493227bea37357a1abbd69568ac8bb64cea37 (diff)
downloadbcm5719-llvm-284d76441878d22e55386cb5f0612710a0c2a9f3.tar.gz
bcm5719-llvm-284d76441878d22e55386cb5f0612710a0c2a9f3.zip
Add test case for PR 4358.
llvm-svn: 92103
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/misc-ps-region-store.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps-region-store.m b/clang/test/Analysis/misc-ps-region-store.m
index 7216608fe9f..7f29c99a44d 100644
--- a/clang/test/Analysis/misc-ps-region-store.m
+++ b/clang/test/Analysis/misc-ps-region-store.m
@@ -662,3 +662,25 @@ int pr5857(char *src) {
return 1;
}
+//===----------------------------------------------------------------------===//
+// PR 4358 - Without field-sensitivity, this code previously triggered
+// a false positive that 'uninit' could be uninitialized at the call
+// to pr4358_aux().
+//===----------------------------------------------------------------------===//
+
+struct pr4358 {
+ int bar;
+ int baz;
+};
+void pr4358_aux(int x);
+void pr4358(struct pr4358 *pnt) {
+ int uninit;
+ if (pnt->bar < 3) {
+ uninit = 1;
+ } else if (pnt->baz > 2) {
+ uninit = 3;
+ } else if (pnt->baz <= 2) {
+ uninit = 2;
+ }
+ pr4358_aux(uninit); // no-warning
+}
OpenPOWER on IntegriCloud