From: Ted Kremenek Date: Thu, 24 Dec 2009 02:41:19 +0000 (+0000) Subject: Add analyzer test case for 'ForStmt' with condition variable. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd8b44101281c894026c7070da6e826c542ea87b;p=clang Add analyzer test case for 'ForStmt' with condition variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92120 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp index f71bb0ea38..225abb5aa1 100644 --- a/test/Analysis/misc-ps-region-store.cpp +++ b/test/Analysis/misc-ps-region-store.cpp @@ -75,3 +75,17 @@ int test_init_in_condition_while() { return 0; } + +int test_init_in_condition_for() { + int z = 0; + for (int x = 0; int y = ++z; ++x) { + if (x == y) // no-warning + break; + } + if (z == 1) + return 0; + + int *p = 0; + *p = 0xDEADBEEF; // no-warning + return 0; +}