michael@0: // Test for one annoying case of the EliminateUnreachableCode michael@0: // optimization. Here the dominators change and also phis are michael@0: // eliminated. michael@0: michael@0: function test1(v) { michael@0: var i = 0; michael@0: if (v) { michael@0: if (v) { michael@0: i += 1; michael@0: } else { michael@0: i += 10; michael@0: } michael@0: i += 100; michael@0: } else { michael@0: if (v) { michael@0: i += 1000; michael@0: } else { michael@0: i += 10000; michael@0: } michael@0: i += 100000; michael@0: } michael@0: i += 1000000; michael@0: return i; michael@0: } michael@0: michael@0: function test() { michael@0: assertEq(test1(true), 1000101); michael@0: assertEq(test1(false), 1110000); michael@0: } michael@0: michael@0: for (var i = 0; i < 100; i++) michael@0: test();