changeset 477:308192c08e0a

*** empty log message ***
author kono
date Thu, 10 Nov 2005 14:33:49 +0900
parents 034436187add
children 5e1acbe82483
files Changes Makefile Makefile.linuxzaurus Makefile.mips mc-code-ia32.c test/tmpa.c
diffstat 6 files changed, 56 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 が無限ループ。
+
+
--- 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
--- 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:
--- 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:
--- 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
--- /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 <stdio.h>
+
+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);
+}
+