diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-20 00:32:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-20 00:32:56 +0000 |
commit | a6457963cf7ffe71498c408dd590d9d1acb9513c (patch) | |
tree | c747c6a2675d10c3dfd9471828811a82386d85e5 /test/CodeGen/flexible-array-init.c | |
parent | 748d5d655d9df4e9f8b8ae93ecdd24d725cfb1b8 (diff) |
Allow flexible array initializers that are not surrounded by
braces. We now build the appropriate fully-structured initializer list
for such things. Per PR3618, verified that we're getting the right
code generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/flexible-array-init.c')
-rw-r--r-- | test/CodeGen/flexible-array-init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/flexible-array-init.c b/test/CodeGen/flexible-array-init.c new file mode 100644 index 0000000000..0e2fcc69d1 --- /dev/null +++ b/test/CodeGen/flexible-array-init.c @@ -0,0 +1,8 @@ +// RUN: clang -triple i386-unknown-unknown -emit-llvm -o - %s | grep 7 | count 1 && +// RUN: clang -triple i386-unknown-unknown -emit-llvm -o - %s | grep 11 | count 1 && +// RUN: clang -triple i386-unknown-unknown -emit-llvm -o - %s | grep 13 | count 1 && +// RUN: clang -triple i386-unknown-unknown -emit-llvm -o - %s | grep 15 | count 1 + +struct { int x; int y[]; } a = { 1, 7, 11 }; + +struct { int x; int y[]; } b = { 1, { 13, 15 } }; |