js/src/jit-test/tests/ion/eliminate-unreachable-2.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // Test for one annoying case of the EliminateUnreachableCode
     2 // optimization.  Here the dominator of print("Goodbye") changes to be
     3 // the print("Hello") after optimization.
     5 function test1(v) {
     6   if (v) {
     7     if (v) {
     8       assertEq(v, v);
     9     } else {
    10       assertEq(0, 1);
    11     }
    12   } else {
    13     if (v) {
    14       assertEq(0, 1);
    15     } else {
    16       assertEq(v, v);
    17     }
    18   }
    19   assertEq(v, v);
    20 }
    22 function test() {
    23   test1(true);
    24   test1(false);
    25 }
    27 for (var i = 0; i < 100; i++)
    28   test();

mercurial