# HG changeset patch # User kono # Date 1131600829 -32400 # Node ID 308192c08e0ae12d217b8ee4cf2bf68a9af6cba8 # Parent 034436187add0e82c99baae996261198ec41c260 *** empty log message *** diff -r 034436187add -r 308192c08e0a Changes --- a/Changes Tue Nov 08 21:44:20 2005 +0900 +++ b/Changes Thu Nov 10 14:33:49 2005 +0900 @@ -7236,3 +7236,9 @@ 構造体の局所変数の初期化に式を書けない。全部、定数かどうかをチェックする必要あり。 +goto で struct 一つだけを引数にとったときにうまく動作しない.. (っていうか、 +int 以外の引数じゃうまく動作しない )ってバグを直しました。 + +ia32 の emit_copy が無限ループ。 + + diff -r 034436187add -r 308192c08e0a Makefile --- a/Makefile Tue Nov 08 21:44:20 2005 +0900 +++ b/Makefile Thu Nov 10 14:33:49 2005 +0900 @@ -106,6 +106,7 @@ make check-code$(MK) TARGET=test/fact make check-code$(MK) TARGET=test/goto make check-code$(MK) TARGET=test/test1 + make check-code$(MK) TARGET=test/tmpa make check-code$(MK) TARGET=test/tmp1 make check-code$(MK) TARGET=test/tmp2 make check-code$(MK) TARGET=test/tmp4 diff -r 034436187add -r 308192c08e0a Makefile.linuxzaurus --- a/Makefile.linuxzaurus Tue Nov 08 21:44:20 2005 +0900 +++ b/Makefile.linuxzaurus Thu Nov 10 14:33:49 2005 +0900 @@ -108,6 +108,7 @@ make check-code$(MK) TARGET=test/tmp2 make check-code$(MK) TARGET=test/tmp4 make check-code$(MK) TARGET=test/tmp6 + make check-code$(MK) TARGET=test/tmpa make check-code$(MK) TARGET=test/scope check-nkf: diff -r 034436187add -r 308192c08e0a Makefile.mips --- a/Makefile.mips Tue Nov 08 21:44:20 2005 +0900 +++ b/Makefile.mips Thu Nov 10 14:33:49 2005 +0900 @@ -108,6 +108,7 @@ make check-code$(MK) TARGET=test/tmp2 make check-code$(MK) TARGET=test/tmp4 make check-code$(MK) TARGET=test/tmp6 + make check-code$(MK) TARGET=test/tmpa make check-code$(MK) TARGET=test/scope check-nkf: diff -r 034436187add -r 308192c08e0a mc-code-ia32.c --- a/mc-code-ia32.c Tue Nov 08 21:44:20 2005 +0900 +++ b/mc-code-ia32.c Thu Nov 10 14:33:49 2005 +0900 @@ -1407,7 +1407,7 @@ code_drindirect(int e1, int reg,int offset, int d) { g_expr(e1); - printf("\t%s (%s)\n",fload(d),register_name(creg,0)); + printf("\t%s %d(%s)\n",fload(d),offset,register_name(creg,0)); return DOUBLE; } #endif diff -r 034436187add -r 308192c08e0a test/tmpa.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tmpa.c Thu Nov 10 14:33:49 2005 +0900 @@ -0,0 +1,46 @@ +#include + +struct enemy{ + int charno; // image number + float x; // x location + float y; // y location + int ap; // armor point +}; +void +print_param(struct enemy *e) +{ + printf("charno:%d x,y:%f,%f hp:%d\n", + e->charno,e->x,e->y,e->ap); +} + +typedef struct{ + char dest; + int VF01[4]; + code (*ret)(); + void *env; +} interface; + +code a0(interface a) { + printf("%d\n",a.dest); + goto a.ret(0),a.env; +} + + +int main(int argc,char *argv[]) +{ + struct enemy e; +#if 0 + interface args = {15,{0,0,0,0},return,environment}; +#else + interface args = {15,{0,0,0,0},0,0}; + args.ret = return; + args.env = environment; +#endif + + e.charno=5; e.x=50.0; e.y=30.0; e.ap=100; + print_param(&e); + + printf("%d %d\n",args.VF01[2],args.VF01[1]); + goto a0(args); +} +