bigint-div-bailout-not-bigintptr.js (600B)
1 // |jit-test| --ion-warmup-threshold=20 2 3 function testBailout() { 4 function f(v, r) { 5 for (var i = 0; i < 50; ++i) { 6 // Ensure DCE and LICM don't eliminate divisions when the divisor is zero. 7 if (i === 0) { 8 r(); 9 } 10 1_0000_0000_0000_0000n / v; 11 1_0000_0000_0000_0000n / v; 12 1_0000_0000_0000_0000n / v; 13 } 14 } 15 16 var result = []; 17 function r() { 18 result.push("ok"); 19 } 20 21 do { 22 result.length = 0; 23 try { 24 f(1n, r); 25 f(1n, r); 26 f(0n, r); 27 } catch (e) {} 28 assertEq(result.length, 3); 29 } while (!inIon()); 30 } 31 testBailout();