annotate run/break_09.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 ec5e144583ea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
203
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
1 // $HeadURL$
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
2 // $Date$
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
3 // $Author$
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
4
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
5 module dstress.run.break_09;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
6
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
7 int status;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
8
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
9 int test(string[] args){
203
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
10
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
11 loop: while(1){
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
12 try{
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
13 try{
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
14 if(args.length==1){
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
15 break loop;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
16 }
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
17 }finally{
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
18 if(0 != status){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
19 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
20 }
203
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
21 status+=2;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
22 }
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
23 }finally{
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
24 if(2 != status){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
25 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
26 }
203
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
27 status+=3;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
28 }
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
29 return 0;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
30 }
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
31 return -1;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
32 }
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
33
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
34 int main(string[] args){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
35 if(0 != status ){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
36 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
37 }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
38 if(1 != args.length ){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
39 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
40 }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
41 if(-1 != test(args) ){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
42 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
43 }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
44 if(5 != status ){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
45 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 203
diff changeset
46 }
203
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
47 return 0;
85ed61918ae4 added "intervening finally" tests for break and goto
thomask
parents:
diff changeset
48 }