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

Unified Diff: test/mjsunit/asm/do-while.js

Issue 681223002: [turbofan] Improve typed lowering for JSToBoolean. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/cctest/compiler/test-js-typed-lowering.cc ('k') | test/mjsunit/boolean.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/do-while.js
diff --git a/test/mjsunit/asm/do-while.js b/test/mjsunit/asm/do-while.js
new file mode 100644
index 0000000000000000000000000000000000000000..214be6458f00a19361c700aa5ea1328bffef0c81
--- /dev/null
+++ b/test/mjsunit/asm/do-while.js
@@ -0,0 +1,30 @@
+// 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(stdlib, foreign, buffer) {
+ "use asm";
+ function f(i) {
+ var j;
+ i = i|0;
+ do {
+ if (i > 0) {
+ j = i != 0;
+ i = (i - 1) | 0;
+ } else {
+ j = 0;
+ }
+ } while (j);
+ return i;
+ }
+ return {f:f};
+}
+
+var m = Module(this, {}, new ArrayBuffer(64*1024));
+
+assertEquals(-1, m.f("-1"));
+assertEquals(0, m.f(-Math.infinity));
+assertEquals(0, m.f(undefined));
+assertEquals(0, m.f(0));
+assertEquals(0, m.f(1));
+assertEquals(0, m.f(100));
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/mjsunit/boolean.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698