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

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

Issue 1692713006: Allow looser heap accesses historically emitted by Emscripten. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix 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/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 97530335ebe08a988eba849ba169fc9bef814ac6..3bee1d8f188c454e05704fb1b27f39353b052f61 100644
--- a/test/cctest/test-asm-validator.cc
+++ b/test/cctest/test-asm-validator.cc
@@ -1326,7 +1326,7 @@ TEST(Load1) {
CHECK_EXPR(Property, Bounds(cache.kAsmInt)) {
CHECK_VAR(i8, Bounds(cache.kInt8Array));
CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) {
- CHECK_VAR(x, Bounds(cache.kAsmSigned));
+ CHECK_VAR(x, Bounds(cache.kAsmInt));
CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
}
}
@@ -1386,7 +1386,7 @@ TEST(Store1) {
CHECK_EXPR(Property, Bounds::Unbounded()) {
CHECK_VAR(i8, Bounds(cache.kInt8Array));
CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) {
- CHECK_VAR(x, Bounds(cache.kAsmSigned));
+ CHECK_VAR(x, Bounds(cache.kAsmInt));
CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
}
}
@@ -1750,6 +1750,28 @@ TEST(ForeignFunction) {
CHECK_FUNC_TYPES_END_2()
}
+TEST(ByteArray) {
+ // Forbidden by asm.js spec, present in embenchen.
+ CHECK_FUNC_TYPES_BEGIN(
+ "function bar() { var x = 0; i8[x] = 2; }\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_EXPR(Property, Bounds::Unbounded()) {
+ CHECK_VAR(i8, Bounds(cache.kInt8Array));
+ CHECK_VAR(x, Bounds(cache.kAsmSigned));
+ }
+ CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
+ }
+ }
+ CHECK_SKIP();
+ }
+ CHECK_FUNC_TYPES_END
+}
TEST(BadExports) {
HARNESS_PREAMBLE()
@@ -1768,7 +1790,14 @@ TEST(BadExports) {
TEST(NestedHeapAssignment) {
CHECK_FUNC_ERROR(
- "function bar() { var x = 0; i8[x = 1] = 2; }\n"
+ "function bar() { var x = 0; i16[x = 1] = 2; }\n"
+ "function foo() { bar(); }",
+ "asm: line 39: expected >> in heap access\n");
+}
+
+TEST(BadOperatorHeapAssignment) {
+ CHECK_FUNC_ERROR(
+ "function bar() { var x = 0; i16[x & 1] = 2; }\n"
"function foo() { bar(); }",
"asm: line 39: expected >> in heap access\n");
}
« 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