WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

Commit c5c2ceff authored by qinsoon's avatar qinsoon
Browse files

delete liveness test (meaningless)

parent edca1594
......@@ -34,63 +34,6 @@ fn get_number_of_moves(fv_id: MuID, vm: &VM) -> usize {
n_mov_insts
}
#[test]
fn test_ir_liveness_fac() {
VM::start_logging_trace();
let vm = Arc::new(factorial());
let compiler = Compiler::new(CompilerPolicy::new(vec![
Box::new(passes::DefUse::new()),
Box::new(passes::TreeGen::new()),
Box::new(passes::ControlFlowAnalysis::new()),
Box::new(passes::TraceGen::new()),
Box::new(backend::inst_sel::InstructionSelection::new()),
]), &vm);
let func_id = vm.id_of("fac");
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);
let cf_lock = vm.compiled_funcs().read().unwrap();
let cf = cf_lock.get(&func_ver.id()).unwrap().read().unwrap();
// block 0
let block_0_livein = cf.mc().get_ir_block_livein("blk_0").unwrap();
let blk_0_n_3 = vm.id_of("blk_0_n_3");;
assert!(vec_utils::is_identical_to_str_ignore_order(block_0_livein, vec![blk_0_n_3]));
let block_0_liveout = cf.mc().get_ir_block_liveout("blk_0").unwrap();
assert!(vec_utils::is_identical_to_str_ignore_order(block_0_liveout, vec![blk_0_n_3]));
// block 1
let block_1_livein = cf.mc().get_ir_block_livein("blk_1").unwrap();
let blk_1_n_3 = vm.id_of("blk_1_n_3");
assert!(vec_utils::is_identical_to_str_ignore_order(block_1_livein, vec![blk_1_n_3]));
let block_1_liveout = cf.mc().get_ir_block_liveout("blk_1").unwrap();
let blk_1_v52 = vm.id_of("blk_1_v52");
trace!("lhs: {:?}", block_1_liveout);
trace!("rhs: {:?}", vec![blk_1_v52]);
assert!(vec_utils::is_identical_to_str_ignore_order(block_1_liveout, vec![blk_1_v52]));
// block 2
let block_2_livein = cf.mc().get_ir_block_livein("blk_2").unwrap();
let blk_2_v53 = vm.id_of("blk_2_v53");
assert!(vec_utils::is_identical_to_str_ignore_order(block_2_livein, vec![blk_2_v53]));
let block_2_liveout = cf.mc().get_ir_block_liveout("blk_2").unwrap();
let expect : Vec<MuID> = vec![];
assert!(vec_utils::is_identical_to_str_ignore_order(block_2_liveout, expect));
}
#[test]
#[allow(unused_variables)]
fn test_spill1() {
......
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