Mercurial > projects > dstress
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 |
rev | line source |
---|---|
395 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
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 | 6 |
7 int status; | |
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 | 10 int cond; |
11 | |
12 this(int cond){ | |
13 this.cond=cond; | |
14 } | |
15 | |
16 ~this(){ | |
1559 | 17 if(cond != status){ |
18 assert(0); | |
19 } | |
395 | 20 status--; |
21 } | |
22 } | |
23 | |
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 | 27 } |
28 | |
29 int main(){ | |
30 test(); | |
799 | 31 |
32 if(status==-2){ | |
33 return 0; | |
34 } | |
395 | 35 } |