annotate test/union4.d @ 176:a074a5ff709c
trunk
[svn r192] Fixed: String literals as constant expression was broken for utf16/32.
author |
lindquist |
date |
Wed, 07 May 2008 00:58:36 +0200 |
parents |
9e1bd80a7e98 |
children |
|
rev |
line source |
76
|
1 module union4;
|
|
2
|
|
3 pragma(LLVM_internal, "notypeinfo")
|
|
4 union U {
|
|
5 struct { float x,y,z; }
|
|
6 float[3] xyz;
|
|
7 }
|
|
8
|
|
9 void main() {
|
|
10 const float[3] a = [1f,2,3];
|
|
11 U u = U(1,2,3);
|
|
12 assert(u.xyz == a);
|
|
13 assert(u.x == 1);
|
|
14 assert(u.y == 2);
|
|
15 assert(u.z == 3);
|
|
16 }
|