diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-09-07 19:09:51 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-09-07 19:09:51 +0000 |
commit | c957319941e93db2bc399efa7a9d1425bc609ba9 (patch) | |
tree | a524c6282eb0b773ad897ef89057623f9a4c114a | |
parent | 3d074c3828220d94c290a9d3c052b25865760e1f (diff) |
Add test case for <rdar://problem/12075238>, which recently got fixed by changes to RegionStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163406 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/misc-ps.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps.c b/test/Analysis/misc-ps.c index 8ff710b12f..ef89321fff 100644 --- a/test/Analysis/misc-ps.c +++ b/test/Analysis/misc-ps.c @@ -133,3 +133,21 @@ int isctype(char c, unsigned long f) return (c < 1 || c > 10) ? 0 : !!(c & f); } +// Test that symbolic array offsets are modeled conservatively. +// This was triggering a false "use of uninitialized value" warning. +void rdar_12075238__aux(unsigned long y); +int rdar_12075238_(unsigned long count) { + if ((count < 3) || (count > 6)) + return 0; + + unsigned long array[6]; + unsigned long i = 0; + for (; i <= count - 2; i++) + { + array[i] = i; + } + array[count - 1] = i; + rdar_12075238__aux(array[2]); // no-warning + return 0; +} + |