Mercurial > hg > CbC > old > device
diff test/goto.c @ 79:82d0e30f61dd
*** empty log message ***
author | kono |
---|---|
date | Mon, 03 Mar 2003 04:56:51 +0900 |
parents | |
children | 83d901658ce9 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/goto.c Mon Mar 03 04:56:51 2003 +0900 @@ -0,0 +1,45 @@ + + +code (*conv)(int,code (*)()); +code a2(int i,code conv()); +code a3(int i,code conv()); +code a4(int i,code conv()); +code a5(int i,code conv()); + +code (*exit0)(int); +void *env; + +code +a2(int i,code conv()) +{ + printf("%d %x\n",i,conv); + goto conv(i+1,a4); +} + +code +a3(int i,code (*conv)()) +{ + printf("%d %x\n",i,conv); + goto conv(i+1,a5); +} + +code +a4(int i,code conv()) +{ + printf("%d %x\n",i,conv); + goto (*conv)(i+1,exit0); +} + +code +a5(int i,code (*conv)()) +{ + printf("%d %x\n",i,conv); + goto (*conv)(i+1),env; +} + +main(int ac,char *av[]) { + exit0 = return; + env = environment; + conv = a2; + goto conv(1,a3); +}