Mercurial > projects > ldc
annotate test/union2.d @ 270:d9d5d59873d8 trunk
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
Branch statements now emit a new block after it.
Fixed the _adSort runtime function had a bad signature.
Added a missing dot prefix on compiler generated string tables for string switch.
Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author | lindquist |
---|---|
date | Mon, 16 Jun 2008 16:01:19 +0200 |
parents | 61615fa85940 |
children |
rev | line source |
---|---|
73 | 1 module union2; |
2 | |
3 pragma(LLVM_internal, "notypeinfo") | |
4 union U | |
5 { | |
6 float f; | |
7 long l; | |
8 } | |
9 | |
10 U u; | |
11 | |
12 void main() | |
13 { | |
14 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
|
15 { |
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
73
diff
changeset
|
16 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
|
17 {assert(*p == 0);} |
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
73
diff
changeset
|
18 } |
73 | 19 } |