annotate run/c/class_20_C.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 9dcac8d4e97f
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_C;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
6
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
7 interface A{
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
8 int foo();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
9 int bar();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
10 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
11
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
12 interface B{
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
13 int dummy();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
14 int bar();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
15 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
16
1091
9dcac8d4e97f post DMD-0.163 review
thomask
parents: 1090
diff changeset
17 class C : A, B{
836
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
18 int foo(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
19 return 0;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
20 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
21
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
22 int dummy(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
23 return 2;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
24 }
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 836
diff changeset
25
836
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
26 int bar(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
27 return 1;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
28 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
29 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
30
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
31 int main(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
32 C c = new C();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
33
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
34 if(c.foo() != 0){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
35 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
36 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
37
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
38 if(c.bar() != 1){
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.dummy() != 2){
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 A a = c;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
47
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
48 if(a.foo() != 0){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
49 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
50 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
51
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
52 if(a.bar() != 1){
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 B b = c;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
57
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
58 if(b.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 if(c.dummy() != 2){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
63 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
64 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
65
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
66 return 0;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
67 }