Changeset 207433 in webkit


Ignore:
Timestamp:
Oct 17, 2016 2:44:43 PM (8 years ago)
Author:
sbarati@apple.com
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):

Location:
trunk/JSTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r207432 r207433  
     12016-10-17  Saam Barati  <sbarati@apple.com>
     2
     3        Add more tests for the double->String conversion in ValueAdd constant folding
     4        https://bugs.webkit.org/show_bug.cgi?id=163517
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * microbenchmarks/string-add-constant-folding.js:
     9        (test):
     10
    1112016-10-17  JF Bastien  <jfbastien@apple.com>
    212
  • trunk/JSTests/microbenchmarks/string-add-constant-folding.js

    r207060 r207433  
    6666});
    6767
     68test(function() {
     69    let a = "foo";
     70    let b = NaN;
     71    assert(a + b === add(a, b));
     72    assert(b + a === add(b, a));
     73});
     74
     75test(function() {
     76    let a = -0;
     77    let b = "foo";
     78    assert(a + b === add(a, b));
     79    assert(b + a === add(b, a));
     80});
     81
     82test(function() {
     83    let a = "foo";
     84    let b = 0.0;
     85    assert(a + b === add(a, b));
     86    assert(b + a === add(b, a));
     87});
     88
     89test(function() {
     90    let a = "foo";
     91    let b = Infinity;
     92    assert(a + b === add(a, b));
     93    assert(b + a === add(b, a));
     94});
     95
     96test(function() {
     97    let a = -Infinity;
     98    let b = "foo";
     99    assert(a + b === add(a, b));
     100    assert(b + a === add(b, a));
     101});
     102
     103test(function() {
     104    let a = "foo";
     105    let b = 1e10;
     106    assert(a + b === add(a, b));
     107    assert(b + a === add(b, a));
     108});
     109
     110test(function() {
     111    let a = "foo";
     112    let b = 1e-10;
     113    assert(a + b === add(a, b));
     114    assert(b + a === add(b, a));
     115});
     116
     117test(function() {
     118    let a = "foo";
     119    let b = 1e5;
     120    assert(a + b === add(a, b));
     121    assert(b + a === add(b, a));
     122});
     123
     124test(function() {
     125    let a = "foo";
     126    let b = 1e-5;
     127    assert(a + b === add(a, b));
     128    assert(b + a === add(b, a));
     129});
     130
     131test(function() {
     132    let a = "foo";
     133    let b = 1e-40;
     134    assert(a + b === add(a, b));
     135    assert(b + a === add(b, a));
     136});
     137
     138test(function() {
     139    let a = "foo";
     140    let b = 1e40;
     141    assert(a + b === add(a, b));
     142    assert(b + a === add(b, a));
     143});
     144
    68145runTests();
Note: See TracChangeset for help on using the changeset viewer.