]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/fold-to-double-constant-then-exit.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / fold-to-double-constant-then-exit.js
CommitLineData
81345200
A
1function foo(a, b) {
2 if (DFGTrue())
3 a = b = 5.4;
4 var c = a + b;
5 if (isFinalTier())
6 OSRExit();
7 return c + 0.5;
8}
9
10noInline(foo);
11
12for (var i = 0; i < 100000; ++i) {
13 var result = foo(1.4, 1.3);
14 if (result != 1.4 + 1.3 + 0.5 && result != 5.4 + 5.4 + 0.5)
15 throw "Error: bad result: " + result;
16}
17