Mercurial > projects > ldc
annotate test/structs3.d @ 94:61615fa85940 trunk
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
Added support for array .sort and .reverse properties.
Fixed some bugs with pointer arithmetic.
Disabled some DMD AST optimizations that was messing things up, destroying valuable information.
Added a KDevelop project file, this is what I use for coding LLVMDC now :)
Other minor stuff.
author | lindquist |
---|---|
date | Mon, 12 Nov 2007 06:32:46 +0100 |
parents | 5e69b77a5c51 |
children |
rev | line source |
---|---|
7 | 1 module structs3; |
2 | |
3 struct S | |
4 { | |
5 char c; | |
8
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
6 float f; |
7 | 7 } |
8 | |
9 struct T | |
10 { | |
11 S s; | |
12 long l; | |
13 } | |
14 | |
15 void main() | |
16 { | |
8
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
17 T t; |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
18 float f = void; |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
19 float* fp = void; |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
20 {f = t.s.f;} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
21 {t.s.f = 0.0;} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
22 {fp = &t.s.f;} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
23 {*fp = 1.0;} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
24 {assert(t.s.f == 1.0);} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
25 {assert(*(&t.s.f) == 1.0);} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
26 {t.s.c = 'a';} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
27 {assert(t.s.c == 'a');} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
28 {t.l = 64;} |
5e69b77a5c51
[svn r12] fixed accessing aggregate fields of aggregates
lindquist
parents:
7
diff
changeset
|
29 {assert(t.l == 64);} |
7 | 30 } |