If the SymbolicRegion was cast to another type, use that type to create the
ElementRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73754 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/casts.c b/test/Analysis/casts.c
index eac0bd3..d47184f 100644
--- a/test/Analysis/casts.c
+++ b/test/Analysis/casts.c
@@ -27,3 +27,12 @@
char c = (unsigned char) *tbool; // Should use cast-to type to create symbol.
}
+void f2(const char *str) {
+ unsigned char ch, cl, *p;
+
+ p = (unsigned char *)str;
+ ch = *p++; // use cast-to type 'unsigned char' to create element region.
+ cl = *p++;
+ if(!cl)
+ cl = 'a';
+}