diff test/union4.d @ 76:9e1bd80a7e98 trunk

[svn r80] Fixed union literals
author lindquist
date Wed, 31 Oct 2007 07:24:02 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/union4.d	Wed Oct 31 07:24:02 2007 +0100
@@ -0,0 +1,16 @@
+module union4;
+
+pragma(LLVM_internal, "notypeinfo")
+union U {
+    struct { float x,y,z; }
+    float[3] xyz;
+}
+
+void main() {
+    const float[3] a = [1f,2,3];
+    U u = U(1,2,3);
+    assert(u.xyz == a);
+    assert(u.x == 1);
+    assert(u.y == 2);
+    assert(u.z == 3);
+}