test262-automation e9a5a7f918 [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time) (#1620)
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
2018-07-03 15:59:58 -04:00

76 lines
1.7 KiB
JavaScript

//@ skip
function foo(bytes) {
return Atomics.isLockFree(bytes);
}
noInline(foo);
function foo0(bytes) {
return Atomics.isLockFree(0);
}
noInline(foo0);
function foo1(bytes) {
return Atomics.isLockFree(1);
}
noInline(foo1);
function foo2(bytes) {
return Atomics.isLockFree(2);
}
noInline(foo2);
function foo3(bytes) {
return Atomics.isLockFree(3);
}
noInline(foo3);
function foo4(bytes) {
return Atomics.isLockFree(4);
}
noInline(foo4);
function foo5(bytes) {
return Atomics.isLockFree(5);
}
noInline(foo5);
for (var i = 0; i < 10000; ++i) {
var result = foo(0);
if (result !== false)
throw new Error("Bad result: " + result);
var result = foo(1);
if (result !== true)
throw new Error("Bad result: " + result);
var result = foo(2);
if (result !== true)
throw new Error("Bad result: " + result);
var result = foo(3);
if (result !== false)
throw new Error("Bad result: " + result);
var result = foo(4);
if (result !== true)
throw new Error("Bad result: " + result);
var result = foo(5);
if (result !== false)
throw new Error("Bad result: " + result);
var result = foo0();
if (result !== false)
throw new Error("Bad result: " + result);
var result = foo1();
if (result !== true)
throw new Error("Bad result: " + result);
var result = foo2();
if (result !== true)
throw new Error("Bad result: " + result);
var result = foo3();
if (result !== false)
throw new Error("Bad result: " + result);
var result = foo4();
if (result !== true)
throw new Error("Bad result: " + result);
var result = foo5();
if (result !== false)
throw new Error("Bad result: " + result);
}