Index: test/cctest/asmjs/test-asm-typer.cc |
diff --git a/test/cctest/asmjs/test-asm-typer.cc b/test/cctest/asmjs/test-asm-typer.cc |
index 4eaa154a6eabb45fc3b93ebb626177965701796f..0050e88a8b2eded61efd2c25f856aef2e45b6652 100644 |
--- a/test/cctest/asmjs/test-asm-typer.cc |
+++ b/test/cctest/asmjs/test-asm-typer.cc |
@@ -2026,4 +2026,31 @@ TEST(B640194) { |
} |
} |
+TEST(B660813) { |
+ const char* kTests[] = { |
+ "function asm() {\n" |
+ " 'use asm';\n" |
+ " const i = 0xffffffff;\n" |
+ " function f() {\n" |
+ " return i;\n" |
+ " }\n" |
+ "}", |
+ "function asm() {\n" |
+ " 'use asm';\n" |
+ " const i = -(-2147483648);\n" |
+ " function f() {\n" |
+ " return i;\n" |
+ " }\n" |
+ "}", |
+ }; |
+ for (size_t ii = 0; ii < arraysize(kTests); ++ii) { |
+ if (!ValidationOf(Module(kTests[ii])) |
+ ->FailsWithMessage( |
+ "Constant in return must be signed, float, or double.")) { |
+ std::cerr << "Test:\n" << kTests[ii]; |
+ CHECK(false); |
+ } |
+ } |
+} |
+ |
} // namespace |