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

Unified Diff: test/codegen/expect/language/deopt_smi_op_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 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
Index: test/codegen/expect/language/deopt_smi_op_test.js
diff --git a/test/codegen/expect/language/deopt_smi_op_test.js b/test/codegen/expect/language/deopt_smi_op_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..1da10eba3904f9c571cb27c77299e824d62bf45f
--- /dev/null
+++ b/test/codegen/expect/language/deopt_smi_op_test.js
@@ -0,0 +1,44 @@
+dart_library.library('language/deopt_smi_op_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__deopt_smi_op_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const deopt_smi_op_test = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ deopt_smi_op_test.test_mul = function(h) {
+ let x = null;
+ for (let i = 0; i < 3; i++) {
+ x = dart.dsend(h, '*', 100000);
+ }
+ return x;
+ };
+ dart.fn(deopt_smi_op_test.test_mul, dynamicTodynamic());
+ deopt_smi_op_test.test_neg = function(h) {
+ let x = null;
+ for (let i = 0; i < 3; i++) {
+ x = dart.dsend(h, 'unary-');
+ }
+ return x;
+ };
+ dart.fn(deopt_smi_op_test.test_neg, dynamicTodynamic());
+ deopt_smi_op_test.main = function() {
+ for (let i = 0; i < 20; i++)
+ deopt_smi_op_test.test_mul(10);
+ expect$.Expect.equals(1000000, deopt_smi_op_test.test_mul(10));
+ expect$.Expect.equals(100000000000, deopt_smi_op_test.test_mul(1000000));
+ expect$.Expect.equals(100000 * 4611686018427387903, deopt_smi_op_test.test_mul(4611686018427387903));
+ for (let i = 0; i < 20; i++)
+ deopt_smi_op_test.test_neg(10);
+ expect$.Expect.equals(-10, deopt_smi_op_test.test_neg(10));
+ expect$.Expect.equals(1073741824, deopt_smi_op_test.test_neg(-1073741824));
+ expect$.Expect.equals(4611686018427387904, deopt_smi_op_test.test_neg(-4611686018427387904));
+ };
+ dart.fn(deopt_smi_op_test.main, VoidTodynamic());
+ // Exports:
+ exports.deopt_smi_op_test = deopt_smi_op_test;
+});

Powered by Google App Engine
This is Rietveld 408576698