diff options
| author | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2008-02-18 22:44:02 +0000 |
|---|---|---|
| committer | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2008-02-18 22:44:02 +0000 |
| commit | dec89733a77205f7d2c69ce12ea30e4aa3acfcee (patch) | |
| tree | 8dd499bdf1c5ce8223f03fe97970e283e7312c50 /clang/test/CodeGen | |
| parent | 86e793937a2a54f9c162c3aff5159861a7827263 (diff) | |
| download | bcm5719-llvm-dec89733a77205f7d2c69ce12ea30e4aa3acfcee.tar.gz bcm5719-llvm-dec89733a77205f7d2c69ce12ea30e4aa3acfcee.zip | |
Implement multi-dimension array initalizer.
Fix McCat/08-main test.
llvm-svn: 47286
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/init.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/test/CodeGen/init.c b/clang/test/CodeGen/init.c index 24f887422dd..f773b8b8dde 100644 --- a/clang/test/CodeGen/init.c +++ b/clang/test/CodeGen/init.c @@ -1,7 +1,14 @@ // RUN: clang -emit-llvm %s -void f1() -{ - // Scalars in braces. - int a = { 1 }; - int b = { 1, 2 }; +void f1() { + // Scalars in braces. + int a = { 1 }; + int b = { 1, 2 }; +} + +void f2() { + int a[2][2] = { { 1, 2 }, { 3, 4 } }; + int b[3][3] = { { 1, 2 }, { 3, 4 } }; + int *c[2] = { &a[1][1], &b[2][2] }; + int *d[2][2] = { {&a[1][1], &b[2][2]}, {&a[0][0], &b[1][1]} }; + int *e[3][3] = { {&a[1][1], &b[2][2]}, {&a[0][0], &b[1][1]} }; } |

