#[cfg(test)] pub mod tests { use compiler::backend::*; #[test] pub fn quicksort() { let mut bb0 = Block::new("bb0".into()); let addispsp_32 = Inst::Add(AddInst::new(REG_SP.into(), REG_SP.into(), (-32).into())); let sdra24sp = Inst::Sd(SdInst::new(REG_RA.into(), (24).into(), REG_SP.into())); let sds016sp = Inst::Sd(SdInst::new(REG_S0.into(), (16).into(), REG_SP.into())); let sds18sp = Inst::Sd(SdInst::new(REG_S1.into(), (8).into(), REG_SP.into())); let sds20sp = Inst::Sd(SdInst::new(REG_S2.into(), (0).into(), REG_SP.into())); let bgea1a2lbb0_17 = Inst::Branch( BranchInst::new(BranchOp::Bge, REG_A1.into(), REG_A2.into(), "LBB0_17".into()) ); bb0.push_inst(addispsp_32); bb0.push_inst(sdra24sp); bb0.push_inst(sds016sp); bb0.push_inst(sds18sp); bb0.push_inst(sds20sp); bb0.push_inst(bgea1a2lbb0_17); println!("{:?}", bb0.gen_asm()); } }