Mercurial > hg > CbC > old > device
view test/tmp6.c @ 739:0c7a6ae119ba
i64 continue... compiler compiled.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 22:22:46 +0900 |
parents | 3f1f6c0610c1 |
children | c2c709727221 |
line wrap: on
line source
#define __environment _CbC_environment #define __return _CbC_return #include "stdio.h" char *a[] = {"test1","2"}; int main(ac,av) int ac; char *av[]; { int i; if(ac!=2) { fprintf(stdout,"#0012:a used.\n"); // return(0); i=main0(2,a,__return,__environment); return 0; } i=main0(ac,av,__return,__environment); fprintf(stdout,"#0018:1: %s %d\n",av[0],i); return 0; } int main0(ac,av,ret,retenv) int ac; char *av[]; __code (*ret)(); void *retenv; { int i,j,k; i=123; j=456; k = atoi(av[1]); fprintf(stdout,"#0033:2: av=%x av[0]=%x %s\n",av==a,av[0]==a[0],av[0]); goto code0(i,j,k,av,ret,retenv,__return,__environment); } __code code0(i,j,k,av,ret,retenv,ret1,ret1env) int i,j,k; char *av[]; __code (*ret)(); void *retenv; __code (*ret1)(); void *ret1env; { char *p; p = av[0]; fprintf(stdout,"#0047:code0\n",av[0]); goto code1(i,j,k,av,ret,retenv,ret1,ret1env); } __code code1(i,j,k,av,ret,retenv,ret1,ret1env) int i,j,k; char *av[]; __code (*ret)(); void *retenv; __code (*ret1)(); void *ret1env; { fprintf(stdout,"#0059:4: %s\n",av[0]); goto code2(i,j,k,av,ret,retenv,ret1,ret1env); } __code code2(i,j,k,av,ret,retenv,ret1,ret1env) int i,j,k; char *av[]; __code (*ret)(); void *retenv; __code (*ret1)(); void *ret1env; { fprintf(stdout,"#0071:5: %s\n",av[0]); fprintf(stdout,"#0072:5: i=%d j=%d k=%d av=%x\n",i,j,k,av==a); if (k>3) goto (*ret1)(1234,ret1env); goto (*ret)(1234,retenv); }