MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / ir_cmp_ult

Function ir_cmp_ult

tests/integration/vm_execution.rs:2142–2162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2140/// Unsigned less-than comparison via IR: 2 < 5 must be true with `Ult`.
2141#[test]
2142fn ir_cmp_ult() {
2143 let i32_ty = IrType::Integer(IntWidth::I32);
2144 let mut entry = IrBlock::new("entry");
2145 entry.push_instruction(IrInstruction::Cmp {
2146 dest: IrRegister::Named("ok".into()),
2147 op: IrCmpOp::Ult,
2148 ty: i32_ty,
2149 lhs: IrValue::Integer(2),
2150 rhs: IrValue::Integer(5),
2151 });
2152 let program = pass_fail_ir(
2153 "ult",
2154 entry,
2155 IrValue::Register(IrRegister::Named("ok".into())),
2156 );
2157 let (_, outcome, _) = run_ir(&program);
2158 assert!(
2159 matches!(outcome, StepOutcome::Halted(0)),
2160 "ult: 2 < 5 should be true, got {outcome:?}"
2161 );
2162}
2163
2164/// Signed less-than comparison via IR: -1 < 0 must be true with `Slt`.
2165#[test]

Callers

nothing calls this directly

Calls 3

pass_fail_irFunction · 0.85
run_irFunction · 0.85
push_instructionMethod · 0.45

Tested by

no test coverage detected