Mercurial > projects > ldc
annotate tests/mini/union2.d @ 983:6e68054cfc20
Fix out-ouf-source build for runtime as well.
To build out-of-source, follow these steps:
# [[Insert LLVM build instructions here]]
mkdir my_build_dir
cd my_build_dir
svn co http://svn.dsource.org/projects/tango/trunk tango
ccmake <PATH_TO_SOURCE>
# (Regular ccmake stuff, press 'c' a few times followed by 'g')
make
make runtime
# add `PWD`/bin to PATH
closes #213
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Thu, 19 Feb 2009 11:01:34 +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 } |