When casting region, if we do not create an element region, record the cast-to
type.
When retrieving the region value, if we are going to create a symbol value, use
the cast-to type if possible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73690 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/casts.c b/test/Analysis/casts.c
index 94a1eac..c5fcdd9 100644
--- a/test/Analysis/casts.c
+++ b/test/Analysis/casts.c
@@ -14,3 +14,19 @@
;
}
}
+
+struct s {
+ struct s *value;
+};
+
+// ElementRegion and cast-to pointee type may be of the same size:
+// 'struct s **' and 'int'.
+
+int f1(struct s **pval) {
+ int *tbool = ((void*)0);
+ struct s *t = *pval;
+ pval = &(t->value);
+ tbool = (int *)pval;
+ char c = (unsigned char) *tbool;
+}
+