New working test groups: test_regalloc

parent 6e8617da
......@@ -1100,6 +1100,86 @@ macro_rules! emit_test {
});
};
/*
emit_test! ((vm) (coalesce_branch2_moves coalesce_branch2_moves_test1 coalesce_branch2_moves_test1_v1 Int,Int,Int,Int,Int,Int,Int,EQ (sig, int64(1u64), int64(1u64), int64(10u64), int64(10u64), int64(0u64), int64(0u64), int64(2u64))));
*/
(($vm: expr) ($name: ident $test_name: ident $tester_name: ident $Arg1Type: ident,$Arg2Type: ident,$Arg3Type: ident,$Arg4Type: ident,$Arg5Type: ident,$Arg6Type: ident,$Arg7Type: ident,$CMPType: ident ($test_sig: ident, $ty1: ident($in1: expr), $ty2: ident($in2: expr), $ty3: ident($in3: expr), $ty4: ident($in4: expr), $ty5: ident($in5: expr), $ty6: ident($in6: expr), $ty7: ident($out: 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));
constdef! (($vm) <$ty2> arg_1 = Constant::$Arg2Type($in2));
constdef! (($vm) <$ty3> arg_2 = Constant::$Arg3Type($in3));
constdef! (($vm) <$ty4> arg_3 = Constant::$Arg4Type($in4));
constdef! (($vm) <$ty5> arg_4 = Constant::$Arg5Type($in5));
constdef! (($vm) <$ty6> arg_5 = Constant::$Arg6Type($in6));
constdef! (($vm) <$ty7> arg_6 = Constant::$Arg7Type($out));
funcsig! (($vm) tester_sig = () -> ());
funcdecl! (($vm) <tester_sig> $test_name);
funcdef! (($vm) <tester_sig> $test_name VERSION $tester_name);
ssa! (($vm, $tester_name) <$ty1> a);
ssa! (($vm, $tester_name) <$ty2> b);
ssa! (($vm, $tester_name) <$ty3> c);
ssa! (($vm, $tester_name) <$ty4> d);
ssa! (($vm, $tester_name) <$ty5> e);
ssa! (($vm, $tester_name) <$ty6> f);
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);
consta! (($vm, $tester_name) arg_1_local = arg_1);
consta! (($vm, $tester_name) arg_2_local = arg_2);
consta! (($vm, $tester_name) arg_3_local = arg_3);
consta! (($vm, $tester_name) arg_4_local = arg_4);
consta! (($vm, $tester_name) arg_5_local = arg_5);
block! (($vm, $tester_name) blk_entry);
consta! (($vm, $tester_name) const_funcref_local = const_funcref);
ssa! (($vm, $tester_name) <$ty7> result);
inst! (($vm, $tester_name) blk_entry_call:
result = EXPRCALL (CallConvention::Mu, is_abort: false) const_funcref_local (arg_0_local, arg_1_local, arg_2_local, arg_3_local, arg_4_local, arg_5_local)
);
consta! (($vm, $tester_name) arg_6_local = arg_6);
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_6_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(a, b, c, d, e, f) {
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.
......@@ -30,27 +30,7 @@ use std::sync::RwLock;
#[test]
fn test_thread_create() {
VM::start_logging_trace();
let vm = Arc::new(primordial_main());
let compiler = Compiler::new(CompilerPolicy::default(), &vm);
let func_id = vm.id_of("primordial_main");
{
let funcs = vm.funcs().read().unwrap();
let func = funcs.get(&func_id).unwrap().read().unwrap();
let func_vers = vm.func_vers().read().unwrap();
let mut func_ver = func_vers.get(&func.cur_ver.unwrap()).unwrap().write().unwrap();
compiler.compile(&mut func_ver);
}
vm.make_primordial_thread(func_id, true, vec![]);
backend::emit_context(&vm);
let executable = aot::link_primordial(vec!["primordial_main".to_string()], "primordial_main_test", &vm);
aot::execute(executable);
build_and_run_test!(primordial_main, primordial_main_test1);
}
fn primordial_main() -> VM {
......@@ -73,5 +53,7 @@ fn primordial_main() -> VM {
blk_entry
});
emit_test! ((vm) (primordial_main primordial_main_test1 primordial_main_test1_v1 (sig)));
vm
}
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