summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-13 23:18:27 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-13 23:18:27 +0000
commit9fd8b6856867c2dfdfd308816af0fe4f23e3c358 (patch)
tree1e1897b5f9f1d5b6ef2208c8fbecee9cc1658768 /clang/test/CodeGen
parentdd7406e65c9153c4dce5ea8cc70514975eddc45e (diff)
downloadbcm5719-llvm-9fd8b6856867c2dfdfd308816af0fe4f23e3c358.tar.gz
bcm5719-llvm-9fd8b6856867c2dfdfd308816af0fe4f23e3c358.zip
Add codegen support for block-level compound literals.
llvm-svn: 51081
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/compound-literal.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/compound-literal.c b/clang/test/CodeGen/compound-literal.c
new file mode 100644
index 00000000000..bc185b24dcb
--- /dev/null
+++ b/clang/test/CodeGen/compound-literal.c
@@ -0,0 +1,13 @@
+// RUN: clang < %s -emit-llvm
+
+int* a = &(int){1};
+struct s {int a, b, c;} * b = &(struct s) {1, 2, 3};
+// Not working; complex constants are broken
+// _Complex double * x = &(_Complex double){1.0f};
+
+int xxx() {
+int* a = &(int){1};
+struct s {int a, b, c;} * b = &(struct s) {1, 2, 3};
+_Complex double * x = &(_Complex double){1.0f};
+_Complex double * y = &(_Complex double){};
+}
OpenPOWER on IntegriCloud