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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/ion/eliminate-unreachable-2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +// Test for one annoying case of the EliminateUnreachableCode
     1.5 +// optimization.  Here the dominator of print("Goodbye") changes to be
     1.6 +// the print("Hello") after optimization.
     1.7 +
     1.8 +function test1(v) {
     1.9 +  if (v) {
    1.10 +    if (v) {
    1.11 +      assertEq(v, v);
    1.12 +    } else {
    1.13 +      assertEq(0, 1);
    1.14 +    }
    1.15 +  } else {
    1.16 +    if (v) {
    1.17 +      assertEq(0, 1);
    1.18 +    } else {
    1.19 +      assertEq(v, v);
    1.20 +    }
    1.21 +  }
    1.22 +  assertEq(v, v);
    1.23 +}
    1.24 +
    1.25 +function test() {
    1.26 +  test1(true);
    1.27 +  test1(false);
    1.28 +}
    1.29 +
    1.30 +for (var i = 0; i < 100; i++)
    1.31 +  test();

mercurial