Add assorted test cases from PR 4172.

llvm-svn: 95297
This commit is contained in:
Ted Kremenek 2010-02-04 07:25:56 +00:00
parent f3c6b5008a
commit fc8dbdf3c7
1 changed files with 29 additions and 0 deletions

View File

@ -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
}