annotate run/i/if_10_F.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 976d6a6a7907
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
886
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
1 // $HeadURL$
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
2 // $Date$
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
3 // $Author$
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
4
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
5 module dstess.run.i.if_10_F;
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
6
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
7 int test(int i){
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
8 if (i--)
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
9 if (!i)
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
10 return 4;
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
11 return 5;
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
12 return 6;
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
13 }
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
14
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
15 int main(){
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
16 if(test(1) != 4){
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
17 assert(0);
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
18 }
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
19
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
20 if(test(2) != 5){
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
21 assert(0);
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
22 }
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
23
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
24 if(test(0) != 5){
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
25 assert(0);
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
26 }
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
27
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
28 return 0;
976d6a6a7907 div. C++ porting tests
thomask
parents:
diff changeset
29 }