Mercurial > hg > CbC > old > device
view test/ret_check.c @ 606:1e29742ea9a6
*** empty log message ***
author | kono |
---|---|
date | Wed, 01 Feb 2006 07:12:03 +0900 |
parents | df04bc5fd5fe |
children | 682c8ec38d45 |
line wrap: on
line source
extern int printf(char *,...); #ifdef __micro_c__ code(*f_incl_ret)(int); void *f_incl_env; code f_incl2(int a0) { // 正しいのはコッチ printf("#0010:%d\n",a0); goto f_incl_ret(a0),f_incl_env; } code f_incl2_test(float a0) { // ret先のinterface型が異なる printf("#0017:%g\n",a0); goto f_incl_ret(a0),f_incl_env; } code f_incl1(int a0,code(*ret)(int)) { printf("#0024:%d\n",a0); goto ret(a0*a0); } int f_incl0(int a0) { f_incl_ret=return; f_incl_env=environment; printf("#0033:%d\n",a0); goto f_incl1(a0,f_incl2); } int f_incl0_test(int a0) { f_incl_ret=return; f_incl_env=environment; printf("#0033:%d\n",a0); goto f_incl1(a0,f_incl2_test); } #else int f_incl0(int a0) { printf("#0042:%d\n",a0); return a0; } int f_incl0_test(int a0) { printf("#0042:%d\n",a0); return a0; } #endif int g_incl2(int a0) { printf("#0051:%d\n",a0); return a0; } int g_incl2_test(float a0) { printf("#0058:%g\n",a0); return (int) a0; } int g_incl1(int a0,int (*ret)(int)) { return ret(a0); } int main() { int f0=f_incl0(10); printf("#0066:%d\n",f0); printf("#0066:%d\n",f_incl0_test(11)); printf("#0067:%d\n",g_incl1(12,g_incl2)); printf("#0068:%d\n",g_incl1(13,g_incl2_test)); return 0; } /* end */