Commit 3b9dd243 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm-gc] Enable rtt test in liftoff

By disengaging it from 'let' which is not implemented in liftoff yet.

Bug: v8:7748
Change-Id: I191695767bf8c6153f70d509dd13ff734fe75e01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2676631Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72620}
parent 87df0b7e
...@@ -783,8 +783,8 @@ WASM_COMPILED_EXEC_TEST(NewDefault) { ...@@ -783,8 +783,8 @@ WASM_COMPILED_EXEC_TEST(NewDefault) {
tester.CheckResult(allocate_array, 0); tester.CheckResult(allocate_array, 0);
} }
TEST(BasicRtt) { WASM_COMPILED_EXEC_TEST(BasicRtt) {
WasmGCTester tester; WasmGCTester tester(execution_tier);
const byte type_index = tester.DefineStruct({F(wasm::kWasmI32, true)}); const byte type_index = tester.DefineStruct({F(wasm::kWasmI32, true)});
const byte subtype_index = const byte subtype_index =
...@@ -811,31 +811,26 @@ TEST(BasicRtt) { ...@@ -811,31 +811,26 @@ TEST(BasicRtt) {
kExprEnd}); kExprEnd});
const int kFieldIndex = 1; const int kFieldIndex = 1;
const int kStructIndexCode = 1; // Shifted in 'let' block. const int kStructIndexCode = 0;
const int kRttIndexCode = 0; // Let-bound, hence first local.
// This implements the following function: // This implements the following function:
// var local_struct: type0; // var local_struct: type0;
// let (local_rtt = rtt.sub(rtt.canon(type0), type1) in { // local_struct = new type1 with rtt 'kRttSub()';
// local_struct = new type1 with rtt 'local_rtt'; // return (ref.test local_struct kRttSub()) +
// return (ref.test local_struct local_rtt) + // ((ref.cast local_struct kRttSub())[field0]);
// ((ref.cast local_struct local_rtt)[field0]);
// } // }
// The expected return value is 1+42 = 43. // The expected return value is 1+42 = 43.
const byte kRefCast = tester.DefineFunction( const byte kRefCast = tester.DefineFunction(
tester.sigs.i_v(), {optref(type_index)}, tester.sigs.i_v(), {optref(type_index)},
{WASM_LET_1_I( {WASM_LOCAL_SET(
WASM_RTT_WITH_DEPTH(1, subtype_index), kStructIndexCode,
WASM_RTT_SUB(subtype_index, WASM_RTT_CANON(type_index)), WASM_STRUCT_NEW_WITH_RTT(subtype_index, WASM_I32V(11), WASM_I32V(42),
WASM_LOCAL_SET(kStructIndexCode, WASM_CALL_FUNCTION0(kRttSub))),
WASM_STRUCT_NEW_WITH_RTT( WASM_I32_ADD(
subtype_index, WASM_I32V(11), WASM_I32V(42), WASM_REF_TEST(WASM_LOCAL_GET(kStructIndexCode),
WASM_LOCAL_GET(kRttIndexCode))), WASM_CALL_FUNCTION0(kRttSub)),
WASM_I32_ADD( WASM_STRUCT_GET(subtype_index, kFieldIndex,
WASM_REF_TEST(WASM_LOCAL_GET(kStructIndexCode), WASM_REF_CAST(WASM_LOCAL_GET(kStructIndexCode),
WASM_LOCAL_GET(kRttIndexCode)), WASM_CALL_FUNCTION0(kRttSub)))),
WASM_STRUCT_GET(subtype_index, kFieldIndex,
WASM_REF_CAST(WASM_LOCAL_GET(kStructIndexCode),
WASM_LOCAL_GET(kRttIndexCode))))),
kExprEnd}); kExprEnd});
tester.CompileModule(); tester.CompileModule();
......
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