michael@0: function reallyDeepNestedExit(schedule) michael@0: { michael@0: var c = 0, j = 0; michael@0: for (var i = 0; i < 5; i++) { michael@0: for (j = 0; j < 4; j++) { michael@0: c += (schedule[i*4 + j] == 1) ? 1 : 2; michael@0: } michael@0: } michael@0: return c; michael@0: } michael@0: function testReallyDeepNestedExit() michael@0: { michael@0: var c = 0; michael@0: var schedule1 = new Array(5*4); michael@0: var schedule2 = new Array(5*4); michael@0: for (var i = 0; i < 5*4; i++) { michael@0: schedule1[i] = 0; michael@0: schedule2[i] = 0; michael@0: } michael@0: /** michael@0: * First innermost compile: true branch runs through. michael@0: * Second '': false branch compiles new loop edge. michael@0: * First outer compile: expect true branch. michael@0: * Second '': hit false branch. michael@0: */ michael@0: schedule1[0*4 + 3] = 1; michael@0: var schedules = [schedule1, michael@0: schedule2, michael@0: schedule1, michael@0: schedule2, michael@0: schedule2]; michael@0: michael@0: for (var i = 0; i < 5; i++) { michael@0: c += reallyDeepNestedExit(schedules[i]); michael@0: } michael@0: return c; michael@0: } michael@0: assertEq(testReallyDeepNestedExit(), 198);