diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-25 01:45:11 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-25 01:45:11 +0000 |
commit | f39268ae8c0cb15ea0ea7dcb108cc416eafdad59 (patch) | |
tree | e7c901887f80e09dc49920386293b1931cf913e6 /clang/test/Analysis | |
parent | 5149430c6e6ede308d97950ea45b4c03369c33e7 (diff) | |
download | bcm5719-llvm-f39268ae8c0cb15ea0ea7dcb108cc416eafdad59.tar.gz bcm5719-llvm-f39268ae8c0cb15ea0ea7dcb108cc416eafdad59.zip |
Add documentation for test.
llvm-svn: 60002
Diffstat (limited to 'clang/test/Analysis')
-rw-r--r-- | clang/test/Analysis/array-struct.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/array-struct.c b/clang/test/Analysis/array-struct.c index 3b6bc82315f..38e489e2a23 100644 --- a/clang/test/Analysis/array-struct.c +++ b/clang/test/Analysis/array-struct.c @@ -12,6 +12,7 @@ typedef struct { 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 @@ void f(void) { 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 @@ struct s2; 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]; } |