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

Side by Side Diff: test/unittests/wasm/ast-decoder-unittest.cc

Issue 2253543003: [wasm] Macro-ify checking of prototype flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] Macro-ify checking of prototype flags. Created 4 years, 4 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 | « src/wasm/ast-decoder.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/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
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
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
OLDNEW
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698