[test] Fix RunInt64AddShift

Change-Id: I1972b65c75f08130ecda45d36edc4c1431c3ea8d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4100665
Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84946}
This commit is contained in:
JianxiaoLuIntel 2022-12-13 18:22:42 +08:00 committed by V8 LUCI CQ
parent e967e6c46e
commit 99eba76742

View File

@ -1012,8 +1012,9 @@ static int64_t RunInt64AddShift(bool is_left, int64_t add_left,
int64_t add_right, int64_t shift_left,
int64_t shift_right) {
RawMachineAssemblerTester<int64_t> m;
Node* shift = m.Word64Shl(m.Int64Constant(4), m.Int64Constant(2));
Node* add = m.Int64Add(m.Int64Constant(20), m.Int64Constant(22));
Node* shift =
m.Word64Shl(m.Int64Constant(shift_left), m.Int64Constant(shift_right));
Node* add = m.Int64Add(m.Int64Constant(add_left), m.Int64Constant(add_right));
Node* dlsa = is_left ? m.Int64Add(shift, add) : m.Int64Add(add, shift);
m.Return(dlsa);
return m.Call();
@ -1034,10 +1035,12 @@ TEST(RunInt64AddShift) {
const size_t tc_size = sizeof(tc) / sizeof(Test_case);
for (size_t i = 0; i < tc_size; ++i) {
CHECK_EQ(58, RunInt64AddShift(false, tc[i].add_left, tc[i].add_right,
tc[i].shift_left, tc[i].shift_right));
CHECK_EQ(58, RunInt64AddShift(true, tc[i].add_left, tc[i].add_right,
tc[i].shift_left, tc[i].shift_right));
CHECK_EQ(tc[i].expected,
RunInt64AddShift(false, tc[i].add_left, tc[i].add_right,
tc[i].shift_left, tc[i].shift_right));
CHECK_EQ(tc[i].expected,
RunInt64AddShift(true, tc[i].add_left, tc[i].add_right,
tc[i].shift_left, tc[i].shift_right));
}
}