diff --git a/test/inc.cb b/test/inc.cb index a149065..b0f55b9 100644 --- a/test/inc.cb +++ b/test/inc.cb @@ -17,7 +17,15 @@ main(int argc, char **argv) j = i++; printf(";%d", j); // 3 printf(";%d", i); // 4 + printf(";%d", inc(i)); // 5 + printf(";%d", inc(i)); // 5 puts(""); return 0; } + +static int +inc(int i) +{ + return ++i; +} diff --git a/test/test_cbc.sh b/test/test_cbc.sh index e931678..97c7490 100644 --- a/test/test_cbc.sh +++ b/test/test_cbc.sh @@ -94,7 +94,7 @@ test_09_cmp() { test_10_assign() { assert_out "1;2;2;3;4;5;6;7;8;8;9;10;11;777;S;12" ./assign assert_out "3;4;3;12;4;1;1;7;5;1;4;e;H;76;75;1;3;6;82;81" ./opassign - assert_out "0;1;2;2;3;3;4" ./inc + assert_out "0;1;2;2;3;3;4;5;5" ./inc assert_out "4;3;2;2;1;1;0" ./dec assert_compile_success textwrite.cb }