Commit 2d236b90 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm] Fix test arguments for i64.trunc_f64_s

It was incorrectly using int64 test arguments, it should be using
double. After changing the test, it was failing for values outside of
int64 range (UB), so check and skip those values, see
https://source.chromium.org/chromium/chromium/src/+/master:v8/test/cctest/wasm/test-run-wasm-64.cc;l=762-767;drc=0c918bd8418b92a095885dc98ef5a939febf4069

Change-Id: I2f97c3f78e197b39cbf320468daefc339844d515
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436639
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70239}
parent b376a124
......@@ -115,7 +115,12 @@ TEST(TestCWasmEntryArgPassing_int64_double) {
WASM_I64_SCONVERT_F64(WASM_GET_LOCAL(0))},
[](double d) { return static_cast<int64_t>(d); });
FOR_INT64_INPUTS(i) { tester.CheckCall(i); }
FOR_FLOAT64_INPUTS(d) {
if (d < static_cast<double>(std::numeric_limits<int64_t>::max()) &&
d >= static_cast<double>(std::numeric_limits<int64_t>::min())) {
tester.CheckCall(d);
}
}
}
// Pass float, return double.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment