Mercurial > projects > ldc
annotate tests/mini/interface6.d @ 920:545f54041d91
Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Fixed align N; in asm blocks.
Fixed inreg parameter passing on x86 for ref/out params.
Removed support for lazy initialization of function local static variables, I have no idea why I ever implemented this, it's not in the D spec, and DMD doesn't support it :P
Some of the global variable related changes might cause minor regressions, but they should be easily fixable.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 03 Feb 2009 08:54:57 +0100 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
114 | 1 module interface6; |
2 | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
114
diff
changeset
|
3 extern(C) int printf(char*,...); |
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
114
diff
changeset
|
4 |
114 | 5 interface I |
6 { | |
7 void Ifunc(); | |
8 } | |
9 | |
10 interface J | |
11 { | |
12 void Jfunc(); | |
13 } | |
14 | |
15 class C : I,J | |
16 { | |
17 int i; | |
18 int j; | |
19 void Ifunc() | |
20 { | |
21 i++; | |
22 } | |
23 void Jfunc() | |
24 { | |
25 j++; | |
26 } | |
27 } | |
28 | |
29 void main() | |
30 { | |
31 C c = new C; | |
32 c.Ifunc(); | |
33 c.Jfunc(); | |
34 I i = c; | |
35 i.Ifunc(); | |
36 J j = c; | |
37 j.Jfunc(); | |
38 C c2 = cast(C)i; | |
39 c2.Ifunc(); | |
40 c2.Jfunc(); | |
41 C c3 = cast(C)j; | |
42 c3.Ifunc(); | |
43 c3.Jfunc(); | |
44 assert(c.i == 4); | |
45 assert(c.j == 4); | |
46 } |