diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-18 06:29:10 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-18 06:29:10 +0000 |
commit | cea657807873815709ab4db9c76f31334af6dbd8 (patch) | |
tree | 1c92c19f632e38eda5348ba68f3caac8622c4f9b /clang/test/Analysis/casts.c | |
parent | e7e659431c231be662dd954d66a18fdc9914e27a (diff) | |
download | bcm5719-llvm-cea657807873815709ab4db9c76f31334af6dbd8.tar.gz bcm5719-llvm-cea657807873815709ab4db9c76f31334af6dbd8.zip |
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.
llvm-svn: 73690
Diffstat (limited to 'clang/test/Analysis/casts.c')
-rw-r--r-- | clang/test/Analysis/casts.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Analysis/casts.c b/clang/test/Analysis/casts.c index 94a1eac0a31..c5fcdd92e1c 100644 --- a/clang/test/Analysis/casts.c +++ b/clang/test/Analysis/casts.c @@ -14,3 +14,19 @@ void f(int sock) { ; } } + +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; +} + |