Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Unified Diff: test/cctest/test-asm-validator.cc

Issue 1832603002: Properly handle unsigned literals, fix typing issue with unary +. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: drop print Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/asm-wasm-builder.cc ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-asm-validator.cc
diff --git a/test/cctest/test-asm-validator.cc b/test/cctest/test-asm-validator.cc
index 92ac6bdf1fb0ab094f32a92878f6b1405bedad42..d5b51797d6b25175e50f69cc7c2349d248e8c585 100644
--- a/test/cctest/test-asm-validator.cc
+++ b/test/cctest/test-asm-validator.cc
@@ -1985,6 +1985,20 @@ TEST(BadFunctionCallOutside) {
"asm: line 2: illegal variable reference in module body\n");
}
+TEST(UnaryPlusOnIntForbidden) {
+ CHECK_FUNC_ERROR(
+ "function bar() { var x = 1; return +x; }\n"
+ "function foo() { bar(); }",
+ "asm: line 1: "
+ "unary + only allowed on signed, unsigned, float?, or double?\n");
+}
+
+TEST(MultiplyNon1ConvertForbidden) {
+ CHECK_FUNC_ERROR(
+ "function bar() { var x = 0.0; return x * 2.0; }\n"
+ "function foo() { bar(); }",
+ "asm: line 1: invalid type annotation on binary op\n");
+}
TEST(NestedVariableAssignment) {
CHECK_FUNC_TYPES_BEGIN(
« no previous file with comments | « src/wasm/asm-wasm-builder.cc ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698