Mercurial > hg > CbC > old > device
view test/throw.c @ 691:25115b50d033
*** empty log message ***
author | kono |
---|---|
date | Wed, 10 Oct 2007 17:58:15 +0900 (2007-10-10) |
parents | 682c8ec38d45 |
children | 6b7372e17970 |
line wrap: on
line source
extern int printf(const char *,...); __code (*ret)(); void *env; #define ENVSIZE (1<<14) typedef struct interface1 { int a; int b; char c[100]; int last; } interface1; __code throw2(interface1 arg,int i,int j) { goto ret(3),env; } __code throw1(interface1 arg,int i,int j) { printf("%d %d %d %d %d\n",arg.last,arg.a,arg.c[99],i,j); arg.last=96; goto throw2(arg,i,74); } __code throw(interface1 arg,int i,int j) { char *space = (char *)malloc(ENVSIZE)+ENVSIZE; printf("%d %d %d %d %d\n",arg.last,arg.a,arg.c[99],i,j); arg.last=97; goto throw1(arg,i,75),space; } void setup(interface1 *arg) { for(register int i=0;i<100;i++) arg->c[i]=i; } int main0() { interface1 arg; arg.a = 3; arg.b = 55; setup(&arg); arg.c[99] = 66; arg.last = 96; printf("main0\n"); ret = return; env = environment; goto throw(arg,-7,76); } int main1() { int dummy; int dummy1; interface1 arg; char *space = (char *)malloc(ENVSIZE)+ENVSIZE; arg.a = 3; arg.b = 55; setup(&arg); arg.c[99] = 66; arg.last=98; printf("main1\n"); ret = return; env = environment; goto throw1(arg,-6,77),space; } int main2() { int dummy; interface1 arg; char *space = (char *)malloc(ENVSIZE)+ENVSIZE; arg.a = 3; arg.b = 55; setup(&arg); arg.c[99] = 66; arg.last=99; printf("main2\n"); ret = return; env = environment; goto throw1(arg,-5,78); } int main() { main0(); main1(); main2(); return 0; } /* end */