Mercurial > projects > dstress
annotate run/t/template_32_K.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 | 902d2c168029 |
children |
rev | line source |
---|---|
917 | 1 // $HeadUR$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Dave <Dave_member@pathlink.com> | |
6 // @date@ 2006-03-18 | |
7 // @uri@ news:dvgq34$22hv$1@digitaldaemon.com | |
1380 | 8 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=487 |
917 | 9 |
10 module dstress.run.t.template_32_K; | |
11 | |
12 template sum(int x){ | |
13 static if (x <= 1){ | |
14 const int sum = x; | |
15 }else{ | |
16 const int sum = x + sum!(x - 1); | |
17 } | |
18 } | |
19 | |
20 int main(){ | |
21 int x = sum!(2); | |
22 | |
23 if(x != 3){ | |
24 assert(0); | |
25 } | |
26 | |
27 return 0; | |
28 } |