summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/flexible-array-init.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-20 00:32:56 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-20 00:32:56 +0000
commit07d8e3a500477fef5164f928b6b9cec45580ccef (patch)
tree463b180b52cde4acb0b44fcbb984b6678eab0ce1 /clang/test/CodeGen/flexible-array-init.c
parenta1a0e4b27e80e11cb87fc5e41492c946ba5b068e (diff)
downloadbcm5719-llvm-07d8e3a500477fef5164f928b6b9cec45580ccef.tar.gz
bcm5719-llvm-07d8e3a500477fef5164f928b6b9cec45580ccef.zip
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. llvm-svn: 67353
Diffstat (limited to 'clang/test/CodeGen/flexible-array-init.c')
-rw-r--r--clang/test/CodeGen/flexible-array-init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGen/flexible-array-init.c b/clang/test/CodeGen/flexible-array-init.c
new file mode 100644
index 00000000000..0e2fcc69d11
--- /dev/null
+++ b/clang/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 } };
OpenPOWER on IntegriCloud