| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 <cstring> | 5 #include <cstring> |
| 6 #include <functional> | 6 #include <functional> |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/asmjs/asm-typer.h" | 10 #include "src/asmjs/asm-typer.h" |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 {"function f(a) {\n" | 849 {"function f(a) {\n" |
| 850 " a = a|0;\n" | 850 " a = a|0;\n" |
| 851 " return a;\n" | 851 " return a;\n" |
| 852 "}\n", | 852 "}\n", |
| 853 "in return statement is not const"}, | 853 "in return statement is not const"}, |
| 854 {"function f() {\n" | 854 {"function f() {\n" |
| 855 " return a;\n" | 855 " return a;\n" |
| 856 "}\n", | 856 "}\n", |
| 857 "Undeclared identifier in return statement"}, | 857 "Undeclared identifier in return statement"}, |
| 858 {"function f() {\n" | 858 {"function f() {\n" |
| 859 " var i = 0;\n" |
| 859 " return i?0:1;\n" | 860 " return i?0:1;\n" |
| 860 "}\n", | 861 "}\n", |
| 861 "Invalid return type expression"}, | 862 "Type mismatch in return statement"}, |
| 862 {"function f() {\n" | 863 {"function f() {\n" |
| 863 " return stdlib.Math.E;" | 864 " return stdlib.Math.E;" |
| 864 "}\n", | 865 "}\n", |
| 865 "Invalid return type expression"}, | 866 "Invalid return type expression"}, |
| 866 {"function f() {\n" | 867 {"function f() {\n" |
| 867 " return E[0];" | 868 " return E[0];" |
| 868 "}\n", | 869 "}\n", |
| 869 "Invalid return type expression"}, | 870 "Invalid return type expression"}, |
| 870 {"function I() {}\n", "Identifier redefined as function"}, | 871 {"function I() {}\n", "Identifier redefined as function"}, |
| 871 {"function foo() {}\n", "Identifier redefined as function"}, | 872 {"function foo() {}\n", "Identifier redefined as function"}, |
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 if (!ValidationOf(Module(kTests[ii])) | 2078 if (!ValidationOf(Module(kTests[ii])) |
| 2078 ->FailsWithMessage( | 2079 ->FailsWithMessage( |
| 2079 "Constant in return must be signed, float, or double.")) { | 2080 "Constant in return must be signed, float, or double.")) { |
| 2080 std::cerr << "Test:\n" << kTests[ii]; | 2081 std::cerr << "Test:\n" << kTests[ii]; |
| 2081 CHECK(false); | 2082 CHECK(false); |
| 2082 } | 2083 } |
| 2083 } | 2084 } |
| 2084 } | 2085 } |
| 2085 | 2086 |
| 2086 } // namespace | 2087 } // namespace |
| OLD | NEW |