]> granicus.if.org Git - clang/commitdiff
Add test case for bug fix in r76262.
authorTed Kremenek <kremenek@apple.com>
Sat, 18 Jul 2009 05:02:33 +0000 (05:02 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 18 Jul 2009 05:02:33 +0000 (05:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76283 91177308-0d34-0410-b5e6-96231b3b80d8

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

index c5341a01388897ac92aef1d5d64cad9d89f6100c..2b0299f23f026001a06af147671416d18d8ce67e 100644 (file)
@@ -125,3 +125,17 @@ void testB_2(BStruct *b) {
     if ((int*)~0 != __gruev__) {}
   }
 }
+
+// This test case is a reduced case of a caching bug discovered by an
+// assertion failure in RegionStoreManager::BindArray.  Essentially the
+// DeclStmt is evaluated twice, but on the second loop iteration the
+// engine caches out.  Previously a false transition would cause UnknownVal
+// to bind to the variable, firing an assertion failure.  This bug was fixed
+// in r76262.
+void test_declstmt_caching() {
+again:
+  {
+    const char a[] = "I like to crash";
+    goto again;
+  }
+}