]> granicus.if.org Git - clang/commitdiff
This test case checks if we get the right rvalue type of a TypedViewRegion.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 11 Mar 2009 09:15:38 +0000 (09:15 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 11 Mar 2009 09:15:38 +0000 (09:15 +0000)
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

index 7b66b2f8fe351af2bbdd89976805e6728a8eb935..ca23437f92a3091bb7ebe5f3186179c6ce48515c 100644 (file)
@@ -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;
+}