annotate test/throw.c @ 691:25115b50d033

*** empty log message ***
author kono
date Wed, 10 Oct 2007 17:58:15 +0900
parents 682c8ec38d45
children 6b7372e17970
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
1
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
2 extern int printf(const char *,...);
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
3
622
682c8ec38d45 _code へ
kono
parents: 582
diff changeset
4 __code (*ret)();
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
5 void *env;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
6
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
7 #define ENVSIZE (1<<14)
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
8
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
9 typedef
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
10 struct interface1 {
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
11 int a;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
12 int b;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
13 char c[100];
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
14 int last;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
15 } interface1;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
16
622
682c8ec38d45 _code へ
kono
parents: 582
diff changeset
17 __code
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
18 throw2(interface1 arg,int i,int j)
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
19 {
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
20 goto ret(3),env;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
21 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
22
622
682c8ec38d45 _code へ
kono
parents: 582
diff changeset
23 __code
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
24 throw1(interface1 arg,int i,int j)
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
25 {
582
3f60e599cc04 *** empty log message ***
kono
parents: 581
diff changeset
26 printf("%d %d %d %d %d\n",arg.last,arg.a,arg.c[99],i,j);
581
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
27 arg.last=96;
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
28 goto throw2(arg,i,74);
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
29 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
30
622
682c8ec38d45 _code へ
kono
parents: 582
diff changeset
31 __code
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
32 throw(interface1 arg,int i,int j)
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
33 {
581
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
34 char *space = (char *)malloc(ENVSIZE)+ENVSIZE;
582
3f60e599cc04 *** empty log message ***
kono
parents: 581
diff changeset
35 printf("%d %d %d %d %d\n",arg.last,arg.a,arg.c[99],i,j);
581
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
36 arg.last=97;
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
37 goto throw1(arg,i,75),space;
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
38 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
39
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
40 void
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
41 setup(interface1 *arg)
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
42 {
582
3f60e599cc04 *** empty log message ***
kono
parents: 581
diff changeset
43 for(register int i=0;i<100;i++) arg->c[i]=i;
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
44 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
45
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
46 int
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
47 main0()
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
48 {
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
49 interface1 arg;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
50
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
51 arg.a = 3;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
52 arg.b = 55;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
53 setup(&arg);
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
54 arg.c[99] = 66;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
55 arg.last = 96;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
56
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
57 printf("main0\n");
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
58 ret = return;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
59 env = environment;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
60
582
3f60e599cc04 *** empty log message ***
kono
parents: 581
diff changeset
61 goto throw(arg,-7,76);
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
62 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
63
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
64 int
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
65 main1()
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
66 {
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
67 int dummy;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
68 int dummy1;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
69 interface1 arg;
581
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
70 char *space = (char *)malloc(ENVSIZE)+ENVSIZE;
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
71
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
72 arg.a = 3;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
73 arg.b = 55;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
74 setup(&arg);
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
75 arg.c[99] = 66;
581
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
76 arg.last=98;
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
77
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
78 printf("main1\n");
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
79 ret = return;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
80 env = environment;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
81
582
3f60e599cc04 *** empty log message ***
kono
parents: 581
diff changeset
82 goto throw1(arg,-6,77),space;
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
83 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
84
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
85 int
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
86 main2()
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
87 {
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
88 int dummy;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
89 interface1 arg;
581
ad9ef203f95b *** empty log message ***
kono
parents: 580
diff changeset
90 char *space = (char *)malloc(ENVSIZE)+ENVSIZE;
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
91
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
92 arg.a = 3;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
93 arg.b = 55;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
94 setup(&arg);
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
95 arg.c[99] = 66;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
96 arg.last=99;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
97
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
98 printf("main2\n");
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
99 ret = return;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
100 env = environment;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
101
582
3f60e599cc04 *** empty log message ***
kono
parents: 581
diff changeset
102 goto throw1(arg,-5,78);
580
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
103 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
104
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
105 int
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
106 main()
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
107 {
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
108 main0();
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
109 main1();
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
110 main2();
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
111 return 0;
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
112 }
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
113
31b736fb4516 *** empty log message ***
kono
parents:
diff changeset
114 /* end */