]> granicus.if.org Git - clang/commitdiff
Add assorted test cases from PR 4172.
authorTed Kremenek <kremenek@apple.com>
Thu, 4 Feb 2010 07:25:56 +0000 (07:25 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 4 Feb 2010 07:25:56 +0000 (07:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95297 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/misc-ps-region-store.m

index a87d2ed1db717f56caee5b2e8c573f675a799e51..e0827922623e94ce1366a27ce0d75c144751d314 100644 (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
+}
+