Mercurial > projects > dstress
annotate run/values_01.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 | |
5 module dstress.run.values_01; | |
6 | |
4 | 7 int main(){ |
8 int[char[]] array; | |
9 array["eins"]=1; | |
10 array["zwei"]=2; | |
11 array["drei"]=3; | |
12 | |
13 int[] data = array.values; | |
14 assert(data.length==3); | |
15 | |
16 byte have[3]; | |
17 | |
18 assert(have[0]==0); | |
19 assert(have[1]==0); | |
20 assert(have[2]==0); | |
21 | |
22 foreach(int value; data){ | |
23 have[value-1]++; | |
24 } | |
25 | |
26 assert(have[0]==1); | |
27 assert(have[1]==1); | |
28 assert(have[2]==1); | |
29 | |
30 return 0; | |
31 } |