diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
commit | b897c8660c4ff7037dde81b9645737bc1c992abe (patch) | |
tree | b6403365e77095a79062d3379c9e6aea0df5f088 /test/Analysis/casts.c | |
parent | 7ef7bab7e3d06f660b059b903c231f100bb13cc5 (diff) |
Diffstat (limited to 'test/Analysis/casts.c')
-rw-r--r-- | test/Analysis/casts.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Analysis/casts.c b/test/Analysis/casts.c index 94a1eac0a316..5e4222bc84be 100644 --- a/test/Analysis/casts.c +++ b/test/Analysis/casts.c @@ -14,3 +14,27 @@ void f(int sock) { ; } } + +struct s { + struct s *value; +}; + +int f1(struct s **pval) { + int *tbool = ((void*)0); + struct s *t = *pval; + pval = &(t->value); + tbool = (int *)pval; // Should record the cast-to type here. + char c = (unsigned char) *tbool; // Should use cast-to type to create symbol. + if (*tbool == -1) + 3; +} + +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'; +} |