annotate run/c/catch_05_C.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 b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
593
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
1 // $HeadURL$
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
2 // $Date$
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
3 // $Author$
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
4
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
5 // @author@ Nick <Nick_member@pathlink.com>
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
6 // @date@ 2005-06-21
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 1090
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=4383
593
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
8 // @desc@ foreach and throw/catch code generation
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
9
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
10 module dstress.run.c.catch_05_C;
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
11
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
12 int counter;
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
13
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
14 void dummy(){
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
15 counter++;
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
16 }
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
17
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
18 int bb[char[]];
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
19
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
20 int main(){
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
21
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
22 bb["zwei"] = 2;
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
23
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
24 if(counter != 0){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
25 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
26 }
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
27
593
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
28 foreach(char[] s, int i; bb){
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
29 dummy();
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
30 }
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
31
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
32 if(counter != 1){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
33 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
34 }
593
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
35
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
36 bb["a"] = 1;
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
37
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
38 foreach(int b; bb){
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
39 try{
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
40 throw new Error("foo");
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
41 }catch(Error e){
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
42 if(!e){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
43 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
44 }
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
45 if(counter != 1){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
46 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 593
diff changeset
47 }
593
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
48 return 0;
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
49 }catch{
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
50 assert(0);
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
51 }
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
52 assert(0);
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
53 }
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
54
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
55 assert(0);
6ee3b4b671c1 forach and throw/catch code generation
thomask
parents:
diff changeset
56 }