| 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);
|
| }"""),
|
|
|
| ];
|
|
|