diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-24 00:48:11 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-24 00:48:11 +0000 |
commit | cafefbe180bacd2c02c87ae1193f83fc6798cdfc (patch) | |
tree | 5519604f13fe3233273c29bf0b29f846681a3ac5 | |
parent | fcfb503c280ed8c66d428fed911b2846c0f434fc (diff) |
Add test case for PR 4358.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92103 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/misc-ps-region-store.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m index 7216608fe9..7f29c99a44 100644 --- a/test/Analysis/misc-ps-region-store.m +++ b/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 +} |