Index: test/cctest/wasm/test-run-wasm-asmjs.cc |
diff --git a/test/cctest/wasm/test-run-wasm-asmjs.cc b/test/cctest/wasm/test-run-wasm-asmjs.cc |
index c8fb32cff527d6fbdda8c99cb62fe0c0a08f5904..e948d3524887870a786c74515c31c73f5b538707 100644 |
--- a/test/cctest/wasm/test-run-wasm-asmjs.cc |
+++ b/test/cctest/wasm/test-run-wasm-asmjs.cc |
@@ -70,6 +70,46 @@ TEST(Run_WASM_Int32AsmjsRemU) { |
CHECK_EQ(kMin, r.Call(kMin, -1)); |
} |
+TEST(Run_Wasm_I32AsmjsSConvertF32) { |
+ WasmRunner<int32_t> r(MachineType::Float32()); |
+ BUILD(r, WASM_UNOP(kExprI32AsmjsSConvertF32, WASM_GET_LOCAL(0))); |
+ |
+ FOR_FLOAT32_INPUTS(i) { |
+ int32_t expected = DoubleToInt32(*i); |
+ CHECK_EQ(expected, r.Call(*i)); |
+ } |
+} |
+ |
+TEST(Run_Wasm_I32AsmjsSConvertF64) { |
+ WasmRunner<int32_t> r(MachineType::Float64()); |
+ BUILD(r, WASM_UNOP(kExprI32AsmjsSConvertF64, WASM_GET_LOCAL(0))); |
+ |
+ FOR_FLOAT64_INPUTS(i) { |
+ int32_t expected = DoubleToInt32(*i); |
+ CHECK_EQ(expected, r.Call(*i)); |
+ } |
+} |
+ |
+TEST(Run_Wasm_I32AsmjsUConvertF32) { |
+ WasmRunner<uint32_t> r(MachineType::Float32()); |
+ BUILD(r, WASM_UNOP(kExprI32AsmjsUConvertF32, WASM_GET_LOCAL(0))); |
+ |
+ FOR_FLOAT32_INPUTS(i) { |
+ uint32_t expected = DoubleToUint32(*i); |
+ CHECK_EQ(expected, r.Call(*i)); |
+ } |
+} |
+ |
+TEST(Run_Wasm_I32AsmjsUConvertF64) { |
+ WasmRunner<uint32_t> r(MachineType::Float64()); |
+ BUILD(r, WASM_UNOP(kExprI32AsmjsUConvertF64, WASM_GET_LOCAL(0))); |
+ |
+ FOR_FLOAT64_INPUTS(i) { |
+ uint32_t expected = DoubleToUint32(*i); |
+ CHECK_EQ(expected, r.Call(*i)); |
+ } |
+} |
+ |
TEST(Run_Wasm_LoadMemI32_oob_asm) { |
TestingModule module; |
module.origin = kAsmJsOrigin; |