aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/designated-initializers.c
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
commit3498bdb9e9cb300de74c7b51c92608e2902b2348 (patch)
tree89551f7a11a7dccdf3248398d584abc31350505d /test/CodeGen/designated-initializers.c
parent0bb76897bedb8b747efc6523efb432fc24966118 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/designated-initializers.c')
-rw-r--r--test/CodeGen/designated-initializers.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/designated-initializers.c b/test/CodeGen/designated-initializers.c
new file mode 100644
index 0000000000..0605b24b1c
--- /dev/null
+++ b/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,
+ };
+}
+