r177767 - Add test case for PR 12921.
Ted Kremenek
kremenek at apple.com
Fri Mar 22 14:30:22 PDT 2013
Author: kremenek
Date: Fri Mar 22 16:30:22 2013
New Revision: 177767
URL: http://llvm.org/viewvc/llvm-project?rev=177767&view=rev
Log:
Add test case for PR 12921.
Modified:
cfe/trunk/test/Analysis/misc-ps-region-store.cpp
Modified: cfe/trunk/test/Analysis/misc-ps-region-store.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.cpp?rev=177767&r1=177766&r2=177767&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.cpp (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.cpp Fri Mar 22 16:30:22 2013
@@ -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];
+}
+
More information about the cfe-commits
mailing list