diff --git a/crates/wasm_interp/tests/test_opcodes.rs b/crates/wasm_interp/tests/test_opcodes.rs index 56e23c73f5..ec0de18d3f 100644 --- a/crates/wasm_interp/tests/test_opcodes.rs +++ b/crates/wasm_interp/tests/test_opcodes.rs @@ -1303,254 +1303,6 @@ fn test_f64const() { assert_eq!(state.value_stack.pop(), Value::F64(12345.67890)) } -#[test] -fn test_i32lts() { - test_i32_compare_help(OpCode::I32LTS, 123, 234, true); - test_i32_compare_help(OpCode::I32LTS, 234, 123, false); - test_i32_compare_help(OpCode::I32LTS, -42, 1, true); - test_i32_compare_help(OpCode::I32LTS, 13, -1, false); -} - -fn test_i32_compare_help(op: OpCode, x: i32, y: i32, expected: bool) { - let arena = Bump::new(); - let mut module = WasmModule::new(&arena); - let buf = &mut module.code.bytes; - - buf.push(0); // no locals - - buf.push(OpCode::I32CONST as u8); - buf.encode_i32(x); - - buf.push(OpCode::I32CONST as u8); - buf.encode_i32(y); - - buf.push(op as u8); - - // end function - buf.push(OpCode::END as u8); - - let mut state = default_state(&arena); - state.call_stack.push_frame( - 0, - 0, - &[], - &mut state.value_stack, - &module.code.bytes, - &mut state.program_counter, - ); - - while let Action::Continue = state.execute_next_instruction(&module) {} - - assert_eq!(state.value_stack.pop_i32(), expected as i32); -} - -// #[test] -// fn test_i64eqz() {} - -// #[test] -// fn test_i64eq() {} - -// #[test] -// fn test_i64ne() {} - -// #[test] -// fn test_i64lts() {} - -// #[test] -// fn test_i64ltu() {} - -// #[test] -// fn test_i64gts() {} - -// #[test] -// fn test_i64gtu() {} - -// #[test] -// fn test_i64les() {} - -// #[test] -// fn test_i64leu() {} - -// #[test] -// fn test_i64ges() {} - -// #[test] -// fn test_i64geu() {} - -// #[test] -// fn test_f32eq() {} - -// #[test] -// fn test_f32ne() {} - -// #[test] -// fn test_f32lt() {} - -// #[test] -// fn test_f32gt() {} - -// #[test] -// fn test_f32le() {} - -// #[test] -// fn test_f32ge() {} - -// #[test] -// fn test_f64eq() {} - -// #[test] -// fn test_f64ne() {} - -// #[test] -// fn test_f64lt() {} - -// #[test] -// fn test_f64gt() {} - -// #[test] -// fn test_f64le() {} - -// #[test] -// fn test_f64ge() {} - -// #[test] -// fn test_i64clz() {} - -// #[test] -// fn test_i64ctz() {} - -// #[test] -// fn test_i64popcnt() {} - -// #[test] -// fn test_i64add() {} - -// #[test] -// fn test_i64sub() {} - -// #[test] -// fn test_i64mul() {} - -// #[test] -// fn test_i64divs() {} - -// #[test] -// fn test_i64divu() {} - -// #[test] -// fn test_i64rems() {} - -// #[test] -// fn test_i64remu() {} - -// #[test] -// fn test_i64and() {} - -// #[test] -// fn test_i64or() {} - -// #[test] -// fn test_i64xor() {} - -// #[test] -// fn test_i64shl() {} - -// #[test] -// fn test_i64shrs() {} - -// #[test] -// fn test_i64shru() {} - -// #[test] -// fn test_i64rotl() {} - -// #[test] -// fn test_i64rotr() {} - -// #[test] -// fn test_f32abs() {} - -// #[test] -// fn test_f32neg() {} - -// #[test] -// fn test_f32ceil() {} - -// #[test] -// fn test_f32floor() {} - -// #[test] -// fn test_f32trunc() {} - -// #[test] -// fn test_f32nearest() {} - -// #[test] -// fn test_f32sqrt() {} - -// #[test] -// fn test_f32add() {} - -// #[test] -// fn test_f32sub() {} - -// #[test] -// fn test_f32mul() {} - -// #[test] -// fn test_f32div() {} - -// #[test] -// fn test_f32min() {} - -// #[test] -// fn test_f32max() {} - -// #[test] -// fn test_f32copysign() {} - -// #[test] -// fn test_f64abs() {} - -// #[test] -// fn test_f64neg() {} - -// #[test] -// fn test_f64ceil() {} - -// #[test] -// fn test_f64floor() {} - -// #[test] -// fn test_f64trunc() {} - -// #[test] -// fn test_f64nearest() {} - -// #[test] -// fn test_f64sqrt() {} - -// #[test] -// fn test_f64add() {} - -// #[test] -// fn test_f64sub() {} - -// #[test] -// fn test_f64mul() {} - -// #[test] -// fn test_f64div() {} - -// #[test] -// fn test_f64min() {} - -// #[test] -// fn test_f64max() {} - -// #[test] -// fn test_f64copysign() {} - // #[test] // fn test_i32wrapi64() {}