annotate run/nested_function_05.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 b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
260
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
1 // $HeadURL$
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
2 // $Date$
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
3 // $Author$
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
4
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
5 // @author@ zwang <nehzgnaw@gmail.com>
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
6 // @date@ 2005-02-03
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 260
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2838
260
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
8
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
9 module dstress.run.nested_function_05;
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
10
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
11 int status;
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
12
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
13 void check(){
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
14 assert(status==1);
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
15 void main(){
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
16 assert(status==3);
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
17 status+=5;
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
18 }
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
19 status+=2;
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
20 assert(status==3);
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
21 main();
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
22 assert(status==8);
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
23 status+=7;
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
24 }
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
25
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
26 int main(){
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
27 status++;
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
28 assert(status==1);
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
29 check();
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
30 assert(status==15);
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
31 return 0;
c47a1fee9989 nested "main" function
thomask
parents:
diff changeset
32 }