()
| 86 | ); |
| 87 | } |
| 88 | |
| 89 | // -- Signed / unsigned arithmetic lowering ------------------------------------ |
| 90 | |
| 91 | #[test] |
| 92 | fn unsigned_division_emits_udiv() { |
| 93 | assert!(has_instruction( |
| 94 | r#"main: () -> i32 { a: u32 = 10 b: u32 = 2 c: u32 = a / b return c as i32 }"#, |
| 95 | |i| matches!(i, IrInstruction::Math { op, .. } if *op == IrMathOp::UDiv), |
| 96 | )); |
| 97 | } |
| 98 | |
| 99 | #[test] |
| 100 | fn signed_division_emits_sdiv() { |
nothing calls this directly
no test coverage detected