annotate run/return_04.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 014844597bbd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
192
014844597bbd 1) updated results
thomask
parents:
diff changeset
1 // $HeadURL$
014844597bbd 1) updated results
thomask
parents:
diff changeset
2 // $Date$
014844597bbd 1) updated results
thomask
parents:
diff changeset
3 // $Author$
014844597bbd 1) updated results
thomask
parents:
diff changeset
4
014844597bbd 1) updated results
thomask
parents:
diff changeset
5 module dstress.run.return_04;
014844597bbd 1) updated results
thomask
parents:
diff changeset
6
014844597bbd 1) updated results
thomask
parents:
diff changeset
7 int status;
014844597bbd 1) updated results
thomask
parents:
diff changeset
8
014844597bbd 1) updated results
thomask
parents:
diff changeset
9 int test(char[][] args){
014844597bbd 1) updated results
thomask
parents:
diff changeset
10 try{
014844597bbd 1) updated results
thomask
parents:
diff changeset
11 try{
014844597bbd 1) updated results
thomask
parents:
diff changeset
12 if(args.length==1){
014844597bbd 1) updated results
thomask
parents:
diff changeset
13 return -1;
014844597bbd 1) updated results
thomask
parents:
diff changeset
14 }
014844597bbd 1) updated results
thomask
parents:
diff changeset
15 }finally{
014844597bbd 1) updated results
thomask
parents:
diff changeset
16 assert(status==0);
014844597bbd 1) updated results
thomask
parents:
diff changeset
17 status+=2;
014844597bbd 1) updated results
thomask
parents:
diff changeset
18 }
014844597bbd 1) updated results
thomask
parents:
diff changeset
19 }finally{
014844597bbd 1) updated results
thomask
parents:
diff changeset
20 assert(status==2);
014844597bbd 1) updated results
thomask
parents:
diff changeset
21 status+=3;
014844597bbd 1) updated results
thomask
parents:
diff changeset
22 }
014844597bbd 1) updated results
thomask
parents:
diff changeset
23 return 0;
014844597bbd 1) updated results
thomask
parents:
diff changeset
24 }
014844597bbd 1) updated results
thomask
parents:
diff changeset
25
014844597bbd 1) updated results
thomask
parents:
diff changeset
26 int main(char[][] args){
014844597bbd 1) updated results
thomask
parents:
diff changeset
27 assert(status == 0);
014844597bbd 1) updated results
thomask
parents:
diff changeset
28 assert(args.length == 1);
014844597bbd 1) updated results
thomask
parents:
diff changeset
29 assert(test(args) == -1);
014844597bbd 1) updated results
thomask
parents:
diff changeset
30 assert(status == 5);
014844597bbd 1) updated results
thomask
parents:
diff changeset
31 return 0;
014844597bbd 1) updated results
thomask
parents:
diff changeset
32 }