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

Side by Side Diff: test/unittests/wasm/wasm-macro-gen-unittest.cc

Issue 2628203003: Reland of [wasm] Enforce that function bodies end with the \"end\" opcode. (Closed)
Patch Set: Created 3 years, 11 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/unittests/wasm/module-decoder-unittest.cc ('k') | no next file » | 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 "test/unittests/test-utils.h" 5 #include "test/unittests/test-utils.h"
6 6
7 #include "src/wasm/wasm-macro-gen.h" 7 #include "src/wasm/wasm-macro-gen.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 EXPECT_SIZE(5, WASM_F32(10000.0f)); 42 EXPECT_SIZE(5, WASM_F32(10000.0f));
43 EXPECT_SIZE(5, WASM_F32(-9828934.0f)); 43 EXPECT_SIZE(5, WASM_F32(-9828934.0f));
44 44
45 EXPECT_SIZE(9, WASM_F64(1.5)); 45 EXPECT_SIZE(9, WASM_F64(1.5));
46 EXPECT_SIZE(9, WASM_F64(10200.0)); 46 EXPECT_SIZE(9, WASM_F64(10200.0));
47 EXPECT_SIZE(9, WASM_F64(-9818934.0)); 47 EXPECT_SIZE(9, WASM_F64(-9818934.0));
48 } 48 }
49 49
50 TEST_F(WasmMacroGenTest, Statements) { 50 TEST_F(WasmMacroGenTest, Statements) {
51 EXPECT_SIZE(1, WASM_NOP); 51 EXPECT_SIZE(1, WASM_NOP);
52 EXPECT_SIZE(1, WASM_END);
52 53
53 EXPECT_SIZE(4, WASM_SET_LOCAL(0, WASM_ZERO)); 54 EXPECT_SIZE(4, WASM_SET_LOCAL(0, WASM_ZERO));
54 55
55 EXPECT_SIZE(4, WASM_SET_GLOBAL(0, WASM_ZERO)); 56 EXPECT_SIZE(4, WASM_SET_GLOBAL(0, WASM_ZERO));
56 57
57 EXPECT_SIZE(7, WASM_STORE_MEM(MachineType::Int32(), WASM_ZERO, WASM_ZERO)); 58 EXPECT_SIZE(7, WASM_STORE_MEM(MachineType::Int32(), WASM_ZERO, WASM_ZERO));
58 59
59 EXPECT_SIZE(6, WASM_IF(WASM_ZERO, WASM_NOP)); 60 EXPECT_SIZE(6, WASM_IF(WASM_ZERO, WASM_NOP));
60 61
61 EXPECT_SIZE(8, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP)); 62 EXPECT_SIZE(8, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP));
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO)); 304 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO));
304 } 305 }
305 for (size_t i = 0; i < arraysize(kMemTypes); i++) { 306 for (size_t i = 0; i < arraysize(kMemTypes); i++) {
306 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO, 307 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO,
307 WASM_GET_LOCAL(0))); 308 WASM_GET_LOCAL(0)));
308 } 309 }
309 } 310 }
310 } // namespace wasm 311 } // namespace wasm
311 } // namespace internal 312 } // namespace internal
312 } // namespace v8 313 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/wasm/module-decoder-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698