Mercurial > projects > dstress
annotate run/default_argument_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 | f87ba6507260 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
61 | 5 module dstress.run.default_argument_04; |
6 | |
7 int test(char[] a="abc"){ | |
8 if(a is null){ | |
9 return -1; | |
10 }else{ | |
11 return a.length; | |
12 } | |
13 } | |
14 | |
15 int main(){ | |
16 assert(test()==3); | |
17 assert(test("")==0); | |
18 assert(test(null)==-1); | |
19 assert(test("ab")==2); | |
20 return 0; | |
21 } |