[cfe-commits] r60002 - /cfe/trunk/test/Analysis/array-struct.c

Zhongxing Xu xuzhongxing at gmail.com
Mon Nov 24 17:45:11 PST 2008


Author: zhongxingxu
Date: Mon Nov 24 19:45:11 2008
New Revision: 60002

URL: http://llvm.org/viewvc/llvm-project?rev=60002&view=rev
Log:
Add documentation for test.

Modified:
    cfe/trunk/test/Analysis/array-struct.c

Modified: cfe/trunk/test/Analysis/array-struct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/array-struct.c?rev=60002&r1=60001&r2=60002&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/array-struct.c (original)
+++ cfe/trunk/test/Analysis/array-struct.c Mon Nov 24 19:45:11 2008
@@ -12,6 +12,7 @@
 
 void g1(struct s* p);
 
+// Array to pointer conversion. Array in the struct field.
 void f(void) {
   int a[10];
   int (*p)[10];
@@ -25,26 +26,32 @@
   d.data_array[9] = 17;
 }
 
+// StringLiteral in lvalue context and pointer to array type.
+// p: ElementRegion, q: StringRegion
 void f2() {
   char *p = "/usr/local";
   char (*q)[4];
   q = &"abc";
 }
 
+// Typedef'ed struct definition.
 void f3() {
   STYPE s;
 }
 
+// Initialize array with InitExprList.
 void f4() {
   int a[] = { 1, 2, 3};
   int b[3] = { 1, 2 };
 }
 
+// Struct variable in lvalue context.
 void f5() {
   struct s data;
   g1(&data);
 }
 
+// AllocaRegion test.
 void f6() {
   char *p;
   p = __builtin_alloca(10); 
@@ -55,16 +62,19 @@
 
 void g2(struct s2 *p);
 
+// Incomplete struct pointer used as function argument.
 void f7() {
   struct s2 *p = __builtin_alloca(10);
   g2(p);
 }
 
+// sizeof() is unsigned while -1 is signed in array index.
 void f8() {
   int a[10];
   a[sizeof(a)/sizeof(int) - 1] = 1; // no-warning
 }
 
+// Initialization of struct array elements.
 void f9() {
   struct s a[10];
 }





More information about the cfe-commits mailing list