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 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 } | 1840 } |
1841 | 1841 |
1842 TEST_F(AstDecoderTest, BreakNesting_6_levels) { | 1842 TEST_F(AstDecoderTest, BreakNesting_6_levels) { |
1843 for (int mask = 0; mask < 64; mask++) { | 1843 for (int mask = 0; mask < 64; mask++) { |
1844 for (int i = 0; i < 14; i++) { | 1844 for (int i = 0; i < 14; i++) { |
1845 byte code[] = {WASM_BLOCK(WASM_BLOCK( | 1845 byte code[] = {WASM_BLOCK(WASM_BLOCK( |
1846 WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BR(i)))))))}; | 1846 WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BLOCK(WASM_BR(i)))))))}; |
1847 | 1847 |
1848 int depth = 6; | 1848 int depth = 6; |
1849 int m = mask; | 1849 int m = mask; |
1850 for (size_t pos = 0; pos < sizeof(code); pos++) { | 1850 for (size_t pos = 0; pos < sizeof(code) - 1; pos++) { |
1851 if (code[pos] != kExprBlock) continue; | 1851 if (code[pos] != kExprBlock) continue; |
1852 if (m & 1) { | 1852 if (m & 1) { |
1853 code[pos] = kExprLoop; | 1853 code[pos] = kExprLoop; |
1854 code[pos + 1] = kLocalVoid; | 1854 code[pos + 1] = kLocalVoid; |
1855 } | 1855 } |
1856 m >>= 1; | 1856 m >>= 1; |
1857 } | 1857 } |
1858 | 1858 |
1859 if (i <= depth) { | 1859 if (i <= depth) { |
1860 EXPECT_VERIFIES_C(v_v, code); | 1860 EXPECT_VERIFIES_C(v_v, code); |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2709 iter.next(); | 2709 iter.next(); |
2710 EXPECT_TRUE(iter.has_next()); | 2710 EXPECT_TRUE(iter.has_next()); |
2711 EXPECT_EQ(kExprI8Const, iter.current()); | 2711 EXPECT_EQ(kExprI8Const, iter.current()); |
2712 iter.next(); | 2712 iter.next(); |
2713 EXPECT_FALSE(iter.has_next()); | 2713 EXPECT_FALSE(iter.has_next()); |
2714 } | 2714 } |
2715 | 2715 |
2716 } // namespace wasm | 2716 } // namespace wasm |
2717 } // namespace internal | 2717 } // namespace internal |
2718 } // namespace v8 | 2718 } // namespace v8 |
OLD | NEW |