diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-03-11 09:15:38 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-03-11 09:15:38 +0000 |
commit | 3c4b37980ad5582409fa9a99ac29da8ab59f1ed0 (patch) | |
tree | 4e06eec642f644673e73212a11cc6244d1a5649a | |
parent | 2e3f73b963b5831d6230f69e157b0964b11eff91 (diff) |
This test case checks if we get the right rvalue type of a TypedViewRegion.
The ElementRegion's type depends on the array region's rvalue type. If it was
a pointer type, we would get a loc::SymbolVal for '*p'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66656 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/ptr-arith.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/ptr-arith.c b/test/Analysis/ptr-arith.c index 7b66b2f8fe..ca23437f92 100644 --- a/test/Analysis/ptr-arith.c +++ b/test/Analysis/ptr-arith.c @@ -12,3 +12,18 @@ void f2() { char *p = foo(); ++p; } + +char* memchr(); +static int +domain_port (const char *domain_b, const char *domain_e, + const char **domain_e_ptr) +{ + int port = 0; + + const char *p; + const char *colon = memchr (domain_b, ':', domain_e - domain_b); + + for (p = colon + 1; p < domain_e ; p++) + port = 10 * port + (*p - '0'); + return port; +} |