From: j8takagi Date: Fri, 18 Mar 2011 15:24:30 +0000 (+0900) Subject: comet2コマンドのシステムテストで、オブジェクトファイルを直接実行するテストを追加 X-Git-Tag: v0.1p25~1 X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=commitdiff_plain;h=641024682d02a49ea9fed303c2f6db4b4bd1d9c1 comet2コマンドのシステムテストで、オブジェクトファイルを直接実行するテストを追加 directを追加し、err_209とerr_210を変更 --- diff --git a/test/system/comet2/direct/0.txt b/test/system/comet2/direct/0.txt new file mode 100644 index 0000000..862935c --- /dev/null +++ b/test/system/comet2/direct/0.txt @@ -0,0 +1,143 @@ + +Executing machine codes +#0000: Register:::: +#0000: GR0: 0 = #0000 = 0000000000000000 +#0000: GR1: 0 = #0000 = 0000000000000000 +#0000: GR2: 0 = #0000 = 0000000000000000 +#0000: GR3: 0 = #0000 = 0000000000000000 +#0000: GR4: 0 = #0000 = 0000000000000000 +#0000: GR5: 0 = #0000 = 0000000000000000 +#0000: GR6: 0 = #0000 = 0000000000000000 +#0000: GR7: 0 = #0000 = 0000000000000000 +#0000: SP: 512 = #0200 = 0000001000000000 +#0000: PR: 0 = #0000 = 0000000000000000 +#0000: FR (OF SF ZF): 000 +#0000: Memory:::: +#0000: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F +#0000: 0000: 1010 0005 2210 0006 8100 0003 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0010: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0050: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0060: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0070: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0080: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0090: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 00A0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 00B0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 00C0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 00D0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 00E0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 00F0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0100: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0110: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0120: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0130: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0140: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0150: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0160: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0170: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0180: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 0190: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 01A0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 01B0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 01C0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 01D0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 01E0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0000: 01F0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 + +#0002: Register:::: +#0002: GR0: 0 = #0000 = 0000000000000000 +#0002: GR1: 3 = #0003 = 0000000000000011 +#0002: GR2: 0 = #0000 = 0000000000000000 +#0002: GR3: 0 = #0000 = 0000000000000000 +#0002: GR4: 0 = #0000 = 0000000000000000 +#0002: GR5: 0 = #0000 = 0000000000000000 +#0002: GR6: 0 = #0000 = 0000000000000000 +#0002: GR7: 0 = #0000 = 0000000000000000 +#0002: SP: 512 = #0200 = 0000001000000000 +#0002: PR: 2 = #0002 = 0000000000000010 +#0002: FR (OF SF ZF): 000 +#0002: Memory:::: +#0002: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F +#0002: 0000: 1010 0005 2210 0006 8100 0003 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0010: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0050: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0060: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0070: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0080: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0090: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 00A0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 00B0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 00C0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 00D0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 00E0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 00F0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0100: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0110: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0120: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0130: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0140: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0150: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0160: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0170: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0180: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 0190: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 01A0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 01B0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 01C0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 01D0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 01E0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0002: 01F0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 + +#0004: Register:::: +#0004: GR0: 0 = #0000 = 0000000000000000 +#0004: GR1: 4 = #0004 = 0000000000000100 +#0004: GR2: 0 = #0000 = 0000000000000000 +#0004: GR3: 0 = #0000 = 0000000000000000 +#0004: GR4: 0 = #0000 = 0000000000000000 +#0004: GR5: 0 = #0000 = 0000000000000000 +#0004: GR6: 0 = #0000 = 0000000000000000 +#0004: GR7: 0 = #0000 = 0000000000000000 +#0004: SP: 512 = #0200 = 0000001000000000 +#0004: PR: 4 = #0004 = 0000000000000100 +#0004: FR (OF SF ZF): 000 +#0004: Memory:::: +#0004: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F +#0004: 0000: 1010 0005 2210 0006 8100 0003 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0010: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0050: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0060: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0070: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0080: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0090: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 00A0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 00B0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 00C0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 00D0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 00E0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 00F0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0100: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0110: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0120: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0130: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0140: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0150: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0160: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0170: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0180: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 0190: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 01A0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 01B0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 01C0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 01D0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 01E0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +#0004: 01F0: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 + diff --git a/test/system/comet2/direct/Makefile b/test/system/comet2/direct/Makefile new file mode 100644 index 0000000..894b127 --- /dev/null +++ b/test/system/comet2/direct/Makefile @@ -0,0 +1,23 @@ +include ../Define.mk +include ../Test.mk + +CC := gcc +CFLAGS := -Wall +INCLUDEDIR := ../../../../include + +.INTERMEDIATE: create_a a.comet + +a.comet: create_a + ./$^ + +create_a: create_a.c + $(CC) $(CFLAGS) -I $(INCLUDEDIR) -o $@ $^ + +$(CMD_FILE): a.comet + +clean: clean0 + +clean0: + @rm -f create_a + @rm -rf create_a.dSYM + @rm -f a.comet diff --git a/test/system/comet2/direct/cmd b/test/system/comet2/direct/cmd new file mode 100755 index 0000000..8ac1976 --- /dev/null +++ b/test/system/comet2/direct/cmd @@ -0,0 +1 @@ +make a.comet >/dev/null && ../../../../comet2 -td a.comet diff --git a/test/system/comet2/direct/create_a.c b/test/system/comet2/direct/create_a.c new file mode 100644 index 0000000..f6ca333 --- /dev/null +++ b/test/system/comet2/direct/create_a.c @@ -0,0 +1,22 @@ +#include +#include +#include "cmem.h" +#include "word.h" + +/** + * 引数で指定したファイルにアセンブル結果を書込 + */ +int main() +{ + FILE *fp; + const WORD w[] = {0x1010, 0x0005, 0x2210, 0x0006, 0x8100, 0x0003, 0x0001}; + const char *f = "a.comet"; + + if((fp = fopen(f, "w")) == NULL) { + perror(f); + exit(-1); + } + fwrite(w, sizeof(WORD), ARRAYSIZE(w), fp); + fclose(fp); + return 0; +} diff --git a/test/system/comet2/direct/desc.txt b/test/system/comet2/direct/desc.txt new file mode 100644 index 0000000..35c4278 --- /dev/null +++ b/test/system/comet2/direct/desc.txt @@ -0,0 +1 @@ +バイナリファイルを、YACASL2のアセンブルからではなく、直接作成して実行。実行される内容は、cmd_ADDL_addl0と同じ。 diff --git a/test/system/comet2/err_209/Makefile b/test/system/comet2/err_209/Makefile index b6dac59..894b127 100644 --- a/test/system/comet2/err_209/Makefile +++ b/test/system/comet2/err_209/Makefile @@ -1,2 +1,23 @@ include ../Define.mk include ../Test.mk + +CC := gcc +CFLAGS := -Wall +INCLUDEDIR := ../../../../include + +.INTERMEDIATE: create_a a.comet + +a.comet: create_a + ./$^ + +create_a: create_a.c + $(CC) $(CFLAGS) -I $(INCLUDEDIR) -o $@ $^ + +$(CMD_FILE): a.comet + +clean: clean0 + +clean0: + @rm -f create_a + @rm -rf create_a.dSYM + @rm -f a.comet diff --git a/test/system/comet2/err_209/a.comet b/test/system/comet2/err_209/a.comet deleted file mode 100644 index 4b48924..0000000 Binary files a/test/system/comet2/err_209/a.comet and /dev/null differ diff --git a/test/system/comet2/err_209/cmd b/test/system/comet2/err_209/cmd index c64e097..3d423e8 100755 --- a/test/system/comet2/err_209/cmd +++ b/test/system/comet2/err_209/cmd @@ -1 +1 @@ -../../../../comet2 a.comet +make a.comet >/dev/null && ../../../../comet2 a.comet diff --git a/test/system/comet2/err_209/create_a.c b/test/system/comet2/err_209/create_a.c new file mode 100644 index 0000000..4621506 --- /dev/null +++ b/test/system/comet2/err_209/create_a.c @@ -0,0 +1,22 @@ +#include +#include +#include "cmem.h" +#include "word.h" + +/** + * 引数で指定したファイルにアセンブル結果を書込 + */ +int main() +{ + FILE *fp; + const WORD w[] = {0x1010, 0x0005, 0x220f, 0x0006, 0x8100, 0x0003, 0x0001}; + const char *f = "a.comet"; + + if((fp = fopen(f, "w")) == NULL) { + perror(f); + exit(-1); + } + fwrite(w, sizeof(WORD), ARRAYSIZE(w), fp); + fclose(fp); + return 0; +} diff --git a/test/system/comet2/err_210/Makefile b/test/system/comet2/err_210/Makefile index b6dac59..894b127 100644 --- a/test/system/comet2/err_210/Makefile +++ b/test/system/comet2/err_210/Makefile @@ -1,2 +1,23 @@ include ../Define.mk include ../Test.mk + +CC := gcc +CFLAGS := -Wall +INCLUDEDIR := ../../../../include + +.INTERMEDIATE: create_a a.comet + +a.comet: create_a + ./$^ + +create_a: create_a.c + $(CC) $(CFLAGS) -I $(INCLUDEDIR) -o $@ $^ + +$(CMD_FILE): a.comet + +clean: clean0 + +clean0: + @rm -f create_a + @rm -rf create_a.dSYM + @rm -f a.comet diff --git a/test/system/comet2/err_210/a.comet b/test/system/comet2/err_210/a.comet deleted file mode 100644 index 866f0ca..0000000 Binary files a/test/system/comet2/err_210/a.comet and /dev/null differ diff --git a/test/system/comet2/err_210/cmd b/test/system/comet2/err_210/cmd index c64e097..3d423e8 100755 --- a/test/system/comet2/err_210/cmd +++ b/test/system/comet2/err_210/cmd @@ -1 +1 @@ -../../../../comet2 a.comet +make a.comet >/dev/null && ../../../../comet2 a.comet diff --git a/test/system/comet2/err_210/create_a.c b/test/system/comet2/err_210/create_a.c new file mode 100644 index 0000000..619d795 --- /dev/null +++ b/test/system/comet2/err_210/create_a.c @@ -0,0 +1,22 @@ +#include +#include +#include "cmem.h" +#include "word.h" + +/** + * 引数で指定したファイルにアセンブル結果を書込 + */ +int main() +{ + FILE *fp; + const WORD w[] = {0x1010, 0x0005, 0x2810, 0x0006, 0x8100, 0x0003, 0x0001}; + const char *f = "a.comet"; + + if((fp = fopen(f, "w")) == NULL) { + perror(f); + exit(-1); + } + fwrite(w, sizeof(WORD), ARRAYSIZE(w), fp); + fclose(fp); + return 0; +}