Mercurial > projects > ldc
annotate test/interface6.d @ 306:0baca2feb554 trunk
[svn r327] Fixed some more MinGW32 issues. It's now very close to working.
Fixed problems with inline asm like: mov EAX, FS:4 , which incidentally is used in the runtime to get the stack bottom, on Windows.
author | lindquist |
---|---|
date | Fri, 27 Jun 2008 23:58:22 +0200 |
parents | 44a95ac7368a |
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 } |