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

Side by Side Diff: test/cctest/test-asm-validator.cc

Issue 2040983002: [asmjs] Validator should reject modules with repeated functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/typing-asm.cc ('k') | test/mjsunit/regress/regress-617525.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/ast-expression-visitor.h" 8 #include "src/ast/ast-expression-visitor.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/parsing/parser.h" 10 #include "src/parsing/parser.h"
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 } 1354 }
1355 1355
1356 1356
1357 TEST(CompareMismatchInt32Float32) { 1357 TEST(CompareMismatchInt32Float32) {
1358 CHECK_FUNC_ERROR( 1358 CHECK_FUNC_ERROR(
1359 "function bar() { var x = 1; var y = 2.0; return (x < fround(y))|0; }\n" 1359 "function bar() { var x = 1; var y = 2.0; return (x < fround(y))|0; }\n"
1360 "function foo() { bar(); }", 1360 "function foo() { bar(); }",
1361 "asm: line 1: left and right side of comparison must match\n"); 1361 "asm: line 1: left and right side of comparison must match\n");
1362 } 1362 }
1363 1363
1364 TEST(FunctionRepeated) {
1365 CHECK_FUNC_ERROR(
1366 "function foo() { return 0; }\n"
1367 "function foo() { return 0; }",
1368 "asm: line 2: function repeated in module\n");
1369 }
1364 1370
1365 TEST(Float64ToInt32) { 1371 TEST(Float64ToInt32) {
1366 CHECK_FUNC_TYPES_BEGIN( 1372 CHECK_FUNC_TYPES_BEGIN(
1367 "function bar() { var x = 1; var y = 0.0; x = ~~y; }\n" 1373 "function bar() { var x = 1; var y = 0.0; x = ~~y; }\n"
1368 "function foo() { bar(); }") { 1374 "function foo() { bar(); }") {
1369 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { 1375 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) {
1370 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { 1376 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) {
1371 CHECK_VAR(x, Bounds(cache.kAsmInt)); 1377 CHECK_VAR(x, Bounds(cache.kAsmInt));
1372 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); 1378 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
1373 } 1379 }
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2500 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmDouble)) { 2506 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmDouble)) {
2501 CHECK_VAR(x, Bounds(cache.kAsmDouble)); 2507 CHECK_VAR(x, Bounds(cache.kAsmDouble));
2502 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); 2508 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble));
2503 } 2509 }
2504 } 2510 }
2505 } 2511 }
2506 CHECK_SKIP(); 2512 CHECK_SKIP();
2507 } 2513 }
2508 CHECK_FUNC_TYPES_END 2514 CHECK_FUNC_TYPES_END
2509 } 2515 }
OLDNEW
« no previous file with comments | « src/typing-asm.cc ('k') | test/mjsunit/regress/regress-617525.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698