diff --git a/tests/simple/expect.toml b/tests/simple/expect.toml index 10da65b..6e05d6b 100644 --- a/tests/simple/expect.toml +++ b/tests/simple/expect.toml @@ -2,20 +2,22 @@ # windows powershell: echo $LASTEXITCODE # nushell: echo $env.LAST_EXIT_CODE # bash: echo $? -"./01_return.c" = 65536 -"./02_decl_expr.c" = 1 -"./03_decl_init.c" = 11 -"./04_if.c" = 1 -"./05_else.c" = 2 -"./06_fcall.c" = 3 -"./07_while.c" = 10 -"./08_do_while.c" = 128 -"./09_for.c" = 10 -"./10_main.c" = 3 -"./11_recursive.c" = 120 -"./12_logic.c" = 10 -"./13_array.c" = 1198 -"./14_pointer.c" = 2 -"./15_array_subscript.c" = 1198 -"./16_enum.c" = 5 +"./return_val_cases/01_return.c" = 65536 +"./return_val_cases/02_decl_expr.c" = 1 +"./return_val_cases/03_decl_init.c" = 11 +"./return_val_cases/04_if.c" = 1 +"./return_val_cases/05_else.c" = 2 +"./return_val_cases/06_fcall.c" = 3 +"./return_val_cases/07_while.c" = 10 +"./return_val_cases/08_do_while.c" = 128 +"./return_val_cases/09_for.c" = 10 +"./return_val_cases/10_main.c" = 3 +"./return_val_cases/11_recursive.c" = 120 +"./return_val_cases/12_logic.c" = 10 +"./return_val_cases/13_array.c" = 1198 +"./return_val_cases/14_pointer.c" = 2 +"./return_val_cases/15_array_subscript.c" = 1198 +"./return_val_cases/16_enum.c" = 5 +"./return_val_cases/17_more_arg.c" = 45 [stdout_val_cases] +"./stdout_val_cases/01_include.c" = "Hello World!\n" diff --git a/tests/simple/hard_01.c b/tests/simple/hard_01.c deleted file mode 100644 index 85ad74e..0000000 --- a/tests/simple/hard_01.c +++ /dev/null @@ -1,6 +0,0 @@ -int main() { - int a, b; - a = 1; - b = 2; - return a + b; -} \ No newline at end of file diff --git a/tests/simple/00_main.c b/tests/simple/return_val_cases/00_main.c similarity index 100% rename from tests/simple/00_main.c rename to tests/simple/return_val_cases/00_main.c diff --git a/tests/simple/01_return.c b/tests/simple/return_val_cases/01_return.c similarity index 100% rename from tests/simple/01_return.c rename to tests/simple/return_val_cases/01_return.c diff --git a/tests/simple/02_decl_expr.c b/tests/simple/return_val_cases/02_decl_expr.c similarity index 100% rename from tests/simple/02_decl_expr.c rename to tests/simple/return_val_cases/02_decl_expr.c diff --git a/tests/simple/03_decl_init.c b/tests/simple/return_val_cases/03_decl_init.c similarity index 100% rename from tests/simple/03_decl_init.c rename to tests/simple/return_val_cases/03_decl_init.c diff --git a/tests/simple/04_if.c b/tests/simple/return_val_cases/04_if.c similarity index 100% rename from tests/simple/04_if.c rename to tests/simple/return_val_cases/04_if.c diff --git a/tests/simple/05_else.c b/tests/simple/return_val_cases/05_else.c similarity index 100% rename from tests/simple/05_else.c rename to tests/simple/return_val_cases/05_else.c diff --git a/tests/simple/06_fcall.c b/tests/simple/return_val_cases/06_fcall.c similarity index 100% rename from tests/simple/06_fcall.c rename to tests/simple/return_val_cases/06_fcall.c diff --git a/tests/simple/07_while.c b/tests/simple/return_val_cases/07_while.c similarity index 100% rename from tests/simple/07_while.c rename to tests/simple/return_val_cases/07_while.c diff --git a/tests/simple/08_do_while.c b/tests/simple/return_val_cases/08_do_while.c similarity index 100% rename from tests/simple/08_do_while.c rename to tests/simple/return_val_cases/08_do_while.c diff --git a/tests/simple/09_for.c b/tests/simple/return_val_cases/09_for.c similarity index 100% rename from tests/simple/09_for.c rename to tests/simple/return_val_cases/09_for.c diff --git a/tests/simple/10_main.c b/tests/simple/return_val_cases/10_main.c similarity index 100% rename from tests/simple/10_main.c rename to tests/simple/return_val_cases/10_main.c diff --git a/tests/simple/11_recursive.c b/tests/simple/return_val_cases/11_recursive.c similarity index 100% rename from tests/simple/11_recursive.c rename to tests/simple/return_val_cases/11_recursive.c diff --git a/tests/simple/12_logic.c b/tests/simple/return_val_cases/12_logic.c similarity index 100% rename from tests/simple/12_logic.c rename to tests/simple/return_val_cases/12_logic.c diff --git a/tests/simple/13_array.c b/tests/simple/return_val_cases/13_array.c similarity index 100% rename from tests/simple/13_array.c rename to tests/simple/return_val_cases/13_array.c diff --git a/tests/simple/14_pointer.c b/tests/simple/return_val_cases/14_pointer.c similarity index 100% rename from tests/simple/14_pointer.c rename to tests/simple/return_val_cases/14_pointer.c diff --git a/tests/simple/15_array_subscript.c b/tests/simple/return_val_cases/15_array_subscript.c similarity index 100% rename from tests/simple/15_array_subscript.c rename to tests/simple/return_val_cases/15_array_subscript.c diff --git a/tests/simple/16_enum.c b/tests/simple/return_val_cases/16_enum.c similarity index 100% rename from tests/simple/16_enum.c rename to tests/simple/return_val_cases/16_enum.c diff --git a/tests/simple/return_val_cases/17_more_arg.c b/tests/simple/return_val_cases/17_more_arg.c new file mode 100644 index 0000000..594ea5c --- /dev/null +++ b/tests/simple/return_val_cases/17_more_arg.c @@ -0,0 +1,9 @@ + +int add(int a, int b, int c, int d, int e, int f, int g, int h, int i) { + return a + b + c + d + e + f + g + h + i; +} + +int main(void) { + int result = add(1, 2, 3, 4, 5, 6, 7, 8, 9); + return result; +} diff --git a/tests/simple/stdout_val_cases/01_include.c b/tests/simple/stdout_val_cases/01_include.c new file mode 100644 index 0000000..ab544ea --- /dev/null +++ b/tests/simple/stdout_val_cases/01_include.c @@ -0,0 +1,6 @@ +#include "stdio.h" + +int main(void) { + puts("hello world"); + return 0; +} diff --git a/tests/simple/scc_stdio.h b/tests/simple/stdout_val_cases/stdio.h similarity index 100% rename from tests/simple/scc_stdio.h rename to tests/simple/stdout_val_cases/stdio.h