eliminate-unreachable-2.js (487B)
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();