diff options
author | ed <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-22 08:08:35 +0000 |
commit | 8927c19a5ed03bef55dac4b623688387bcc794dc (patch) | |
tree | b6403365e77095a79062d3379c9e6aea0df5f088 /test/Analysis/casts.c | |
parent | b8e7410b22fa573fb0078712439f343bc69208dd (diff) | |
download | FreeBSD-src-8927c19a5ed03bef55dac4b623688387bcc794dc.zip FreeBSD-src-8927c19a5ed03bef55dac4b623688387bcc794dc.tar.gz |
Update Clang sources to r73879.
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 94a1eac..5e4222b 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'; +} |