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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:2ad1f1f1fbb7
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.
4
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 }
21
22 function test() {
23 test1(true);
24 test1(false);
25 }
26
27 for (var i = 0; i < 100; i++)
28 test();

mercurial