Mercurial > projects > ldc
annotate tests/mini/union2.d @ 978:6a32d2e18175
Fix a latent bug in the asm code.
I think that technically, using "*m0" instead of "*0" allows LLVM to pick
between using the same memory as output 0 and using a new memory location.
(So far I haven't been able to construct a testcase that actually breaks
because of this, though)
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Wed, 18 Feb 2009 03:38:12 +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 } |