annotate run/constructor_08.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_08;
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;
516
592f9ae41ba5 post DMD-0.122 review [1+2/n]
thomask
parents: 208
diff changeset
18 this() {}
208
278884e3a78d botched constructor
thomask
parents:
diff changeset
19 }
278884e3a78d botched constructor
thomask
parents:
diff changeset
20
278884e3a78d botched constructor
thomask
parents:
diff changeset
21 class C : B {
278884e3a78d botched constructor
thomask
parents:
diff changeset
22 int bar;
278884e3a78d botched constructor
thomask
parents:
diff changeset
23
278884e3a78d botched constructor
thomask
parents:
diff changeset
24 this(){
278884e3a78d botched constructor
thomask
parents:
diff changeset
25 foo = 0;
278884e3a78d botched constructor
thomask
parents:
diff changeset
26 bar = 1;
278884e3a78d botched constructor
thomask
parents:
diff changeset
27 }
278884e3a78d botched constructor
thomask
parents:
diff changeset
28 }
278884e3a78d botched constructor
thomask
parents:
diff changeset
29
278884e3a78d botched constructor
thomask
parents:
diff changeset
30 int main(){
278884e3a78d botched constructor
thomask
parents:
diff changeset
31 C c = new C();
278884e3a78d botched constructor
thomask
parents:
diff changeset
32 assert(c.foo==0);
278884e3a78d botched constructor
thomask
parents:
diff changeset
33 assert(c.bar==1);
278884e3a78d botched constructor
thomask
parents:
diff changeset
34 c.foo=2;
278884e3a78d botched constructor
thomask
parents:
diff changeset
35 assert(c.foo==2);
278884e3a78d botched constructor
thomask
parents:
diff changeset
36 assert(c.bar==1);
278884e3a78d botched constructor
thomask
parents:
diff changeset
37 c.bar=-1;
278884e3a78d botched constructor
thomask
parents:
diff changeset
38 assert(c.foo==2);
278884e3a78d botched constructor
thomask
parents:
diff changeset
39 assert(c.bar==-1);
278884e3a78d botched constructor
thomask
parents:
diff changeset
40 return 0;
278884e3a78d botched constructor
thomask
parents:
diff changeset
41 }