Skip to content
Snippets Groups Projects
Commit 7e43d647 authored by test262-automation's avatar test262-automation Committed by Rick Waldron
Browse files

[javascriptcore-test262-automation] Changes from...

[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 5bbf629de8 on Fri Oct 19 2018 18:41:28 GMT+0000 (Coordinated Universal Time)
parent 39369501
No related branches found
No related tags found
No related merge requests found
//@ runBigIntEnabled
let assert = {
sameValue: function(i, e, m) {
if (i !== e)
throw new Error(m);
}
}
function bigIntAddition(x, y) {
return x - y - 1n;
}
noInline(bigIntAddition);
for (let i = 0; i < 10000; i++) {
let r = bigIntAddition(3n, 10n);
assert.sameValue(r, -8n, 3n + " - " + 10n + " - 1 = " + r);
}
//@ runBigIntEnabled
function assert(v, e) {
if (v !== e)
throw new Error("Expected value: " + e + " but got: " + v)
}
function bigIntPropagation(a, b) {
let c = a - b;
return c - 0n;
}
noInline(bigIntPropagation);
for (let i = 0; i < 100000; i++) {
let out = bigIntPropagation(0xffffffffffffffffffffffffffffffn, 0x1n);
assert(out, 0xfffffffffffffffffffffffffffffen)
}
//@ runBigIntEnabled
function assert(v, e) {
if (v !== e)
throw new Error("Expected value: " + e + " but got: " + v)
}
function bigIntOperations(a, b) {
let c = a - b;
return a - c;
}
noInline(bigIntOperations);
c = 0;
let o = { valueOf: function () {
c++;
return 0b1111n;
}};
for (let i = 0; i < 100000; i++) {
let out = bigIntOperations(o, 0b1010n);
assert(out, 10n);
}
assert(c, 200000);
function assert(a, e) {
if (a !== e)
throw new Error("Bad");
}
function valueSub() {
let sum = 0;
do {
// We trigger the JIT compilation of valueSub
// so Date.now() will have SpecNone as result
for (let i = 0; i < 10000; i++)
sum++;
sum += 0.5;
} while (Date.now() - sum < 0);
assert(sum, 10000.5);
}
noInline(valueSub);
valueSub();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment