annotate run/c/class_20_H.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_H;
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
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
17
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
18 class C(T) : T, B{
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
19 int foo(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
20 return 0;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
21 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
22
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
23 int dummy(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
24 return 2;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
25 }
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 836
diff changeset
26
836
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
27 int bar(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
28 return 1;
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
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
32 int main(){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
33 auto c = new C!(A)();
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
34
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
35 if(c.foo() != 0){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
36 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
37 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
38
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
39 if(c.bar() != 1){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
40 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
41 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
42
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
43 if(c.dummy() != 2){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
44 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
45 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
46
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
47 A a = c;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
48
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
49 if(a.foo() != 0){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
50 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
51 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
52
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
53 if(a.bar() != 1){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
54 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
55 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
56
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
57 B b = c;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
58
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
59 if(b.bar() != 1){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
60 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
61 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
62
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
63 if(c.dummy() != 2){
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
64 assert(0);
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
65 }
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
66
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
67 return 0;
be9add84456d multiple inheritance of functions
thomask
parents:
diff changeset
68 }