view test/goto.c @ 172:096559f07a70

some check
author kono
date Tue, 25 Nov 2003 11:47:41 +0900
parents 83d901658ce9
children ce0c38b6c85e
line wrap: on
line source



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("a2 %d %x\n",i,conv);
    goto conv(i+1,a4);
}

code
a3(int i,code (*conv)())
{
    printf("a3 %d %x\n",i,conv);
    goto conv(i+1,a5);
}

code
a4(int i,code conv())
{
    printf("a4 %d %x\n",i,conv);
    goto (*conv)(i+1,a6);
}

code
a5(int i,code (*conv)())
{
    printf("a5 %d %x\n",i,conv);
    goto (*conv)(i+1,i+2,i+3,a7);
}

code
a6(int i,int j,int k,code conv())
{
    printf("a6 %d %x\n",i,conv);
    goto conv(i+1,j,k,a8);
}

code
a7(int i,,int j,int k,code (*conv)())
{
    printf("a7 %d %x\n",i,conv);
    goto conv(i+1,j,k,a9);
}

code
a8(int i,int j,int k,code conv())
{
    printf("a8 %d %x\n",i,conv);
    goto (*conv)(i+1,j,k,exit0);
}

code
a9(int i,int j,int k,code (*conv)())
{
    printf("a9 %d %x\n",i,conv);
    goto (*conv)(0),env;
}

main(int ac,char *av[]) {
    exit0 = return;
    env   = environment;
    conv = a2;
    goto conv(1,a3);
}