Skip to content

Commit

Permalink
dart2js: Rebaseline the CPS compiler tests.
Browse files Browse the repository at this point in the history
I've opted to try to keep them testing what they were before and not to make
them tests of inlining.

[email protected]
BUG=

Review URL: https://codereview.chromium.org//1323563002 .
  • Loading branch information
Kevin Millikin committed Aug 28, 2015
1 parent d732b68 commit e44f94f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function() {
P.print("(" + H.S(P.LinkedHashMap_LinkedHashMap$_literal(["s", 1])) + ")");
}"""),
const TestEntry("""
foo(a, [b = "b"]) => b;
bar(a, {b: "b", c: "c"}) => c;
foo(a, [b = "b"]) { print(b); return b; }
bar(a, {b: "b", c: "c"}) { print(c); return c; }
main() {
foo(0);
foo(1, 2);
Expand All @@ -58,6 +58,7 @@ function() {
const TestEntry(
"""
foo(a) {
print(a);
return a;
}
main() {
Expand All @@ -83,7 +84,7 @@ function() {
}"""),
const TestEntry(
"""
foo() { return 42; }
foo() { print(42); return 42; }
main() { return foo(); }
""",
"""function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function() {
}"""),

const TestEntry("""
staticMethod(x) => x;
staticMethod(x) { print(x); return x; }
main(x) {
var tearOff = staticMethod;
print(tearOff(123));
Expand Down
10 changes: 5 additions & 5 deletions tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function() {
;
}"""),
const TestEntry("""
foo(a) => a;
foo(a) { print(a); return a; }
main() {
while (true) {
Expand All @@ -46,7 +46,7 @@ function() {
}
}"""),
const TestEntry("""
foo(a) => a;
foo(a) { print(a); return a; }
main() {
for (int i = 0; foo(true); i = foo(i)) {
Expand All @@ -65,7 +65,7 @@ function() {
P.print(2);
}"""),
const TestEntry("""
foo(a) => a;
foo(a) { print(a); return a; }
main() {
if (foo(true)) {
Expand All @@ -80,7 +80,7 @@ function() {
P.print(3);
}"""),
const TestEntry("""
foo(a) => a;
foo(a) { print(a); return a; }
main() {
if (foo(true)) {
Expand Down Expand Up @@ -114,7 +114,7 @@ function() {
P.print("good");
}"""),
const TestEntry("""
foo() => 2;
foo() { print('2'); return 2; }
main() {
if (foo()) {
print('bad');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function() {
P.print(V.foo() ? "hello world" : "bad bad");
}"""),
const TestEntry("""
foo() => null;
foo() { print('foo'); }
main() {
print(foo() ? "hello world" : "bad bad");
}""","""
Expand Down

0 comments on commit e44f94f

Please sign in to comment.