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

Unified Diff: test/codegen/expect/language/rewrite_while_many_exits_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/rewrite_while_many_exits_test.js
diff --git a/test/codegen/expect/language/rewrite_while_many_exits_test.js b/test/codegen/expect/language/rewrite_while_many_exits_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..0c03b08d742d2860e6d600a31f96c0775ac17770
--- /dev/null
+++ b/test/codegen/expect/language/rewrite_while_many_exits_test.js
@@ -0,0 +1,55 @@
+dart_library.library('language/rewrite_while_many_exits_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__rewrite_while_many_exits_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 rewrite_while_many_exits_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))();
+ rewrite_while_many_exits_test.baz_clicks = 0;
+ rewrite_while_many_exits_test.baz = function() {
+ return rewrite_while_many_exits_test.baz_clicks = dart.notNull(rewrite_while_many_exits_test.baz_clicks) + 1;
+ };
+ dart.fn(rewrite_while_many_exits_test.baz, VoidTodynamic());
+ rewrite_while_many_exits_test.global = 0;
+ rewrite_while_many_exits_test.increment_global = function() {
+ rewrite_while_many_exits_test.global = dart.notNull(rewrite_while_many_exits_test.global) + 1;
+ return dart.notNull(rewrite_while_many_exits_test.global) <= 10;
+ };
+ dart.fn(rewrite_while_many_exits_test.increment_global, VoidTodynamic());
+ rewrite_while_many_exits_test.foo = function(x, y) {
+ let n = 0;
+ while (true) {
+ rewrite_while_many_exits_test.baz();
+ if (n >= dart.notNull(core.num._check(x))) {
+ return n;
+ }
+ rewrite_while_many_exits_test.baz();
+ if (n >= dart.notNull(core.num._check(y))) {
+ return n;
+ }
+ n = n + 1;
+ }
+ };
+ dart.fn(rewrite_while_many_exits_test.foo, dynamicAnddynamicTodynamic());
+ rewrite_while_many_exits_test.bar = function() {
+ while (dart.test(rewrite_while_many_exits_test.increment_global())) {
+ rewrite_while_many_exits_test.baz();
+ }
+ return rewrite_while_many_exits_test.baz();
+ };
+ dart.fn(rewrite_while_many_exits_test.bar, VoidTodynamic());
+ rewrite_while_many_exits_test.main = function() {
+ expect$.Expect.equals(10, rewrite_while_many_exits_test.foo(10, 20));
+ expect$.Expect.equals(10, rewrite_while_many_exits_test.foo(20, 10));
+ rewrite_while_many_exits_test.baz_clicks = 0;
+ expect$.Expect.equals(11, rewrite_while_many_exits_test.bar());
+ };
+ dart.fn(rewrite_while_many_exits_test.main, VoidTodynamic());
+ // Exports:
+ exports.rewrite_while_many_exits_test = rewrite_while_many_exits_test;
+});
« no previous file with comments | « test/codegen/expect/language/rewrite_variable_initializer_test.js ('k') | test/codegen/expect/language/rewrite_while_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698