Title: [207433] trunk/JSTests
Revision
207433
Author
sbar...@apple.com
Date
2016-10-17 14:44:43 -0700 (Mon, 17 Oct 2016)

Log Message

Add more tests for the double->String conversion in ValueAdd constant folding
https://bugs.webkit.org/show_bug.cgi?id=163517

Reviewed by Yusuke Suzuki.

* microbenchmarks/string-add-constant-folding.js:
(test):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (207432 => 207433)


--- trunk/JSTests/ChangeLog	2016-10-17 21:36:05 UTC (rev 207432)
+++ trunk/JSTests/ChangeLog	2016-10-17 21:44:43 UTC (rev 207433)
@@ -1,3 +1,13 @@
+2016-10-17  Saam Barati  <sbar...@apple.com>
+
+        Add more tests for the double->String conversion in ValueAdd constant folding
+        https://bugs.webkit.org/show_bug.cgi?id=163517
+
+        Reviewed by Yusuke Suzuki.
+
+        * microbenchmarks/string-add-constant-folding.js:
+        (test):
+
 2016-10-17  JF Bastien  <jfbast...@apple.com>
 
         WebAssembly JS API: implement basic stub

Modified: trunk/JSTests/microbenchmarks/string-add-constant-folding.js (207432 => 207433)


--- trunk/JSTests/microbenchmarks/string-add-constant-folding.js	2016-10-17 21:36:05 UTC (rev 207432)
+++ trunk/JSTests/microbenchmarks/string-add-constant-folding.js	2016-10-17 21:44:43 UTC (rev 207433)
@@ -65,4 +65,81 @@
     assert(b + a === add(b, a));
 });
 
+test(function() {
+    let a = "foo";
+    let b = NaN;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = -0;
+    let b = "foo";
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = 0.0;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = Infinity;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = -Infinity;
+    let b = "foo";
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = 1e10;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = 1e-10;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = 1e5;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = 1e-5;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = 1e-40;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
+test(function() {
+    let a = "foo";
+    let b = 1e40;
+    assert(a + b === add(a, b));
+    assert(b + a === add(b, a));
+});
+
 runTests();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to