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

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

Issue 1722473002: Allow intish and floatish to be coerced by heap assignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge Created 4 years, 10 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/typing-asm.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 3bee1d8f188c454e05704fb1b27f39353b052f61..207b915378320c032f2012e93c3921ab4b519ff0 100644
--- a/test/cctest/test-asm-validator.cc
+++ b/test/cctest/test-asm-validator.cc
@@ -1434,6 +1434,71 @@ TEST(StoreFloat) {
CHECK_FUNC_TYPES_END
}
+TEST(StoreIntish) {
+ CHECK_FUNC_TYPES_BEGIN(
+ "function bar() { var x = 1; var y = 1; i32[0] = x + y; }\n"
+ "function foo() { bar(); }") {
+ CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) {
+ CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) {
+ CHECK_VAR(x, Bounds(cache.kAsmInt));
+ CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
+ }
+ CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) {
+ CHECK_VAR(y, Bounds(cache.kAsmInt));
+ CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
+ }
+ CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) {
+ CHECK_EXPR(Property, Bounds::Unbounded()) {
+ CHECK_VAR(i32, Bounds(cache.kInt32Array));
+ CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
+ }
+ CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmInt)) {
+ CHECK_VAR(x, Bounds(cache.kAsmInt));
+ CHECK_VAR(y, Bounds(cache.kAsmInt));
+ }
+ }
+ }
+ CHECK_SKIP();
+ }
+ CHECK_FUNC_TYPES_END
+}
+
+TEST(StoreFloatish) {
+ CHECK_FUNC_TYPES_BEGIN(
+ "function bar() { "
+ "var x = fround(1.0); "
+ "var y = fround(1.0); f32[0] = x + y; }\n"
+ "function foo() { bar(); }") {
+ CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) {
+ CHECK_EXPR(Assignment, Bounds(cache.kAsmFloat)) {
+ CHECK_VAR(x, Bounds(cache.kAsmFloat));
+ CHECK_EXPR(Call, Bounds(cache.kAsmFloat)) {
+ CHECK_VAR(fround, FUNC_N2F_TYPE);
+ CHECK_EXPR(Literal, Bounds(cache.kAsmDouble));
+ }
+ }
+ CHECK_EXPR(Assignment, Bounds(cache.kAsmFloat)) {
+ CHECK_VAR(y, Bounds(cache.kAsmFloat));
+ CHECK_EXPR(Call, Bounds(cache.kAsmFloat)) {
+ CHECK_VAR(fround, FUNC_N2F_TYPE);
+ CHECK_EXPR(Literal, Bounds(cache.kAsmDouble));
+ }
+ }
+ CHECK_EXPR(Assignment, Bounds(cache.kAsmFloat)) {
+ CHECK_EXPR(Property, Bounds::Unbounded()) {
+ CHECK_VAR(f32, Bounds(cache.kFloat32Array));
+ CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
+ }
+ CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmFloat)) {
+ CHECK_VAR(x, Bounds(cache.kAsmFloat));
+ CHECK_VAR(y, Bounds(cache.kAsmFloat));
+ }
+ }
+ }
+ CHECK_SKIP();
+ }
+ CHECK_FUNC_TYPES_END
+}
TEST(Load1Constant) {
CHECK_FUNC_TYPES_BEGIN(
@@ -1712,9 +1777,9 @@ TEST(MismatchedReturnTypeExpression) {
TEST(AssignToFloatishToF64) {
CHECK_FUNC_ERROR(
- "function bar() { var v = fround(1.0); f32[0] = v + fround(1.0); }\n"
+ "function bar() { var v = fround(1.0); f64[0] = v + fround(1.0); }\n"
"function foo() { bar(); }",
- "asm: line 39: intish or floatish assignment\n");
+ "asm: line 39: floatish assignment to double array\n");
}
« no previous file with comments | « src/typing-asm.cc ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698