From: Ted Kremenek Date: Wed, 1 Sep 2010 23:37:36 +0000 (+0000) Subject: Add another test case for PR 8015, here with the array index being within a valid... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19c74a05c44c9e9966961975992ee1555d556d45;p=clang Add another test case for PR 8015, here with the array index being within a valid range and not just a single constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112769 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m index 5b6a7c7bfa..4aedac2210 100644 --- a/test/Analysis/misc-ps-region-store.m +++ b/test/Analysis/misc-ps-region-store.m @@ -1116,3 +1116,12 @@ void pr8015_D_FIXME() { } } +void pr8015_E() { + // Similar to pr8015_C, but number is allowed to be a valid range. + int number = pr8015_A(); + const char *numbers[] = { "zero", "one", "two" }; + if (number < 3) { + pr8015_B(numbers[number]); // no-warning + } +} +