| return (a|0) + (b|0) + (c|0); |
| // Save a bunch of state in local variables. |
| // Make a call that will be subject to arity fixup and then use the saved state. We're |
| // counting on LLVM to put those variables in callee-saves, since that's pretty much the |
| return foo(42) + a + b + c + d + e + f + g; |
| for (var i = 0; i < 100000; ++i) { |
| // Call bar() in such a way that all of those callee-save variables have fairly unique |
| // looking values, to maximize the chances of foo() clobbering them in a recognizable |
| f:i * 3, g:i - 1, h:(i / 2)|0, i:-i, j:13 + ((i / 5)|0), k:14 - ((i / 6)|0), |
| var expected = 42 + i * 3 + i - 1 + ((i / 2)|0) - i + 13 + ((i / 5)|0) + 14 - |
| throw "Error: for iteration " + i + " expected " + expected + " but got " + result; |