summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-29 17:44:32 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-29 17:44:32 +0000
commit0202cb406ee64be15636ba7b9435a9a83f9d4996 (patch)
tree0658b765f90c92a584ef4bb103822df89b310785 /clang/test
parent5169570e28a556cb9af0951eac1697442d26fa19 (diff)
downloadbcm5719-llvm-0202cb406ee64be15636ba7b9435a9a83f9d4996.tar.gz
bcm5719-llvm-0202cb406ee64be15636ba7b9435a9a83f9d4996.zip
Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a particular type. This replaces the (ab)use of CXXZeroValueInitExpr within initializer lists for the "holes" that occur due to the use of C99 designated initializers. The new test case is currently XFAIL'd, because CodeGen's ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be taught to value-initialize when it sees ImplicitValueInitExprs. llvm-svn: 63317
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/designated-initializers.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGen/designated-initializers.c b/clang/test/CodeGen/designated-initializers.c
new file mode 100644
index 00000000000..0605b24b1c5
--- /dev/null
+++ b/clang/test/CodeGen/designated-initializers.c
@@ -0,0 +1,17 @@
+// RUN: clang %s -emit-llvm -o -
+// XFAIL
+struct foo {
+ void *a;
+ int b;
+};
+
+union { int i; float f; } u = { };
+
+int main(int argc, char **argv)
+{
+ union { int i; float f; } u2 = { };
+ static struct foo foo = {
+ .b = 1024,
+ };
+}
+
OpenPOWER on IntegriCloud