From 3c4b37980ad5582409fa9a99ac29da8ab59f1ed0 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Wed, 11 Mar 2009 09:15:38 +0000 Subject: [PATCH] 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 --- test/Analysis/ptr-arith.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; +} -- 2.40.0