annotate run/f/foreach_31_B.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 f7434744e991
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
780
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
1 // $HeadURL$
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
2 // $Date$
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
3 // $Author$
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
4
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
5 module dstress.run.f.foreach_31_B;
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
6
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
7 int main(){
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
8 int[] index;
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
9 char[] value;
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
10
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
11 foreach(int i, char c; "_\U00012345-"d){
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
12 index ~= i;
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
13 value ~= c;
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
14 }
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
15
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
16 assert(value.length == 6);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
17 assert(value[0] == '_');
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
18 assert(value[1] == 0xF0);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
19 assert(value[2] == 0x92);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
20 assert(value[3] == 0x8D);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
21 assert(value[4] == 0x85);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
22 assert(value[5] == '-');
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
23
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
24 assert(index.length == 6);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
25 assert(index[0] == 0);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
26 assert(index[1] == 1);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
27 assert(index[2] == 1);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
28 assert(index[3] == 1);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
29 assert(index[4] == 1);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
30 assert(index[5] == 2);
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
31
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
32 return 0;
f7434744e991 fixed foreach <-> wchar mixup
thomask
parents:
diff changeset
33 }