testBug1057248.js (2817B)
1 // |jit-test| skip-if: !this.SharedArrayBuffer || !isAsmJSCompilationAvailable() 2 3 Random = { 4 weighted: function(wa) { 5 var a = []; 6 for (var i = 0; i < wa.length; ++i) { 7 for (var j = 0; j < wa[i]; ++j) {} 8 } 9 } 10 } 11 s = (function() { 12 Random.weighted([{ 13 n() {} 14 }, { 15 n() {} 16 }, { 17 n() {} 18 }, { 19 w: 5, 20 n() {} 21 } 22 ]) 23 })() 24 var builtinObjectNames = []; 25 (function() { 26 function exploreDeeper(a, a) { 27 var s = Object.getOwnPropertyNames(a) 28 for (var j = 0; j < s.length; ++j) { 29 if (typeof h == "" && n != "") {} 30 } 31 builtinObjectNames.push() 32 } 33 exploreDeeper(Math, "") 34 })(this, false) 35 r = autoExpr(Random.weighted([])); 36 r = autoExpr(Random.weighted([])); 37 (Random.weighted([])); 38 r = (Random.weighted([])) 39 v = autoExpr(Random.weighted([]), true); 40 r = autoExpr(Random.weighted([{ 41 n() {} 42 } 43 ]), true) 44 function autoExpr() {} 45 function makeStatement() {} 46 s = Random.weighted([{ 47 n() {} 48 } 49 ]) 50 a = Random.weighted([{}, {}, {}, {}, {}, { 51 n() {} 52 } 53 ]) 54 a = Random.weighted([{ 55 n() {} 56 }, {}, {} 57 ]) 58 var recursiveFunctions = [{ 59 text: "(function(){{}})" 60 }, { 61 text: "(function(){if(0){}(1)})", 62 n() {} 63 }, { 64 text: "(function(){t:[]()})", 65 n() {} 66 }, { 67 text: "(function(){g()})", 68 n() {} 69 } 70 ]; 71 (function s() { 72 for (var i = 0; i < recursiveFunctions.length; ++i) { 73 a = recursiveFunctions[i]; 74 var text = a.text 75 a = eval(text.replace(/@/, "")) 76 } 77 function g() {} 78 s = Random.weighted([{ 79 w: 1, 80 n() {} 81 }, { 82 n() {} 83 }, // 84 { 85 n() {} 86 }, // 87 { 88 n() {} 89 }, { 90 w: 0, 91 n() {} 92 }, { 93 n() {} 94 }, { 95 n() {} 96 }, { 97 w: 1, 98 n() {} 99 }, { 100 w: makeStatement 101 }, { 102 w: 5 103 } 104 ]) 105 t = function() {} 106 function c() {} 107 })() 108 function testMathyFunction(f, inputs) { 109 var r = []; 110 for (var j = 0; j < inputs.length; ++j) { 111 for (var k = 0; k < inputs.length; ++k) { 112 try { 113 f(inputs[j]) 114 } catch (e) {} 115 } 116 } 117 JSON.stringify([]) 118 } 119 mathy2 = (function(stdlib, foreign, heap) { 120 "use asm"; 121 var Float32ArrayView = new stdlib.Float32Array(heap) 122 function f(i0) { 123 i0 = i0 | 0; 124 (Float32ArrayView[-i0 >> 2]) = 1. 125 } 126 return f 127 })(this, { 128 }, new SharedArrayBuffer(4096)) 129 testMathyFunction(mathy2, [-0]) 130 mathy5 = (function(y) { 131 ((function() {})(mathy2(y)())) 132 }) 133 testMathyFunction(mathy5, [Math.PI])