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

Side by Side Diff: test/cctest/wasm/test-run-wasm.cc

Issue 1702023002: [wasm] Replace the BufferedRawMachineAssemblerTester in the WasmRunner. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code cleanup. Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « test/cctest/compiler/value-helper.h ('k') | test/cctest/wasm/test-run-wasm-js.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "src/wasm/wasm-macro-gen.h" 9 #include "src/wasm/wasm-macro-gen.h"
10 10
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 1269
1270 FOR_INT32_INPUTS(i) { 1270 FOR_INT32_INPUTS(i) {
1271 int32_t expected = *i; 1271 int32_t expected = *i;
1272 memory[0] = expected; 1272 memory[0] = expected;
1273 CHECK_EQ(expected, r.Call()); 1273 CHECK_EQ(expected, r.Call());
1274 } 1274 }
1275 } 1275 }
1276 1276
1277 1277
1278 TEST(Run_Wasm_VoidReturn1) { 1278 TEST(Run_Wasm_VoidReturn1) {
1279 WasmRunner<void> r; 1279 // We use a wrapper function because WasmRunner<void> does not exist.
1280 BUILD(r, kExprNop); 1280
1281 r.Call(); 1281 // Build the test function.
1282 TestSignatures sigs;
1283 TestingModule module;
1284 WasmFunctionCompiler t(sigs.v_v());
1285 BUILD(t, kExprNop);
1286 uint32_t index = t.CompileAndAdd(&module);
1287
1288 const int32_t kExpected = -414444;
1289 // Build the calling function.
1290 WasmRunner<int32_t> r;
1291 r.env()->module = &module;
1292 BUILD(r, WASM_BLOCK(2, WASM_CALL_FUNCTION0(index), WASM_I32(kExpected)));
1293
1294 int32_t result = r.Call();
1295 CHECK_EQ(kExpected, result);
1282 } 1296 }
1283 1297
1284 1298
1285 TEST(Run_Wasm_VoidReturn2) { 1299 TEST(Run_Wasm_VoidReturn2) {
1286 WasmRunner<void> r; 1300 // We use a wrapper function because WasmRunner<void> does not exist.
1287 BUILD(r, WASM_RETURN0); 1301 // Build the test function.
1288 r.Call(); 1302 TestSignatures sigs;
1303 TestingModule module;
1304 WasmFunctionCompiler t(sigs.v_v());
1305 BUILD(t, WASM_RETURN0);
1306 uint32_t index = t.CompileAndAdd(&module);
1307
1308 const int32_t kExpected = -414444;
1309 // Build the calling function.
1310 WasmRunner<int32_t> r;
1311 r.env()->module = &module;
1312 BUILD(r, WASM_BLOCK(2, WASM_CALL_FUNCTION0(index), WASM_I32(kExpected)));
1313
1314 int32_t result = r.Call();
1315 CHECK_EQ(kExpected, result);
1289 } 1316 }
1290 1317
1291 1318
1292 TEST(Run_Wasm_Block_If_P) { 1319 TEST(Run_Wasm_Block_If_P) {
1293 WasmRunner<int32_t> r(MachineType::Int32()); 1320 WasmRunner<int32_t> r(MachineType::Int32());
1294 // { if (p0) return 51; return 52; } 1321 // { if (p0) return 51; return 52; }
1295 BUILD(r, WASM_BLOCK(2, // -- 1322 BUILD(r, WASM_BLOCK(2, // --
1296 WASM_IF(WASM_GET_LOCAL(0), // -- 1323 WASM_IF(WASM_GET_LOCAL(0), // --
1297 WASM_BRV(0, WASM_I8(51))), // -- 1324 WASM_BRV(0, WASM_I8(51))), // --
1298 WASM_I8(52))); // -- 1325 WASM_I8(52))); // --
(...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3408 3435
3409 #if WASM_64 3436 #if WASM_64
3410 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); } 3437 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); }
3411 #endif 3438 #endif
3412 3439
3413 3440
3414 TEST(Compile_Wasm_CallIndirect_Many_f32) { CompileCallIndirectMany(kAstF32); } 3441 TEST(Compile_Wasm_CallIndirect_Many_f32) { CompileCallIndirectMany(kAstF32); }
3415 3442
3416 3443
3417 TEST(Compile_Wasm_CallIndirect_Many_f64) { CompileCallIndirectMany(kAstF64); } 3444 TEST(Compile_Wasm_CallIndirect_Many_f64) { CompileCallIndirectMany(kAstF64); }
OLDNEW
« no previous file with comments | « test/cctest/compiler/value-helper.h ('k') | test/cctest/wasm/test-run-wasm-js.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698