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 828a0cd12e3a2b7dd3bfcc28b6a7c5aeaf243779..290bd6c814f4a7b25919fbee48d6d62f7dc5f4e5 100644 |
--- a/test/cctest/asmjs/test-asm-typer.cc |
+++ b/test/cctest/asmjs/test-asm-typer.cc |
@@ -505,14 +505,15 @@ TEST(ErrorsInGlobalVariableDefinition) { |
const char* error_message; |
} kTests[] = { |
{"var v;", "Global variable missing initializer"}, |
- {"var v = uninitialized;", "Invalid global variable initializer"}, |
+ {"var v = uninitialized;", "Undeclared identifier in global"}, |
{"var v = 'use asm';", "type annotation - forbidden literal"}, |
{"var v = 4294967296;", " - forbidden literal"}, |
- {"var v = not_fround;", "Invalid global variable initializer"}, |
+ {"var v = not_fround;", "initialize a global must be a const"}, |
{"var v = not_fround(1);", "expected call fround(literal)"}, |
{"var v = __fround__(1.0);", "expected call fround(literal)"}, |
{"var v = fround(1.0, 1.0);", "expected call fround(literal)"}, |
{"var v = fround(not_fround);", "literal argument for call to fround"}, |
+ {"var v = i?0:1;", "Invalid global variable initializer"}, |
{"var v = stdlib.nan", "Invalid import"}, |
{"var v = stdlib.Math.nan", "Invalid import"}, |
{"var v = stdlib.Mathh.E", "Invalid import"}, |
@@ -788,6 +789,19 @@ TEST(ErrorsInFunction) { |
" var c = 0;\n" |
"}\n", |
"Local variable missing initializer in asm.js module"}, |
+ {"function f(a) {\n" |
+ " a = a|0;\n" |
+ " var x = a;\n" |
+ "}\n", |
+ "variable declaration initializer must be const"}, |
+ {"function f() {\n" |
+ " var x = 1+i;\n" |
+ "}\n", |
+ "should be a literal, const, or fround(literal"}, |
+ {"function f() {\n" |
+ " var x = a;\n" |
+ "}\n", |
+ "Undeclared identifier in variable declaration initializer"}, |
{"function f() {\n" |
" function ff() {}\n" |
"}\n", |
@@ -812,6 +826,19 @@ TEST(ErrorsInFunction) { |
" return 2147483648;\n" |
"}\n", |
"Invalid literal in return statement"}, |
+ {"function f(a) {\n" |
+ " a = a|0;\n" |
+ " return a;\n" |
+ "}\n", |
+ "in return statement is not const"}, |
+ {"function f() {\n" |
+ " return a;\n" |
+ "}\n", |
+ "Undeclared identifier in return statement"}, |
+ {"function f() {\n" |
+ " return i?0:1;\n" |
+ "}\n", |
+ "Invalid return type expression"}, |
{"function f() {\n" |
" return stdlib.Math.E;" |
"}\n", |