view paper/codes/cbc_example_test.cbc @ 122:a3ff00c33fd7 default tip

update slide
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Wed, 20 Feb 2019 12:05:38 +0900
parents 96e9cf9c2ea2
children
line wrap: on
line source

extern int printf(const char*,...);

typedef struct test_struct {
    int number;
    char* string;
} TEST, *TESTP;


__code cg1(TEST);
__code cg2(TEST);
__code cg3(TEST);

__code cg1(TEST testin){
    TEST testout;
    testout.number = testin.number + 1;
    testout.string = testin.string;
    goto cg2(testout);
}

__code cg2(TEST testin){
    TEST testout;
    testout.number = testin.number;
    testout.string = "Hello";
    goto cg3(testout);
}

__code cg3(TEST testin){
    printf("number = %d\t string= %s\n",testin.number,testin.string);
}

int main(){
    TEST test = {0,0};
    goto cg1(test);
}