From: Ted Kremenek Date: Thu, 4 Feb 2010 07:25:56 +0000 (+0000) Subject: Add assorted test cases from PR 4172. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68ebd83120dfcfc7625ba0e47c9395ed32b20997;p=clang Add assorted test cases from PR 4172. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95297 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m index a87d2ed1db..e082792262 100644 --- a/test/Analysis/misc-ps-region-store.m +++ b/test/Analysis/misc-ps-region-store.m @@ -758,3 +758,32 @@ const struct rdar_7515938_str *rdar_7515938_str() { static const struct rdar_7515938_str z = { 0, "hello" }; return &z; } + +//===----------------------------------------------------------------------===// +// Assorted test cases from PR 4172. +//===----------------------------------------------------------------------===// + +struct PR4172A_s { int *a; }; + +void PR4172A_f2(struct PR4172A_s *p); + +int PR4172A_f1(void) { + struct PR4172A_s m; + int b[4]; + m.a = b; + PR4172A_f2(&m); + return b[3]; // no-warning +} + +struct PR4172B_s { int *a; }; + +void PR4172B_f2(struct PR4172B_s *p); + +int PR4172B_f1(void) { + struct PR4172B_s m; + int x; + m.a = &x; + PR4172B_f2(&m); + return x; // no-warning +} +