MCPcopy Create free account
hub / github.com/nodejs/node / TestAtomicI64Wait

Function TestAtomicI64Wait

deps/v8/test/mjsunit/wasm/atomics-memory64.js:118–136  ·  view source on GitHub ↗
(pages, offset)

Source from the content-addressed store, hash-verified

116}
117
118function TestAtomicI64Wait(pages, offset) {
119 if (!%IsAtomicsWaitAllowed()) return;
120 print(arguments.callee.name);
121
122 let memory = CreateBigSharedWasmMemory64(pages);
123 assertEquals(kAtomicWaitNotEqual, WasmI64AtomicWait(memory, offset, 0, 42, 0, -1));
124 assertEquals(kAtomicWaitTimedOut, WasmI64AtomicWait(memory, offset, 0, 0, 0, 0));
125 assertEquals(kAtomicWaitNotEqual, WasmI64AtomicWait(memory, 0, offset, 42, 0, -1));
126 assertEquals(kAtomicWaitTimedOut, WasmI64AtomicWait(memory, 0, offset, 0, 0, 0));
127
128 let i32a = new Int32Array(memory.buffer);
129 i32a[offset / 4] = 1;
130 i32a[(offset / 4) + 1] = 2;
131
132 assertEquals(kAtomicWaitNotEqual, WasmI64AtomicWait(memory, offset, 0, 2, 1, -1));
133 assertEquals(kAtomicWaitTimedOut, WasmI64AtomicWait(memory, offset, 0, 1, 2, 0));
134 assertEquals(kAtomicWaitNotEqual, WasmI64AtomicWait(memory, 0, offset, 2, 1, -1));
135 assertEquals(kAtomicWaitTimedOut, WasmI64AtomicWait(memory, 0, offset, 1, 2, 0));
136}
137
138//// WORKER ONLY TESTS
139

Callers 1

Calls 4

WasmI64AtomicWaitFunction · 0.70
printFunction · 0.50
assertEqualsFunction · 0.50

Tested by

no test coverage detected