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