diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-03-22 21:30:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-03-22 21:30:22 +0000 |
commit | 88de5a0963cbd2b92810d20d1bfbd9eb4951dc42 (patch) | |
tree | 9e1e2285bc158697778950f0e316db988ac22aac | |
parent | ed2fc2a311065ee5f6c20adb1655702aff86ae8a (diff) |
Add test case for PR 12921.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177767 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/misc-ps-region-store.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp index 6fbe441b27..902a5e5271 100644 --- a/test/Analysis/misc-ps-region-store.cpp +++ b/test/Analysis/misc-ps-region-store.cpp @@ -721,3 +721,22 @@ void rdar12964481_b(_ComplexT *y) { *y *= x; // no-warning } +// Test case for PR 12921. This previously produced +// a bogus warning. +static const int pr12921_arr[] = { 0, 1 }; +static const int pr12921_arrcount = sizeof(pr12921_arr)/sizeof(int); + +int pr12921(int argc, char **argv) { + int i, retval; + for (i = 0; i < pr12921_arrcount; i++) { + if (argc == i) { + retval = i; + break; + } + } + + // No match + if (i == pr12921_arrcount) return 66; + return pr12921_arr[retval]; +} + |