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

Unified Diff: test/webkit/dfg-int-overflow-in-loop.js

Issue 18068003: Migrated several tests from blink to V8 repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/webkit/dfg-int-overflow-in-loop.js
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-int-overflow-in-loop.js
similarity index 73%
copy from test/webkit/concat-while-having-a-bad-time.js
copy to test/webkit/dfg-int-overflow-in-loop.js
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..8752a12cbd469ef2cf1c0e0efd96acfdf4e6e737 100644
--- a/test/webkit/concat-while-having-a-bad-time.js
+++ b/test/webkit/dfg-int-overflow-in-loop.js
@@ -22,10 +22,19 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
-"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating."
+"Tests that overflowing an integer in a loop and then only using it in an integer context produces a result that complies with double arithmetic."
);
-Object.defineProperty(Array.prototype, 0, { writable: false });
-shouldBe("[42].concat()", "[42]");
+function foo(a) {
+ var x = a;
+ // Make sure that this is the loop where we do OSR entry.
+ for (var i = 0; i < 100000; ++i)
+ x += 1;
+ // Now trigger overflow that is so severe that the floating point result would be different than the bigint result.
+ for (var i = 0; i < 160097152; ++i)
+ x += 2147483647;
+ return x | 0;
+}
+shouldBe("foo(0)", "-4094336");
« no previous file with comments | « test/webkit/dfg-inline-unused-this-method-check-expected.txt ('k') | test/webkit/dfg-int-overflow-in-loop-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698