diff --git a/CHANGELOG.org b/CHANGELOG.org index e012fc9..eabee4a 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -28,6 +28,8 @@ Converted weird_string collection into a simpler form Inlined 2 small stubs as breaking them out wouldn't help implementation Reordered conditionals for easier implementation and reduced operations Broke out OUT and FUNCTION to silence a single GCC warning +Moved required_match and line_error into cc_core.c and removed required_match.c +Relocated contents of test/functions to functions ** Fixed Fixed detection of locals to screen out all non-primitive name space collisions diff --git a/cc_core.c b/cc_core.c index 3845503..690f08b 100644 --- a/cc_core.c +++ b/cc_core.c @@ -41,8 +41,9 @@ struct type* last_type; char* parse_string(char* string); int escape_lookup(char* c); char* numerate_number(int a); -void require_match(char* message, char* required); -void line_error(); + + + struct token_list* emit(char *s, struct token_list* head) { @@ -54,7 +55,7 @@ struct token_list* emit(char *s, struct token_list* head) void emit_out(char* s) { - out = emit(s, out); + out = emit(s, out); } struct token_list* uniqueID(char* s, struct token_list* l, char* num) @@ -68,13 +69,9 @@ struct token_list* uniqueID(char* s, struct token_list* l, char* num) void uniqueID_out(char* s, char* num) { - emit_out(s); - emit_out("_"); - emit_out(num); - emit_out("\n"); + out = uniqueID(s, out, num); } - struct token_list* sym_declare(char *s, struct type* t, struct token_list* list) { struct token_list* a = calloc(1, sizeof(struct token_list)); @@ -94,6 +91,25 @@ struct token_list* sym_lookup(char *s, struct token_list* symbol_list) return NULL; } +void line_error() +{ + file_print("In file: ", stderr); + file_print(global_token->filename, stderr); + file_print(" On line: ", stderr); + file_print(numerate_number(global_token->linenumber), stderr); +} + +void require_match(char* message, char* required) +{ + if(!match(global_token->s, required)) + { + file_print(message, stderr); + line_error(); + exit(EXIT_FAILURE); + } + global_token = global_token->next; +} + void expression(); void function_call(char* s, int bool) { @@ -162,7 +178,10 @@ void variable_load(struct token_list* a) emit_out("LOAD_BASE_ADDRESS_eax %"); emit_out(numerate_number(a->depth)); emit_out("\n"); - if(!match("=", global_token->s) && !match("char**", a->type->name)) emit_out("LOAD_INTEGER\n"); + if(match("=", global_token->s)) return; + if(match("char**", a->type->name)) return; + + emit_out("LOAD_INTEGER\n"); } void function_load(struct token_list* a) @@ -209,6 +228,7 @@ void primary_expr_failure() void primary_expr_string() { char* number_string = numerate_number(current_count); + current_count = current_count + 1; emit_out("LOAD_IMMEDIATE_eax &STRING_"); uniqueID_out(function->s, number_string); @@ -219,21 +239,12 @@ void primary_expr_string() /* Parse the string */ strings_list = emit(parse_string(global_token->s), strings_list); global_token = global_token->next; - - current_count = current_count + 1; } void primary_expr_char() { emit_out("LOAD_IMMEDIATE_eax %"); - if('\\' == global_token->s[1]) - { - emit_out(numerate_number(escape_lookup(global_token->s + 1))); - } - else - { - emit_out(numerate_number(global_token->s[1])); - } + emit_out(numerate_number(escape_lookup(global_token->s + 1))); emit_out("\n"); global_token = global_token->next; } @@ -1099,9 +1110,10 @@ new_type: if (NULL == global_token) return out; if(match("CONSTANT", global_token->s)) { - global_constant_list = sym_declare(global_token->next->s, NULL, global_constant_list); - global_constant_list->arguments = global_token->next->next; - global_token = global_token->next->next->next; + global_token = global_token->next; + global_constant_list = sym_declare(global_token->s, NULL, global_constant_list); + global_constant_list->arguments = global_token->next; + global_token = global_token->next->next; } else { diff --git a/test/functions/calloc.c b/functions/calloc.c similarity index 100% rename from test/functions/calloc.c rename to functions/calloc.c diff --git a/test/functions/exit.c b/functions/exit.c similarity index 100% rename from test/functions/exit.c rename to functions/exit.c diff --git a/test/functions/file.c b/functions/file.c similarity index 100% rename from test/functions/file.c rename to functions/file.c diff --git a/test/functions/file_print.c b/functions/file_print.c similarity index 100% rename from test/functions/file_print.c rename to functions/file_print.c diff --git a/test/functions/getchar.c b/functions/getchar.c similarity index 100% rename from test/functions/getchar.c rename to functions/getchar.c diff --git a/test/functions/libc-core.M1 b/functions/libc-core.M1 similarity index 100% rename from test/functions/libc-core.M1 rename to functions/libc-core.M1 diff --git a/test/functions/malloc.c b/functions/malloc.c similarity index 100% rename from test/functions/malloc.c rename to functions/malloc.c diff --git a/test/functions/match.c b/functions/match.c similarity index 100% rename from test/functions/match.c rename to functions/match.c diff --git a/test/functions/numerate_number.c b/functions/numerate_number.c similarity index 100% rename from test/functions/numerate_number.c rename to functions/numerate_number.c diff --git a/test/functions/putchar.c b/functions/putchar.c similarity index 100% rename from test/functions/putchar.c rename to functions/putchar.c diff --git a/functions/require_match.c b/functions/require_match.c deleted file mode 100644 index a13ba4f..0000000 --- a/functions/require_match.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2016 Jeremiah Orians - * This file is part of stage0. - * - * stage0 is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * stage0 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with stage0. If not, see . - */ -#include "../cc.h" -char* numerate_number(int a); - -void line_error() -{ - file_print("In file: ", stderr); - file_print(global_token->filename, stderr); - file_print(" On line: ", stderr); - file_print(numerate_number(global_token->linenumber), stderr); -} - -void require_match(char* message, char* required) -{ - if(!match(global_token->s, required)) - { - file_print(message, stderr); - line_error(); - exit(EXIT_FAILURE); - } - global_token = global_token->next; -} diff --git a/test/functions/stat.c b/functions/stat.c similarity index 100% rename from test/functions/stat.c rename to functions/stat.c diff --git a/test/functions/string.c b/functions/string.c similarity index 100% rename from test/functions/string.c rename to functions/string.c diff --git a/test/functions/uname.c b/functions/uname.c similarity index 100% rename from test/functions/uname.c rename to functions/uname.c diff --git a/makefile b/makefile index ab8d140..80136cd 100644 --- a/makefile +++ b/makefile @@ -8,11 +8,10 @@ CFLAGS=-D_GNU_SOURCE -O0 -std=c99 -ggdb M2-Planet-gcc: cc_reader.c cc_strings.c cc_core.c cc.c cc_types.c cc.h | bin $(CC) $(CFLAGS) \ - test/functions/match.c \ - test/functions/numerate_number.c \ - test/functions/file_print.c \ - test/functions/string.c \ - functions/require_match.c \ + functions/match.c \ + functions/numerate_number.c \ + functions/file_print.c \ + functions/string.c \ cc_reader.c \ cc_strings.c \ cc_types.c \ diff --git a/test/test.answers b/test/test.answers index 80ef5ad..eee870a 100644 --- a/test/test.answers +++ b/test/test.answers @@ -9,7 +9,7 @@ b45fae655b7f848b28ebdb8eb2e30ae789fbcf7920bc315395d53986bb1adae4 test/results/t d511db73158a9544a5b5f828a79751e3de8a04b81c143fd0c146fc22c938aa9f test/results/test08-binary 907e1808f2e2b15ac72ebf13898b15c678e68ebd43d673dcd0f408d907e7962f test/results/test09-binary ef179cd359ba1d61d45089e314cd4ac2069c8dc4dd7494d7c766344ea3c8cf88 test/results/test10-binary -0c76566ec86a381af8f2a1eb38bcb48d7dcaeaaa2bb03599b0b3043ad546e657 test/results/test100-binary +bf1d76df4d3e701c420e031910ca0da3f390fb3b6d198a0b93349bdbc285adb7 test/results/test100-binary 5aaf399fe706d4a8c85c121c75ada29a65c293b57c98e8999961a2ef0bab0d62 test/results/test11-binary 4f8111e73e07255ae203963438c82ea8bcff7474e1594b52b426c58a03cb30eb test/results/test12-binary dd74dabfdce8657ff440c1eef531cbf67a64854f2020d4d6bcb65c9cc2d199cb test/results/test13-binary diff --git a/test/test00/hello.sh b/test/test00/hello.sh index 9cc7297..95d87ea 100755 --- a/test/test00/hello.sh +++ b/test/test00/hello.sh @@ -6,7 +6,7 @@ bin/M2-Planet -f test/test00/return.c \ # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test00/return.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test01/hello.sh b/test/test01/hello.sh index 2b13fb8..f6c0d7e 100755 --- a/test/test01/hello.sh +++ b/test/test01/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test01/library_call.c \ -o test/test01/library_call.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test01/library_call.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test02/hello.sh b/test/test02/hello.sh index 5031017..f908b49 100755 --- a/test/test02/hello.sh +++ b/test/test02/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test02/if.c \ -o test/test02/if.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test02/if.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test03/hello.sh b/test/test03/hello.sh index 9424abe..31cbfc1 100755 --- a/test/test03/hello.sh +++ b/test/test03/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test03/constant.c \ -o test/test03/constant.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test03/constant.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test04/hello.sh b/test/test04/hello.sh index 415aa73..84025cd 100755 --- a/test/test04/hello.sh +++ b/test/test04/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test04/call.c \ -o test/test04/call.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test04/call.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test05/hello.sh b/test/test05/hello.sh index f86ff7e..7f6c670 100755 --- a/test/test05/hello.sh +++ b/test/test05/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test05/string.c \ -o test/test05/string.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test05/string.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test06/hello.sh b/test/test06/hello.sh index d98a04c..5256fa6 100755 --- a/test/test06/hello.sh +++ b/test/test06/hello.sh @@ -1,13 +1,13 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/putchar.c \ +bin/M2-Planet -f functions/putchar.c \ -f test/test06/for.c \ -o test/test06/for.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test06/for.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test07/hello.sh b/test/test07/hello.sh index 6281e3c..34a5bce 100755 --- a/test/test07/hello.sh +++ b/test/test07/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test07/do.c \ -o test/test07/do.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test07/do.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test08/hello.sh b/test/test08/hello.sh index 2b92ff8..8d01f45 100755 --- a/test/test08/hello.sh +++ b/test/test08/hello.sh @@ -1,15 +1,15 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ - -f test/functions/malloc.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ + -f functions/malloc.c \ -f test/test08/struct.c \ -o test/test08/struct.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test08/struct.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test09/hello.sh b/test/test09/hello.sh index e48b3e7..3925732 100755 --- a/test/test09/hello.sh +++ b/test/test09/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test09/goto.c \ -o test/test09/goto.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test09/goto.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test10/hello.sh b/test/test10/hello.sh index 58a689e..5a1c4ec 100755 --- a/test/test10/hello.sh +++ b/test/test10/hello.sh @@ -1,15 +1,15 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ - -f test/functions/malloc.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ + -f functions/malloc.c \ -f test/test10/nested_struct.c \ -o test/test10/nested_struct.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test10/nested_struct.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test100/hello.sh b/test/test100/hello.sh index 7b8f9ca..1a736a3 100755 --- a/test/test100/hello.sh +++ b/test/test100/hello.sh @@ -3,36 +3,34 @@ set -ex # Build the test if [ -f bin/M2-Planet ] then -./bin/M2-Planet -f test/functions/file.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/exit.c \ - -f test/functions/match.c \ - -f test/functions/numerate_number.c \ - -f test/functions/file_print.c \ - -f test/functions/string.c \ +./bin/M2-Planet -f functions/file.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/exit.c \ + -f functions/match.c \ + -f functions/numerate_number.c \ + -f functions/file_print.c \ + -f functions/string.c \ -f cc.h \ -f cc_reader.c \ -f cc_strings.c \ -f cc_types.c \ - -f functions/require_match.c \ -f cc_core.c \ -f cc.c \ -o test/test100/cc.M1 || exit 1 else -./bin/M2-Planet-gcc -f test/functions/file.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/exit.c \ - -f test/functions/match.c \ - -f test/functions/numerate_number.c \ - -f test/functions/file_print.c \ - -f test/functions/string.c \ +./bin/M2-Planet-gcc -f functions/file.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/exit.c \ + -f functions/match.c \ + -f functions/numerate_number.c \ + -f functions/file_print.c \ + -f functions/string.c \ -f cc.h \ -f cc_reader.c \ -f cc_strings.c \ -f cc_types.c \ - -f functions/require_match.c \ -f cc_core.c \ -f cc.c \ -o test/test100/cc.M1 || exit 1 @@ -40,7 +38,7 @@ fi # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test100/cc.M1 \ --LittleEndian \ --Architecture 1 \ @@ -53,19 +51,18 @@ hex2 -f test/common_x86/ELF-i386.hex2 -f test/test100/cc.hex2 --LittleEndian --A if [ "$(get_machine)" = "x86_64" ] then # Verify that the resulting file works - ./test/results/test100-binary -f test/functions/file.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/exit.c \ - -f test/functions/match.c \ - -f test/functions/numerate_number.c \ - -f test/functions/file_print.c \ - -f test/functions/string.c \ + ./test/results/test100-binary -f functions/file.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/exit.c \ + -f functions/match.c \ + -f functions/numerate_number.c \ + -f functions/file_print.c \ + -f functions/string.c \ -f cc.h \ -f cc_reader.c \ -f cc_strings.c \ -f cc_types.c \ - -f functions/require_match.c \ -f cc_core.c \ -f cc.c \ -o test/test100/proof || exit 4 diff --git a/test/test100/proof.answer b/test/test100/proof.answer index 156f828..f22b371 100644 --- a/test/test100/proof.answer +++ b/test/test100/proof.answer @@ -1 +1 @@ -51c04355c67377e568bb99ee66dce3318a2ac8f9f0b1d86c9021f6f46a2ea5bf test/test100/proof +3243a9d889030bcdb2d8f7dfde62c41a3d5bd2bdf944328c2eccf1d9a3a7592e test/test100/proof diff --git a/test/test11/hello.sh b/test/test11/hello.sh index 4d79d67..5957602 100755 --- a/test/test11/hello.sh +++ b/test/test11/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test11/break-do.c \ -o test/test11/break-do.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test11/break-do.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test12/hello.sh b/test/test12/hello.sh index af67266..17183b2 100755 --- a/test/test12/hello.sh +++ b/test/test12/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test12/break-for.c \ -o test/test12/break-for.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test12/break-for.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test13/hello.sh b/test/test13/hello.sh index 51e0644..7d79037 100755 --- a/test/test13/hello.sh +++ b/test/test13/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ -f test/test13/break-while.c \ -o test/test13/break-while.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test13/break-while.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test14/hello.sh b/test/test14/hello.sh index c26d7de..afd9d87 100755 --- a/test/test14/hello.sh +++ b/test/test14/hello.sh @@ -1,13 +1,13 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/putchar.c \ +bin/M2-Planet -f functions/putchar.c \ -f test/test14/basic_args.c \ -o test/test14/basic_args.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test14/basic_args.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test15/hello.sh b/test/test15/hello.sh index a789c5e..c370134 100755 --- a/test/test15/hello.sh +++ b/test/test15/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/file.c \ - -f test/functions/putchar.c \ +bin/M2-Planet -f functions/file.c \ + -f functions/putchar.c \ -f test/test15/file_read.c \ -o test/test15/file_read.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test15/file_read.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test16/hello.sh b/test/test16/hello.sh index 5f99931..83044ee 100755 --- a/test/test16/hello.sh +++ b/test/test16/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/file.c \ - -f test/functions/putchar.c \ +bin/M2-Planet -f functions/file.c \ + -f functions/putchar.c \ -f test/test16/file_write.c \ -o test/test16/file_write.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test16/file_write.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test17/hello.sh b/test/test17/hello.sh index b214502..f1eb9b0 100755 --- a/test/test17/hello.sh +++ b/test/test17/hello.sh @@ -1,15 +1,15 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/putchar.c \ +bin/M2-Planet -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/putchar.c \ -f test/test17/memset.c \ -o test/test17/memset.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test17/memset.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test18/hello.sh b/test/test18/hello.sh index 1509ec3..be5b22e 100755 --- a/test/test18/hello.sh +++ b/test/test18/hello.sh @@ -1,15 +1,15 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/file.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ +bin/M2-Planet -f functions/file.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ -f test/test18/math.c \ -o test/test18/math.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test18/math.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test19/hello.sh b/test/test19/hello.sh index 7c2cfeb..4816499 100755 --- a/test/test19/hello.sh +++ b/test/test19/hello.sh @@ -1,18 +1,18 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/file.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/exit.c \ - -f test/functions/match.c \ - -f test/functions/numerate_number.c \ +bin/M2-Planet -f functions/file.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/exit.c \ + -f functions/match.c \ + -f functions/numerate_number.c \ -f test/test19/getopt.c \ -o test/test19/getopt.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test19/getopt.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test20/hello.sh b/test/test20/hello.sh index 288eac3..83d0ab1 100755 --- a/test/test20/hello.sh +++ b/test/test20/hello.sh @@ -1,15 +1,15 @@ #! /bin/sh set -x # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/exit.c \ - -f test/functions/malloc.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/exit.c \ + -f functions/malloc.c \ -f test/test20/struct.c \ -o test/test20/struct.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test20/struct.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test21/hello.sh b/test/test21/hello.sh index 4ea863a..ad70410 100755 --- a/test/test21/hello.sh +++ b/test/test21/hello.sh @@ -1,12 +1,12 @@ #! /bin/sh set -x # Build the test -./bin/M2-Planet -f test/functions/exit.c \ - -f test/functions/file.c \ - -f test/functions/file_print.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/match.c \ +./bin/M2-Planet -f functions/exit.c \ + -f functions/file.c \ + -f functions/file_print.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/match.c \ -f test/test21/blood-elf.c \ --debug \ -o test/test21/blood-elf.M1 || exit 1 @@ -17,7 +17,7 @@ blood-elf -f test/test21/blood-elf.M1 \ # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test21/blood-elf.M1 \ -f test/test21/blood-elf-footer.M1 \ --LittleEndian \ diff --git a/test/test22/hello.sh b/test/test22/hello.sh index 044f076..5a9f214 100755 --- a/test/test22/hello.sh +++ b/test/test22/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -./bin/M2-Planet -f test/functions/exit.c \ - -f test/functions/file.c \ - -f test/functions/file_print.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/match.c \ - -f test/functions/numerate_number.c \ - -f test/functions/stat.c \ +./bin/M2-Planet -f functions/exit.c \ + -f functions/file.c \ + -f functions/file_print.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/match.c \ + -f functions/numerate_number.c \ + -f functions/stat.c \ -f test/test22/hex2_linker.c \ --debug \ -o test/test22/hex2_linker.M1 || exit 1 @@ -19,7 +19,7 @@ blood-elf -f test/test22/hex2_linker.M1 \ # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test22/hex2_linker.M1 \ -f test/test22/hex2_linker-footer.M1 \ --LittleEndian \ diff --git a/test/test23/hello.sh b/test/test23/hello.sh index 7d43156..4c6e6f2 100755 --- a/test/test23/hello.sh +++ b/test/test23/hello.sh @@ -1,14 +1,14 @@ #! /bin/sh set -x # Build the test -./bin/M2-Planet -f test/functions/exit.c \ - -f test/functions/file.c \ - -f test/functions/file_print.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/match.c \ - -f test/functions/numerate_number.c \ - -f test/functions/string.c \ +./bin/M2-Planet -f functions/exit.c \ + -f functions/file.c \ + -f functions/file_print.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/match.c \ + -f functions/numerate_number.c \ + -f functions/string.c \ -f test/test23/M1-macro.c \ --debug \ -o test/test23/M1-macro.M1 || exit 1 @@ -19,7 +19,7 @@ blood-elf -f test/test23/M1-macro.M1 \ # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test23/M1-macro.M1 \ -f test/test23/M1-macro-footer.M1 \ --LittleEndian \ @@ -46,7 +46,7 @@ then # Verify that the resulting file works ./test/results/test23-binary -f \ test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test21/test.M1 \ --LittleEndian \ --Architecture 1 \ diff --git a/test/test24/hello.sh b/test/test24/hello.sh index b0ba91d..90824aa 100755 --- a/test/test24/hello.sh +++ b/test/test24/hello.sh @@ -1,12 +1,12 @@ #! /bin/sh set -x # Build the test -./bin/M2-Planet -f test/functions/exit.c \ - -f test/functions/file.c \ - -f test/functions/file_print.c \ - -f test/functions/malloc.c \ - -f test/functions/calloc.c \ - -f test/functions/uname.c \ +./bin/M2-Planet -f functions/exit.c \ + -f functions/file.c \ + -f functions/file_print.c \ + -f functions/malloc.c \ + -f functions/calloc.c \ + -f functions/uname.c \ -f test/test24/get_machine.c \ --debug \ -o test/test24/get_machine.M1 || exit 1 @@ -17,7 +17,7 @@ blood-elf -f test/test24/get_machine.M1 \ # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test24/get_machine.M1 \ -f test/test24/get_machine-footer.M1 \ --LittleEndian \ diff --git a/test/test99/hello.sh b/test/test99/hello.sh index 17053b7..72d353c 100755 --- a/test/test99/hello.sh +++ b/test/test99/hello.sh @@ -1,16 +1,16 @@ #! /bin/sh set -ex # Build the test -bin/M2-Planet -f test/functions/putchar.c \ - -f test/functions/getchar.c \ - -f test/functions/exit.c \ - -f test/functions/malloc.c \ +bin/M2-Planet -f functions/putchar.c \ + -f functions/getchar.c \ + -f functions/exit.c \ + -f functions/malloc.c \ -f test/test99/cc500.c \ -o test/test99/cc0.M1 || exit 1 # Macro assemble with libc written in M1-Macro M1 -f test/common_x86/x86_defs.M1 \ - -f test/functions/libc-core.M1 \ + -f functions/libc-core.M1 \ -f test/test99/cc0.M1 \ --LittleEndian \ --Architecture 1 \