Commit 5c2ffc9c authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Execute more tests in both interpreter and compiled

This fixes a few leftovers where we use WASM_EXEC_TEST, but then
unconditionally execute the compiled code, and also changes more tests
to use WASM_EXEC_TEST, hence run in both the interpreter and compiled
code.
Once we have land the baseline compiler, those tests will also execute
in baseline compilation mode.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: I79598df21a7538934306e01ca6593f05afe19ed3
Reviewed-on: https://chromium-review.googlesource.com/672528
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48091}
parent fce4faaf
......@@ -75,12 +75,12 @@ void RunU32BinOp(WasmOpcode wasm_op, Uint32BinOp expected_op) {
}
}
WASM_EXEC_TEST(I32Add) { RunU32BinOp(kExprI32AtomicAdd, Add); }
WASM_EXEC_TEST(I32Sub) { RunU32BinOp(kExprI32AtomicSub, Sub); }
WASM_EXEC_TEST(I32And) { RunU32BinOp(kExprI32AtomicAnd, And); }
WASM_EXEC_TEST(I32Or) { RunU32BinOp(kExprI32AtomicOr, Or); }
WASM_EXEC_TEST(I32Xor) { RunU32BinOp(kExprI32AtomicXor, Xor); }
WASM_EXEC_TEST(I32Exchange) { RunU32BinOp(kExprI32AtomicExchange, Exchange); }
TEST(I32AtomicAdd) { RunU32BinOp(kExprI32AtomicAdd, Add); }
TEST(I32AtomicSub) { RunU32BinOp(kExprI32AtomicSub, Sub); }
TEST(I32AtomicAnd) { RunU32BinOp(kExprI32AtomicAnd, And); }
TEST(I32AtomicOr) { RunU32BinOp(kExprI32AtomicOr, Or); }
TEST(I32AtomicXor) { RunU32BinOp(kExprI32AtomicXor, Xor); }
TEST(I32AtomicExchange) { RunU32BinOp(kExprI32AtomicExchange, Exchange); }
void RunU16BinOp(WasmOpcode wasm_op, Uint16BinOp expected_op) {
EXPERIMENTAL_FLAG_SCOPE(threads);
......@@ -101,14 +101,12 @@ void RunU16BinOp(WasmOpcode wasm_op, Uint16BinOp expected_op) {
}
}
WASM_EXEC_TEST(I32Add16U) { RunU16BinOp(kExprI32AtomicAdd16U, Add); }
WASM_EXEC_TEST(I32Sub16U) { RunU16BinOp(kExprI32AtomicSub16U, Sub); }
WASM_EXEC_TEST(I32And16U) { RunU16BinOp(kExprI32AtomicAnd16U, And); }
WASM_EXEC_TEST(I32Or16U) { RunU16BinOp(kExprI32AtomicOr16U, Or); }
WASM_EXEC_TEST(I32Xor16U) { RunU16BinOp(kExprI32AtomicXor16U, Xor); }
WASM_EXEC_TEST(I32Exchange16U) {
RunU16BinOp(kExprI32AtomicExchange16U, Exchange);
}
TEST(I32AtomicAdd16U) { RunU16BinOp(kExprI32AtomicAdd16U, Add); }
TEST(I32AtomicSub16U) { RunU16BinOp(kExprI32AtomicSub16U, Sub); }
TEST(I32AtomicAnd16U) { RunU16BinOp(kExprI32AtomicAnd16U, And); }
TEST(I32AtomicOr16U) { RunU16BinOp(kExprI32AtomicOr16U, Or); }
TEST(I32AtomicXor16U) { RunU16BinOp(kExprI32AtomicXor16U, Xor); }
TEST(I32AtomicExchange16U) { RunU16BinOp(kExprI32AtomicExchange16U, Exchange); }
void RunU8BinOp(WasmOpcode wasm_op, Uint8BinOp expected_op) {
EXPERIMENTAL_FLAG_SCOPE(threads);
......@@ -129,16 +127,14 @@ void RunU8BinOp(WasmOpcode wasm_op, Uint8BinOp expected_op) {
}
}
WASM_EXEC_TEST(I32Add8U) { RunU8BinOp(kExprI32AtomicAdd8U, Add); }
WASM_EXEC_TEST(I32Sub8U) { RunU8BinOp(kExprI32AtomicSub8U, Sub); }
WASM_EXEC_TEST(I32And8U) { RunU8BinOp(kExprI32AtomicAnd8U, And); }
WASM_EXEC_TEST(I32Or8U) { RunU8BinOp(kExprI32AtomicOr8U, Or); }
WASM_EXEC_TEST(I32Xor8U) { RunU8BinOp(kExprI32AtomicXor8U, Xor); }
WASM_EXEC_TEST(I32Exchange8U) {
RunU8BinOp(kExprI32AtomicExchange8U, Exchange);
}
TEST(I32AtomicAdd8U) { RunU8BinOp(kExprI32AtomicAdd8U, Add); }
TEST(I32AtomicSub8U) { RunU8BinOp(kExprI32AtomicSub8U, Sub); }
TEST(I32AtomicAnd8U) { RunU8BinOp(kExprI32AtomicAnd8U, And); }
TEST(I32AtomicOr8U) { RunU8BinOp(kExprI32AtomicOr8U, Or); }
TEST(I32AtomicXor8U) { RunU8BinOp(kExprI32AtomicXor8U, Xor); }
TEST(I32AtomicExchange8U) { RunU8BinOp(kExprI32AtomicExchange8U, Exchange); }
WASM_EXEC_TEST(I32CompareExchange) {
TEST(I32AtomicCompareExchange) {
EXPERIMENTAL_FLAG_SCOPE(threads);
WasmRunner<uint32_t, uint32_t, uint32_t> r(kExecuteCompiled);
r.builder().SetHasSharedMemory();
......@@ -158,7 +154,7 @@ WASM_EXEC_TEST(I32CompareExchange) {
}
}
WASM_EXEC_TEST(I32CompareExchange16U) {
TEST(I32AtomicCompareExchange16U) {
EXPERIMENTAL_FLAG_SCOPE(threads);
WasmRunner<uint32_t, uint32_t, uint32_t> r(kExecuteCompiled);
r.builder().SetHasSharedMemory();
......@@ -178,7 +174,7 @@ WASM_EXEC_TEST(I32CompareExchange16U) {
}
}
WASM_EXEC_TEST(I32CompareExchange8U) {
TEST(I32AtomicCompareExchange8U) {
EXPERIMENTAL_FLAG_SCOPE(threads);
WasmRunner<uint32_t, uint32_t, uint32_t> r(kExecuteCompiled);
r.builder().SetHasSharedMemory();
......
This diff is collapsed.
......@@ -23,8 +23,8 @@ namespace wasm {
TEST_BODY(double, WASM_F64_ADD)
#define LOAD_SET_GLOBAL_TEST_BODY(C_TYPE, ADD) \
TEST(WasmRelocateGlobal_##C_TYPE) { \
WasmRunner<C_TYPE, C_TYPE> r(kExecuteCompiled); \
WASM_EXEC_TEST(WasmRelocateGlobal_##C_TYPE) { \
WasmRunner<C_TYPE, C_TYPE> r(execution_mode); \
Isolate* isolate = CcTest::i_isolate(); \
\
r.builder().AddGlobal<C_TYPE>(); \
......
......@@ -2382,7 +2382,7 @@ WASM_EXEC_TEST(MixedCall_2) { Run_WasmMixedCall_N(execution_mode, 2); }
WASM_EXEC_TEST(MixedCall_3) { Run_WasmMixedCall_N(execution_mode, 3); }
WASM_EXEC_TEST(AddCall) {
WasmRunner<int32_t, int32_t> r(kExecuteCompiled);
WasmRunner<int32_t, int32_t> r(execution_mode);
WasmFunctionCompiler& t1 = r.NewFunction<int32_t, int32_t, int32_t>();
BUILD(t1, WASM_I32_ADD(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
......
......@@ -66,9 +66,9 @@ void CheckExceptionInfos(v8::internal::Isolate* i_isolate, Handle<Object> exc,
} // namespace
// Trigger a trap for executing unreachable.
TEST(Unreachable) {
WASM_EXEC_TEST(Unreachable) {
// Create a WasmRunner with stack checks and traps enabled.
WasmRunner<void> r(kExecuteCompiled, "main",
WasmRunner<void> r(execution_mode, "main",
compiler::kRuntimeExceptionSupport);
TestSignatures sigs;
......@@ -102,8 +102,8 @@ TEST(Unreachable) {
}
// Trigger a trap for loading from out-of-bounds.
TEST(IllegalLoad) {
WasmRunner<void> r(kExecuteCompiled, "main",
WASM_EXEC_TEST(IllegalLoad) {
WasmRunner<void> r(execution_mode, "main",
compiler::kRuntimeExceptionSupport);
TestSignatures sigs;
......
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