New working test groups: test_call

parent afdb69c8
......@@ -993,6 +993,68 @@ macro_rules! emit_test {
});
};
/*
emit_test! ((vm) (pass_1arg_by_stack pass_1arg_by_stack_test1 pass_1arg_by_stack_test1_v1 Int,EQ (sig, int64(1u64))));
*/
(($vm: expr) ($name: ident $test_name: ident $tester_name: ident $Arg1Type: ident,$CMPType: ident ($test_sig: ident, $ty1: ident($in1: expr)))) => {
typedef! (($vm) int1 = mu_int(1));
typedef! (($vm) int64t = mu_int(64));
constdef! (($vm) <int64t> int64_pass = Constant::Int(0));
constdef! (($vm) <int64t> int64_fail = Constant::Int(1));
constdef! (($vm) <$ty1> arg_0 = Constant::$Arg1Type($in1));
funcsig! (($vm) tester_sig = () -> ());
funcdecl! (($vm) <tester_sig> $test_name);
funcdef! (($vm) <tester_sig> $test_name VERSION $tester_name);
typedef! (($vm) type_funcref = mu_funcref($test_sig));
constdef! (($vm) <type_funcref> const_funcref = Constant::FuncRef($vm.id_of(stringify!($name))));
// blk_entry
consta! (($vm, $tester_name) arg_0_local = arg_0);
block! (($vm, $tester_name) blk_entry);
consta! (($vm, $tester_name) const_funcref_local = const_funcref);
ssa! (($vm, $tester_name) <$ty1> result);
inst! (($vm, $tester_name) blk_entry_call:
result = EXPRCALL (CallConvention::Mu, is_abort: false) const_funcref_local ()
);
consta! (($vm, $tester_name) int64_pass_local = int64_pass);
consta! (($vm, $tester_name) int64_fail_local = int64_fail);
ssa! (($vm, $tester_name) <int1> cmp_res);
inst! (($vm, $tester_name) blk_entry_cmp:
cmp_res = CMPOP (CmpOp::$CMPType) result arg_0_local
);
ssa! (($vm, $tester_name) <int64t> blk_entry_ret);
inst! (($vm, $tester_name) blk_entry_inst_select:
blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local
);
inst! (($vm, $tester_name) blk_entry_inst_ret:
SET_RETVAL blk_entry_ret
);
inst! (($vm, $tester_name) blk_entry_inst_exit:
THREADEXIT
);
define_block! (($vm, $tester_name) blk_entry() {
blk_entry_call,
blk_entry_cmp,
blk_entry_inst_select,
blk_entry_inst_ret,
blk_entry_inst_exit
});
define_func_ver! (($vm) $tester_name (entry: blk_entry) {
blk_entry
});
};
}
/*
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment