[cfe-commits] r66656 - /cfe/trunk/test/Analysis/ptr-arith.c

Zhongxing Xu xuzhongxing at gmail.com
Wed Mar 11 02:15:49 PDT 2009


Author: zhongxingxu
Date: Wed Mar 11 04:15:38 2009
New Revision: 66656

URL: http://llvm.org/viewvc/llvm-project?rev=66656&view=rev
Log:
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'.

Modified:
    cfe/trunk/test/Analysis/ptr-arith.c

Modified: cfe/trunk/test/Analysis/ptr-arith.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/ptr-arith.c?rev=66656&r1=66655&r2=66656&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/ptr-arith.c (original)
+++ cfe/trunk/test/Analysis/ptr-arith.c Wed Mar 11 04:15:38 2009
@@ -12,3 +12,18 @@
   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;
+}





More information about the cfe-commits mailing list