]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/double-as-int32.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / double-as-int32.js
CommitLineData
81345200
A
1//@ defaultRun; runNoCJITNoASO
2
3function foo(a, b) {
4 return a.f / b.f;
5}
6
7noInline(foo);
8
9function test(a, b, e) {
10 var result = foo({f:a}, {f:b});
11 if (result != e)
12 throw "Error: " + a + " / " + b + " should be " + e + " but was " + result;
13}
14
15for (var i = 1; i < 101; ++i)
16 test(i * 2, i, 2);
17
18test(9, 3, 3);
19test(12, 4, 3);
20test(-32, 8, -4);
21test(-21, 7, -3);
22test(7, 2, 3.5);