annotate run/scope_06.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 8d5c55d163fd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
395
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
1 // $HeadURL$
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
2 // $Date$
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
3 // $Author$
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
4
1615
8d5c55d163fd Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents: 1559
diff changeset
5 module dstress.run.scope_06;
395
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
6
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
7 int status;
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
8
1615
8d5c55d163fd Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents: 1559
diff changeset
9 scope class A{
395
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
10 int cond;
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
11
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
12 this(int cond){
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
13 this.cond=cond;
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
14 }
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
15
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
16 ~this(){
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 799
diff changeset
17 if(cond != status){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 799
diff changeset
18 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 799
diff changeset
19 }
395
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
20 status--;
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
21 }
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
22 }
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
23
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
24 void test(){
1615
8d5c55d163fd Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents: 1559
diff changeset
25 scope A a = new A(-1);
8d5c55d163fd Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents: 1559
diff changeset
26 scope A b = new A(0);
395
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
27 }
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
28
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
29 int main(){
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
30 test();
799
c67acdbaf88e Sean Kelly <sean@f4.ca>
thomask
parents: 395
diff changeset
31
c67acdbaf88e Sean Kelly <sean@f4.ca>
thomask
parents: 395
diff changeset
32 if(status==-2){
c67acdbaf88e Sean Kelly <sean@f4.ca>
thomask
parents: 395
diff changeset
33 return 0;
c67acdbaf88e Sean Kelly <sean@f4.ca>
thomask
parents: 395
diff changeset
34 }
395
8b1e3fb9c5a5 added test for destructor sequence of auto variables
thomask
parents:
diff changeset
35 }