annotate run/c/class_20_J.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents f4e98d870b57
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
836
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
1 // $HeadURL$
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
2 // $Date$
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
3 // $Author$
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
4
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
5 module dstress.run.c.class_20_J;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
6
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
7 interface A1{
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
8 int foo();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
9 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
10
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
11 interface A2{
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
12 int bar();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
13 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
14
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
15 interface B(T) : T{
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
16 int dummy();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
17 int bar();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
18 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
19
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
20
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
21 class C(T1, T2) : B!(T1), B!(T2){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
22 int foo(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
23 return 0;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
24 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
25
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
26 int dummy(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
27 return 2;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
28 }
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 836
diff changeset
29
836
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
30 int bar(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
31 return 1;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
32 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
33 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
34
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
35 int main(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
36 auto c = new C!(A1, A2)();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
37
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
38 if(c.foo() != 0){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
39 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
40 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
41
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
42 if(c.bar() != 1){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
43 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
44 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
45
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
46 if(c.dummy() != 2){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
47 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
48 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
49
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
50 A1 a1 = c;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
51
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
52 if(a1.foo() != 0){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
53 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
54 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
55
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
56 A2 a2 = c;
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 836
diff changeset
57
836
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
58 if(a2.bar() != 1){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
59 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
60 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
61
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
62 B!(A1) b1 = c;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
63
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
64 if(b1.bar() != 1){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
65 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
66 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
67
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
68 if(b1.dummy() != 2){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
69 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
70 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
71
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
72 B!(A2) b2 = c;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
73
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
74 if(b2.bar() != 1){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
75 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
76 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
77
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
78 if(b2.dummy() != 2){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
79 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
80 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
81
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
82 return 0;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
83 }