Index: test/cctest/test-asm-validator.cc |
diff --git a/test/cctest/test-asm-validator.cc b/test/cctest/test-asm-validator.cc |
index 39d490e7a931761924ac310a62635d51145383b2..acbe9dac6f06eb83ff27d057bb8e35717b63a180 100644 |
--- a/test/cctest/test-asm-validator.cc |
+++ b/test/cctest/test-asm-validator.cc |
@@ -1318,7 +1318,40 @@ TEST(Division4) { |
CHECK_FUNC_ERROR( |
"function bar() { var x = 1; var y = 2; return (x/y/x/y)|0; }\n" |
"function foo() { bar(); }", |
- "asm: line 1: too many consecutive multiplicative ops\n"); |
+ "asm: line 1: left and right side of integer / or % " |
+ "must match and be signed or unsigned\n"); |
+} |
+ |
+TEST(ModInt) { |
+ CHECK_FUNC_ERROR( |
+ "function bar() { var x = 1; var y = 2; return (x%y)|0; }\n" |
+ "function foo() { bar(); }", |
+ "asm: line 1: left and right side of integer / or % " |
+ "must match and be signed or unsigned\n"); |
+} |
+ |
+TEST(DivInt) { |
+ CHECK_FUNC_ERROR( |
+ "function bar() { var x = 1; var y = 2; return (x/y)|0; }\n" |
+ "function foo() { bar(); }", |
+ "asm: line 1: left and right side of integer / or % " |
+ "must match and be signed or unsigned\n"); |
+} |
+ |
+TEST(ModIntMismatch) { |
+ CHECK_FUNC_ERROR( |
+ "function bar() { var x = 1; var y = 2; return ((x|0)%(y>>>0))|0; }\n" |
+ "function foo() { bar(); }", |
+ "asm: line 1: left and right side of integer / or % " |
+ "must match and be signed or unsigned\n"); |
+} |
+ |
+TEST(DivIntMismatch) { |
+ CHECK_FUNC_ERROR( |
+ "function bar() { var x = 1; var y = 2; return ((x|0)/(y>>>0))|0; }\n" |
+ "function foo() { bar(); }", |
+ "asm: line 1: left and right side of integer / or % " |
+ "must match and be signed or unsigned\n"); |
} |