Mercurial > hg > CbC > old > device
annotate test/throw.c @ 775:a2a7b2835fa3
ia32 regression test
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 18 Nov 2010 21:25:30 +0900 |
parents | c2c709727221 |
children |
rev | line source |
---|---|
580 | 1 |
2 extern int printf(const char *,...); | |
720 | 3 extern void *malloc(int); |
580 | 4 |
622 | 5 __code (*ret)(); |
580 | 6 void *env; |
7 | |
8 #define ENVSIZE (1<<14) | |
9 | |
10 typedef | |
11 struct interface1 { | |
12 int a; | |
13 int b; | |
14 char c[100]; | |
15 int last; | |
16 } interface1; | |
17 | |
622 | 18 __code |
580 | 19 throw2(interface1 arg,int i,int j) |
20 { | |
21 goto ret(3),env; | |
22 } | |
23 | |
622 | 24 __code |
580 | 25 throw1(interface1 arg,int i,int j) |
26 { | |
748
c2c709727221
i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
720
diff
changeset
|
27 printf("#0026:%d %d %d %d %d\n",arg.last,arg.a,arg.c[99],i,j); |
581 | 28 arg.last=96; |
29 goto throw2(arg,i,74); | |
580 | 30 } |
31 | |
622 | 32 __code |
580 | 33 throw(interface1 arg,int i,int j) |
34 { | |
581 | 35 char *space = (char *)malloc(ENVSIZE)+ENVSIZE; |
748
c2c709727221
i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
720
diff
changeset
|
36 printf("#0035:%d %d %d %d %d\n",arg.last,arg.a,arg.c[99],i,j); |
581 | 37 arg.last=97; |
38 goto throw1(arg,i,75),space; | |
580 | 39 } |
40 | |
41 void | |
42 setup(interface1 *arg) | |
43 { | |
720 | 44 register int i; |
45 for(i=0;i<100;i++) arg->c[i]=i; | |
580 | 46 } |
47 | |
48 int | |
49 main0() | |
50 { | |
51 interface1 arg; | |
52 | |
53 arg.a = 3; | |
54 arg.b = 55; | |
55 setup(&arg); | |
56 arg.c[99] = 66; | |
57 arg.last = 96; | |
58 | |
748
c2c709727221
i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
720
diff
changeset
|
59 printf("#0058:main0\n"); |
720 | 60 ret = __return; |
61 env = __environment; | |
580 | 62 |
582 | 63 goto throw(arg,-7,76); |
580 | 64 } |
65 | |
66 int | |
67 main1() | |
68 { | |
69 int dummy; | |
70 int dummy1; | |
71 interface1 arg; | |
581 | 72 char *space = (char *)malloc(ENVSIZE)+ENVSIZE; |
580 | 73 |
74 arg.a = 3; | |
75 arg.b = 55; | |
76 setup(&arg); | |
77 arg.c[99] = 66; | |
581 | 78 arg.last=98; |
580 | 79 |
748
c2c709727221
i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
720
diff
changeset
|
80 printf("#0079:main1\n"); |
720 | 81 ret = __return; |
82 env = __environment; | |
580 | 83 |
582 | 84 goto throw1(arg,-6,77),space; |
580 | 85 } |
86 | |
87 int | |
88 main2() | |
89 { | |
90 int dummy; | |
91 interface1 arg; | |
581 | 92 char *space = (char *)malloc(ENVSIZE)+ENVSIZE; |
580 | 93 |
94 arg.a = 3; | |
95 arg.b = 55; | |
96 setup(&arg); | |
97 arg.c[99] = 66; | |
98 arg.last=99; | |
99 | |
748
c2c709727221
i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
720
diff
changeset
|
100 printf("#0099:main2\n"); |
720 | 101 ret = __return; |
102 env = __environment; | |
580 | 103 |
582 | 104 goto throw1(arg,-5,78); |
580 | 105 } |
106 | |
107 int | |
108 main() | |
109 { | |
110 main0(); | |
111 main1(); | |
112 main2(); | |
113 return 0; | |
114 } | |
115 | |
116 /* end */ |