Mercurial > projects > ldc
annotate tests/mini/union2.d @ 812:6c2ff06c4201
Fixed a nasty bug with how interface vtables for class initializers were output, causing some class fields to be skipped.
Fixed a problem in definition of ClassInfos where an invalid constant was potentially used. This needs to be looked into proper as it might happen again in the future.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 01 Dec 2008 04:37:54 +0100 |
parents | 44f08170f4ef |
children |
rev | line source |
---|---|
73 | 1 module union2; |
2 | |
3 union U | |
4 { | |
5 float f; | |
6 long l; | |
7 } | |
8 | |
9 U u; | |
10 | |
11 void main() | |
12 { | |
13 assert(u.f !<>= 0); | |
94
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
73
diff
changeset
|
14 { |
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
73
diff
changeset
|
15 uint* p = 1 + cast(uint*)&u; |
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
73
diff
changeset
|
16 {assert(*p == 0);} |
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
73
diff
changeset
|
17 } |
73 | 18 } |