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 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 }; | 2019 }; |
2020 for (size_t ii = 0; ii < arraysize(kTests); ++ii) { | 2020 for (size_t ii = 0; ii < arraysize(kTests); ++ii) { |
2021 if (!ValidationOf(Module(kTests[ii])) | 2021 if (!ValidationOf(Module(kTests[ii])) |
2022 ->FailsWithMessage("Can't assign to immutable symbol")) { | 2022 ->FailsWithMessage("Can't assign to immutable symbol")) { |
2023 std::cerr << "Test:\n" << kTests[ii]; | 2023 std::cerr << "Test:\n" << kTests[ii]; |
2024 CHECK(false); | 2024 CHECK(false); |
2025 } | 2025 } |
2026 } | 2026 } |
2027 } | 2027 } |
2028 | 2028 |
| 2029 TEST(B660813) { |
| 2030 const char* kTests[] = { |
| 2031 "function asm() {\n" |
| 2032 " 'use asm';\n" |
| 2033 " const i = 0xffffffff;\n" |
| 2034 " function f() {\n" |
| 2035 " return i;\n" |
| 2036 " }\n" |
| 2037 "}", |
| 2038 "function asm() {\n" |
| 2039 " 'use asm';\n" |
| 2040 " const i = -(-2147483648);\n" |
| 2041 " function f() {\n" |
| 2042 " return i;\n" |
| 2043 " }\n" |
| 2044 "}", |
| 2045 }; |
| 2046 for (size_t ii = 0; ii < arraysize(kTests); ++ii) { |
| 2047 if (!ValidationOf(Module(kTests[ii])) |
| 2048 ->FailsWithMessage( |
| 2049 "Constant in return must be signed, float, or double.")) { |
| 2050 std::cerr << "Test:\n" << kTests[ii]; |
| 2051 CHECK(false); |
| 2052 } |
| 2053 } |
| 2054 } |
| 2055 |
2029 } // namespace | 2056 } // namespace |
OLD | NEW |