annotate run/constructor_07.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 6e4063f99377
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
208
278884e3a78d botched constructor
thomask
parents:
diff changeset
1 // $HeadURL$
278884e3a78d botched constructor
thomask
parents:
diff changeset
2 // $Date$
278884e3a78d botched constructor
thomask
parents:
diff changeset
3 // $Author$
278884e3a78d botched constructor
thomask
parents:
diff changeset
4
278884e3a78d botched constructor
thomask
parents:
diff changeset
5 // @author@ Ilya Zaitseff <sark7@mail333.com>
278884e3a78d botched constructor
thomask
parents:
diff changeset
6 // @date@ 2004-12-21
278884e3a78d botched constructor
thomask
parents:
diff changeset
7 // @uri@ news:opsja8b9ddaaezs2@robingood
1487
6e4063f99377 changed nntp: URLs to http: URLs
thomask
parents: 1383
diff changeset
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2584
208
278884e3a78d botched constructor
thomask
parents:
diff changeset
9
278884e3a78d botched constructor
thomask
parents:
diff changeset
10 module dstress.run.constructor_07;
278884e3a78d botched constructor
thomask
parents:
diff changeset
11
278884e3a78d botched constructor
thomask
parents:
diff changeset
12 class A{
278884e3a78d botched constructor
thomask
parents:
diff changeset
13 this() {}
278884e3a78d botched constructor
thomask
parents:
diff changeset
14 }
278884e3a78d botched constructor
thomask
parents:
diff changeset
15
278884e3a78d botched constructor
thomask
parents:
diff changeset
16 class B : A {
278884e3a78d botched constructor
thomask
parents:
diff changeset
17 int foo;
278884e3a78d botched constructor
thomask
parents:
diff changeset
18 }
278884e3a78d botched constructor
thomask
parents:
diff changeset
19
278884e3a78d botched constructor
thomask
parents:
diff changeset
20 class C : B {
278884e3a78d botched constructor
thomask
parents:
diff changeset
21 int bar;
278884e3a78d botched constructor
thomask
parents:
diff changeset
22
278884e3a78d botched constructor
thomask
parents:
diff changeset
23 this(){
278884e3a78d botched constructor
thomask
parents:
diff changeset
24 foo = 0;
278884e3a78d botched constructor
thomask
parents:
diff changeset
25 bar = 1;
278884e3a78d botched constructor
thomask
parents:
diff changeset
26 }
278884e3a78d botched constructor
thomask
parents:
diff changeset
27 }
278884e3a78d botched constructor
thomask
parents:
diff changeset
28
278884e3a78d botched constructor
thomask
parents:
diff changeset
29 int main(){
278884e3a78d botched constructor
thomask
parents:
diff changeset
30 C c = new C();
278884e3a78d botched constructor
thomask
parents:
diff changeset
31 assert(c.foo==0);
278884e3a78d botched constructor
thomask
parents:
diff changeset
32 assert(c.bar==1);
278884e3a78d botched constructor
thomask
parents:
diff changeset
33 c.foo=2;
278884e3a78d botched constructor
thomask
parents:
diff changeset
34 assert(c.foo==2);
278884e3a78d botched constructor
thomask
parents:
diff changeset
35 assert(c.bar==1);
278884e3a78d botched constructor
thomask
parents:
diff changeset
36 c.bar=-1;
278884e3a78d botched constructor
thomask
parents:
diff changeset
37 assert(c.foo==2);
278884e3a78d botched constructor
thomask
parents:
diff changeset
38 assert(c.bar==-1);
278884e3a78d botched constructor
thomask
parents:
diff changeset
39 return 0;
278884e3a78d botched constructor
thomask
parents:
diff changeset
40 }