Mercurial > projects > dstress
annotate run/d/double_27_D.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 | 23fe17e22a63 |
children |
rev | line source |
---|---|
897 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // based on: gcc.c-torture/execute/ieee/acc2.c | |
6 | |
7 module dstress.run.d.double_27_D; | |
8 | |
9 double func (double *array){ | |
10 double d = *array; | |
1091 | 11 |
897 | 12 if (d == 1.0){ |
13 return d; | |
14 }else{ | |
15 return d + func (array + 1); | |
16 } | |
17 } | |
18 | |
19 int main (){ | |
20 const double values[] = [double.max, 2.0, 0.5, 1.0]; | |
21 | |
1279 | 22 if(func(values.ptr) != double.max){ |
897 | 23 assert(0); |
24 } | |
1091 | 25 |
897 | 26 return 0; |
27 } |