Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: test/cctest/wasm/test-run-wasm.cc

Issue 1843983002: [wasm] Fixed float-to-int conversion tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm.cc
diff --git a/test/cctest/wasm/test-run-wasm.cc b/test/cctest/wasm/test-run-wasm.cc
index cf6519e6e8a32cd6f7f496db370bfdce1d905ee1..02ee974ccc649f60424f0335f94e4f8e10b24155 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -2699,8 +2699,6 @@ TEST(Run_Wasm_F64Max_Snan) {
#endif
-// TODO(titzer): Fix and re-enable.
-#if 0
TEST(Run_Wasm_I32SConvertF32) {
WasmRunner<int32_t> r(MachineType::Float32());
BUILD(r, WASM_I32_SCONVERT_F32(WASM_GET_LOCAL(0)));
@@ -2721,8 +2719,8 @@ TEST(Run_Wasm_I32SConvertF64) {
BUILD(r, WASM_I32_SCONVERT_F64(WASM_GET_LOCAL(0)));
FOR_FLOAT64_INPUTS(i) {
- if (*i < static_cast<double>(INT32_MAX) &&
- *i >= static_cast<double>(INT32_MIN)) {
+ if (*i < (static_cast<double>(INT32_MAX) + 1.0) &&
+ *i > (static_cast<double>(INT32_MIN) - 1.0)) {
CHECK_EQ(static_cast<int64_t>(*i), r.Call(*i));
} else {
CHECK_TRAP32(r.Call(*i));
@@ -2736,7 +2734,7 @@ TEST(Run_Wasm_I32UConvertF32) {
BUILD(r, WASM_I32_UCONVERT_F32(WASM_GET_LOCAL(0)));
FOR_FLOAT32_INPUTS(i) {
- if (*i < static_cast<float>(UINT32_MAX) && *i > -1) {
+ if (*i < (static_cast<float>(UINT32_MAX) + 1.0) && *i > -1) {
CHECK_EQ(static_cast<uint32_t>(*i), r.Call(*i));
} else {
CHECK_TRAP32(r.Call(*i));
@@ -2750,15 +2748,13 @@ TEST(Run_Wasm_I32UConvertF64) {
BUILD(r, WASM_I32_UCONVERT_F64(WASM_GET_LOCAL(0)));
FOR_FLOAT64_INPUTS(i) {
- if (*i < static_cast<float>(UINT32_MAX) && *i > -1) {
+ if (*i < (static_cast<float>(UINT32_MAX) + 1.0) && *i > -1) {
CHECK_EQ(static_cast<uint32_t>(*i), r.Call(*i));
} else {
CHECK_TRAP32(r.Call(*i));
}
}
}
-#endif
-
TEST(Run_Wasm_F64CopySign) {
WasmRunner<double> r(MachineType::Float64(), MachineType::Float64());
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698