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

Unified Diff: test/mjsunit/asm/infinite-loops.js

Issue 661923002: Implement graph trimming in ControlReducer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use Deque. Created 6 years, 2 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
« no previous file with comments | « test/mjsunit/asm/if-reduction.js ('k') | test/mjsunit/asm/infinite-loops-taken.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/infinite-loops.js
diff --git a/test/mjsunit/asm/infinite-loops.js b/test/mjsunit/asm/infinite-loops.js
new file mode 100644
index 0000000000000000000000000000000000000000..03f4f6b8b236061de16b3d1d170ac6b82e7fd7ff
--- /dev/null
+++ b/test/mjsunit/asm/infinite-loops.js
@@ -0,0 +1,53 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function Module() {
+ "use asm";
+
+ function w0(a) {
+ a = a | 0;
+ if (a) while (1);
+ return 42;
+ }
+
+ function w1(a) {
+ a = a | 0;
+ while (1) return 42;
+ return 106;
+ }
+
+ function d0(a) {
+ a = a | 0;
+ if (a) do ; while(1);
+ return 42;
+ }
+
+ function d1(a) {
+ a = a | 0;
+ do return 42; while(1);
+ return 107;
+ }
+
+ function f0(a) {
+ a = a | 0;
+ if (a) for (;;) ;
+ return 42;
+ }
+
+ function f1(a) {
+ a = a | 0;
+ for(;;) return 42;
+ return 108;
+ }
+
+ return { w0: w0, w1: w1, d0: d0, d1: d1, f0: f0, f1: f1 };
+}
+
+var m = Module();
+assertEquals(42, m.w0(0));
+assertEquals(42, m.w1(0));
+assertEquals(42, m.d0(0));
+assertEquals(42, m.d1(0));
+assertEquals(42, m.f0(0));
+assertEquals(42, m.f1(0));
« no previous file with comments | « test/mjsunit/asm/if-reduction.js ('k') | test/mjsunit/asm/infinite-loops-taken.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698