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

Side by Side Diff: test/cctest/test-asm-validator.cc

Issue 1492123002: Preserve information about dots in numbers across parser rewriting. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/parsing/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | 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 // TODO(jochen): Remove this after the setting is turned on globally. 5 // TODO(jochen): Remove this after the setting is turned on globally.
6 #define V8_IMMINENT_DEPRECATION_WARNINGS 6 #define V8_IMMINENT_DEPRECATION_WARNINGS
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/ast/ast.h" 10 #include "src/ast/ast.h"
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 } 1772 }
1773 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); 1773 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
1774 } 1774 }
1775 } 1775 }
1776 CHECK_SKIP(); 1776 CHECK_SKIP();
1777 } 1777 }
1778 CHECK_FUNC_TYPES_END 1778 CHECK_FUNC_TYPES_END
1779 } 1779 }
1780 1780
1781 1781
1782 TEST(NegativeDouble) {
1783 CHECK_FUNC_TYPES_BEGIN(
1784 "function bar() { var x = -123.2; }\n"
1785 "function foo() { bar(); }") {
1786 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) {
1787 CHECK_EXPR(Assignment, Bounds(cache.kAsmDouble)) {
1788 CHECK_VAR(x, Bounds(cache.kAsmDouble));
1789 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble));
1790 }
1791 }
1792 CHECK_SKIP();
1793 }
1794 CHECK_FUNC_TYPES_END
1795 }
1796
1797
1798 TEST(NegativeInteger) {
1799 CHECK_FUNC_TYPES_BEGIN(
1800 "function bar() { var x = -123; }\n"
1801 "function foo() { bar(); }") {
1802 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) {
1803 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) {
1804 CHECK_VAR(x, Bounds(cache.kAsmInt));
1805 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned));
1806 }
1807 }
1808 CHECK_SKIP();
1809 }
1810 CHECK_FUNC_TYPES_END
1811 }
1812
1813
1782 TEST(TypeConsistency) { 1814 TEST(TypeConsistency) {
1783 v8::V8::Initialize(); 1815 v8::V8::Initialize();
1784 TypeCache cache; 1816 TypeCache cache;
1785 // Check the consistency of each of the main Asm.js types. 1817 // Check the consistency of each of the main Asm.js types.
1786 CHECK(cache.kAsmFixnum->Is(cache.kAsmFixnum)); 1818 CHECK(cache.kAsmFixnum->Is(cache.kAsmFixnum));
1787 CHECK(cache.kAsmFixnum->Is(cache.kAsmSigned)); 1819 CHECK(cache.kAsmFixnum->Is(cache.kAsmSigned));
1788 CHECK(cache.kAsmFixnum->Is(cache.kAsmUnsigned)); 1820 CHECK(cache.kAsmFixnum->Is(cache.kAsmUnsigned));
1789 CHECK(cache.kAsmFixnum->Is(cache.kAsmInt)); 1821 CHECK(cache.kAsmFixnum->Is(cache.kAsmInt));
1790 CHECK(!cache.kAsmFixnum->Is(cache.kAsmFloat)); 1822 CHECK(!cache.kAsmFixnum->Is(cache.kAsmFloat));
1791 CHECK(!cache.kAsmFixnum->Is(cache.kAsmDouble)); 1823 CHECK(!cache.kAsmFixnum->Is(cache.kAsmDouble));
(...skipping 26 matching lines...) Expand all
1818 CHECK(!cache.kAsmFloat->Is(cache.kAsmFixnum)); 1850 CHECK(!cache.kAsmFloat->Is(cache.kAsmFixnum));
1819 CHECK(!cache.kAsmFloat->Is(cache.kAsmDouble)); 1851 CHECK(!cache.kAsmFloat->Is(cache.kAsmDouble));
1820 1852
1821 CHECK(cache.kAsmDouble->Is(cache.kAsmDouble)); 1853 CHECK(cache.kAsmDouble->Is(cache.kAsmDouble));
1822 CHECK(!cache.kAsmDouble->Is(cache.kAsmInt)); 1854 CHECK(!cache.kAsmDouble->Is(cache.kAsmInt));
1823 CHECK(!cache.kAsmDouble->Is(cache.kAsmUnsigned)); 1855 CHECK(!cache.kAsmDouble->Is(cache.kAsmUnsigned));
1824 CHECK(!cache.kAsmDouble->Is(cache.kAsmSigned)); 1856 CHECK(!cache.kAsmDouble->Is(cache.kAsmSigned));
1825 CHECK(!cache.kAsmDouble->Is(cache.kAsmFixnum)); 1857 CHECK(!cache.kAsmDouble->Is(cache.kAsmFixnum));
1826 CHECK(!cache.kAsmDouble->Is(cache.kAsmFloat)); 1858 CHECK(!cache.kAsmDouble->Is(cache.kAsmFloat));
1827 } 1859 }
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698