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

Unified Diff: tests/compiler/dart2js/js_backend_cps_ir_operators2_test.dart

Issue 1537663002: dart2js: Initial implementation of inlining. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebaseline test expectations and fix a bug (typo). Created 5 years 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
Index: tests/compiler/dart2js/js_backend_cps_ir_operators2_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators2_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators2_test.dart
index 1ced961970fd6b10af5ccbaed00650a4d0588813..21ffdc512bf1134910c8ece5509657dc2ff5180d 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_operators2_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators2_test.dart
@@ -10,26 +10,26 @@ import 'js_backend_cps_ir.dart';
const List<TestEntry> tests = const [
- const TestEntry.forMethod('function(foo)',
- r"""
+ const TestEntry(r"""
foo(a, b) => ((a & 0xff0000) >> 1) & b;
main() {
print(foo(123, 234));
print(foo(0, 2));
}""", r"""
-function(a, b) {
- return (a & 16711680) >>> 1 & b;
+function() {
+ P.print((123 & 16711680) >>> 1 & 234);
+ P.print((0 & 16711680) >>> 1 & 2);
}"""),
- const TestEntry.forMethod('function(foo)',
- r"""
+ const TestEntry(r"""
foo(a) => ~a;
main() {
print(foo(1));
print(foo(10));
}""", r"""
-function(a) {
- return ~a >>> 0;
+function() {
+ P.print(~1 >>> 0);
+ P.print(~10 >>> 0);
}"""),
const TestEntry.forMethod('function(foo)',
@@ -40,29 +40,30 @@ main() {
print(foo(-100));
}""", r"""
function(a) {
- return C.JSInt_methods.$mod(a, 13);
+ var result = a % 13;
+ return result === 0 ? 0 : result > 0 ? result : 13 < 0 ? result - 13 : result + 13;
}"""),
- const TestEntry.forMethod('function(foo)',
- r"""
+ const TestEntry(r"""
foo(a) => a % 13;
main() {
print(foo(5));
print(foo(100));
}""", r"""
-function(a) {
- return a % 13;
+function() {
+ P.print(5 % 13);
+ P.print(100 % 13);
}"""),
- const TestEntry.forMethod('function(foo)',
- r"""
+ const TestEntry(r"""
foo(a) => a.remainder(13);
main() {
print(foo(5));
print(foo(-100));
}""", r"""
-function(a) {
- return a % 13;
+function() {
+ P.print(5 % 13);
+ P.print(-100 % 13);
}"""),
const TestEntry.forMethod('function(foo)',
@@ -73,18 +74,19 @@ main() {
print(foo(-100));
}""", r"""
function(a) {
- return C.JSInt_methods.$tdiv(a, 13);
+ var v0;
+ return (a | 0) === a && (13 | 0) === 13 ? a / 13 | 0 : J.getInterceptor$n(v0 = a / 13).toInt$0(v0);
}"""),
- const TestEntry.forMethod('function(foo)',
- r"""
+ const TestEntry(r"""
foo(a) => a ~/ 13;
main() {
print(foo(5));
print(foo(100));
}""", r"""
-function(a) {
- return a / 13 | 0;
+function() {
+ P.print(5 / 13 | 0);
+ P.print(100 / 13 | 0);
}"""),
const TestEntry.forMethod('function(foo)',
@@ -95,7 +97,8 @@ main() {
print(foo(8000000000));
}""", r"""
function(a) {
- return C.JSInt_methods.$tdiv(a, 13);
+ var v0;
+ return (a | 0) === a && (13 | 0) === 13 ? a / 13 | 0 : J.getInterceptor$n(v0 = a / 13).toInt$0(v0);
}"""),
];

Powered by Google App Engine
This is Rietveld 408576698