regression tests output check & fixes

This commit is contained in:
ProgramSnail 2025-03-16 14:26:48 +03:00
parent 3dfefdb2ca
commit 905632aab6
4 changed files with 14 additions and 4 deletions

View file

@ -235,6 +235,10 @@ static inline void s_exit_f() {
#endif
s_popn(f_args_sz(&frame));
if (frame.closure) {
s_pop();
}
// save returned value, not in main
if (frame.prev_fp != 0) {
s_push(frame.ret);

View file

@ -15,9 +15,14 @@ for test in ../regression/*.lama; do
$compiler -b $test > /dev/null
test_file="${test%.*}"
echo $test_file
cat $test_file.input | ./byterun.exe -p test*.bc > /dev/null
cat $test_file.input | ./byterun.exe -vi test*.bc > /dev/null
# cat $test_file.input | ./byterun.exe -p test*.bc > test.bc.code
# cat $test_file.input | ./byterun.exe -p test*.bc
cat $test_file.input | ./byterun.exe -vi test*.bc > test.log
sed '1d;s/^..//' $test_file.t > test_orig.log
diff test.log test_orig.log
rm test*.bc
rm test.log test_orig.log
echo "done"
done

View file

@ -486,10 +486,10 @@ void run_main(Bytefile* bf, int argc, char **argv) {
s_push_i(Bsexp_tag_patt(s_pop()));
break;
case CMD_PATT_REF_TAG: // #ref
s_push_i(Bunboxed_patt(s_pop()));
s_push_i(Bboxed_patt(s_pop()));
break;
case CMD_PATT_VAL_TAG: // #val
s_push_i(Bboxed_patt(s_pop()));
s_push_i(Bunboxed_patt(s_pop()));
break;
case CMD_PATT_FUN_TAG: // #fun
s_push_i(Bclosure_tag_patt(s_pop()));

View file

@ -473,6 +473,7 @@ void run_stdlib_func(BUILTIN id, size_t args_count) {
s_push(ret);
break;
case BUILTIN_Lread:
printf(" ");
ret = (void *)Lread();
s_push(ret);
break;