OLD | NEW |
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/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "test/common/wasm/test-signatures.h" | 9 #include "test/common/wasm/test-signatures.h" |
10 | 10 |
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 } | 1816 } |
1817 | 1817 |
1818 TEST_F(AstDecoderTest, BreakNesting_6_levels) { | 1818 TEST_F(AstDecoderTest, BreakNesting_6_levels) { |
1819 for (int mask = 0; mask < 64; mask++) { | 1819 for (int mask = 0; mask < 64; mask++) { |
1820 for (int i = 0; i < 14; i++) { | 1820 for (int i = 0; i < 14; i++) { |
1821 byte code[] = {WASM_BLOCK(WASM_BLOCK( | 1821 byte code[] = {WASM_BLOCK(WASM_BLOCK( |
1822 WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BR(i)))))))}; | 1822 WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BR(i)))))))}; |
1823 | 1823 |
1824 int depth = 6; | 1824 int depth = 6; |
1825 int m = mask; | 1825 int m = mask; |
1826 for (size_t pos = 0; pos < sizeof(code); pos++) { | 1826 for (size_t pos = 0; pos < sizeof(code) - 1; pos++) { |
1827 if (code[pos] != kExprBlock) continue; | 1827 if (code[pos] != kExprBlock) continue; |
1828 if (m & 1) { | 1828 if (m & 1) { |
1829 code[pos] = kExprLoop; | 1829 code[pos] = kExprLoop; |
1830 code[pos + 1] = kLocalVoid; | 1830 code[pos + 1] = kLocalVoid; |
1831 } | 1831 } |
1832 m >>= 1; | 1832 m >>= 1; |
1833 } | 1833 } |
1834 | 1834 |
1835 if (i <= depth) { | 1835 if (i <= depth) { |
1836 EXPECT_VERIFIES_C(v_v, code); | 1836 EXPECT_VERIFIES_C(v_v, code); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 iter.next(); | 2669 iter.next(); |
2670 EXPECT_TRUE(iter.has_next()); | 2670 EXPECT_TRUE(iter.has_next()); |
2671 EXPECT_EQ(kExprI8Const, iter.current()); | 2671 EXPECT_EQ(kExprI8Const, iter.current()); |
2672 iter.next(); | 2672 iter.next(); |
2673 EXPECT_FALSE(iter.has_next()); | 2673 EXPECT_FALSE(iter.has_next()); |
2674 } | 2674 } |
2675 | 2675 |
2676 } // namespace wasm | 2676 } // namespace wasm |
2677 } // namespace internal | 2677 } // namespace internal |
2678 } // namespace v8 | 2678 } // namespace v8 |
OLD | NEW |