summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/casts.c
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-06-19 04:51:14 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-06-19 04:51:14 +0000
commitcc4576225324a683f446d2f0c60ed90fe34ee7a5 (patch)
treeaa3c22cd9c786e48cb36580931ca80dd4b89059d /clang/test/Analysis/casts.c
parent707cbc41264e76bbc47a22ee7c54036e32b545d1 (diff)
downloadbcm5719-llvm-cc4576225324a683f446d2f0c60ed90fe34ee7a5.tar.gz
bcm5719-llvm-cc4576225324a683f446d2f0c60ed90fe34ee7a5.zip
If the SymbolicRegion was cast to another type, use that type to create the
ElementRegion. llvm-svn: 73754
Diffstat (limited to 'clang/test/Analysis/casts.c')
-rw-r--r--clang/test/Analysis/casts.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Analysis/casts.c b/clang/test/Analysis/casts.c
index eac0bd3a011..d47184fb5f5 100644
--- a/clang/test/Analysis/casts.c
+++ b/clang/test/Analysis/casts.c
@@ -27,3 +27,12 @@ int f1(struct s **pval) {
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';
+}
OpenPOWER on IntegriCloud