| 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/cctest/wasm/test-signatures.h" | 9 #include "test/cctest/wasm/test-signatures.h" |
| 10 | 10 |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 | 1826 |
| 1827 EXPECT_FAILURE_INLINE( | 1827 EXPECT_FAILURE_INLINE( |
| 1828 sigs.i_i(), | 1828 sigs.i_i(), |
| 1829 WASM_SELECT(WASM_F32(9.9), WASM_GET_LOCAL(0), WASM_I64V_1(0))); | 1829 WASM_SELECT(WASM_F32(9.9), WASM_GET_LOCAL(0), WASM_I64V_1(0))); |
| 1830 } | 1830 } |
| 1831 | 1831 |
| 1832 TEST_F(AstDecoderTest, Throw) { | 1832 TEST_F(AstDecoderTest, Throw) { |
| 1833 FLAG_wasm_eh_prototype = true; | 1833 FLAG_wasm_eh_prototype = true; |
| 1834 EXPECT_VERIFIES_INLINE(sigs.v_i(), WASM_GET_LOCAL(0), kExprThrow); | 1834 EXPECT_VERIFIES_INLINE(sigs.v_i(), WASM_GET_LOCAL(0), kExprThrow); |
| 1835 | 1835 |
| 1836 // TODO(jpp): can't throw d, f, or l. | 1836 EXPECT_FAILURE_INLINE(sigs.i_d(), WASM_GET_LOCAL(0), kExprThrow, |
| 1837 EXPECT_VERIFIES_INLINE(sigs.i_d(), WASM_GET_LOCAL(0), kExprThrow, | 1837 WASM_I32V(0)); |
| 1838 WASM_I32V(0)); | 1838 EXPECT_FAILURE_INLINE(sigs.i_f(), WASM_GET_LOCAL(0), kExprThrow, |
| 1839 EXPECT_VERIFIES_INLINE(sigs.i_f(), WASM_GET_LOCAL(0), kExprThrow, | 1839 WASM_I32V(0)); |
| 1840 WASM_I32V(0)); | 1840 EXPECT_FAILURE_INLINE(sigs.l_l(), WASM_GET_LOCAL(0), kExprThrow, |
| 1841 EXPECT_VERIFIES_INLINE(sigs.l_l(), WASM_GET_LOCAL(0), kExprThrow, | 1841 WASM_I64V(0)); |
| 1842 WASM_I64V(0)); | |
| 1843 } | 1842 } |
| 1844 | 1843 |
| 1845 #define WASM_CATCH(local) kExprCatch, static_cast<byte>(local) | 1844 #define WASM_CATCH(local) kExprCatch, static_cast<byte>(local) |
| 1846 TEST_F(AstDecoderTest, TryCatch) { | 1845 TEST_F(AstDecoderTest, TryCatch) { |
| 1847 FLAG_wasm_eh_prototype = true; | 1846 FLAG_wasm_eh_prototype = true; |
| 1848 EXPECT_VERIFIES_INLINE(sigs.v_i(), kExprTryCatch, WASM_CATCH(0), kExprEnd); | 1847 EXPECT_VERIFIES_INLINE(sigs.v_i(), kExprTryCatch, WASM_CATCH(0), kExprEnd); |
| 1849 | 1848 |
| 1850 // Missing catch. | 1849 // Missing catch. |
| 1851 EXPECT_FAILURE_INLINE(sigs.v_v(), kExprTryCatch, kExprEnd); | 1850 EXPECT_FAILURE_INLINE(sigs.v_v(), kExprTryCatch, kExprEnd); |
| 1852 | 1851 |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2562 iter.next(); | 2561 iter.next(); |
| 2563 EXPECT_TRUE(iter.has_next()); | 2562 EXPECT_TRUE(iter.has_next()); |
| 2564 EXPECT_EQ(kExprI8Const, iter.current()); | 2563 EXPECT_EQ(kExprI8Const, iter.current()); |
| 2565 iter.next(); | 2564 iter.next(); |
| 2566 EXPECT_FALSE(iter.has_next()); | 2565 EXPECT_FALSE(iter.has_next()); |
| 2567 } | 2566 } |
| 2568 | 2567 |
| 2569 } // namespace wasm | 2568 } // namespace wasm |
| 2570 } // namespace internal | 2569 } // namespace internal |
| 2571 } // namespace v8 | 2570 } // namespace v8 |
| OLD | NEW |