MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / test

Function test

test/core/test_convertI32PairToI53Checked.cpp:15–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13EM_JS_DEPS(test, "$convertI32PairToI53Checked");
14
15double test(int64_t val) {
16 int32_t lo = (uint32_t)val;
17 int32_t hi = (uint64_t)val >> 32;
18 printf("input=%lld / 0x%llx: convertI32PairToI53Checked(lo=%d hi=%d)=", val, val, lo, hi);
19#ifdef GENERATE_ANSWERS
20 int64_t v = (uint64_t)(uint32_t)lo;
21 v |= ((uint64_t)(uint32_t)hi) << 32;
22 double out = v > 9007199254740992ll || v < -9007199254740992ll ? (double)NAN : v;
23#else
24 double out = EM_ASM_DOUBLE(return convertI32PairToI53Checked($0, $1), lo, hi);
25#endif
26 printf("%f\n", out);
27 return out;
28}
29
30int main() {
31 printf("Testing library_int53.js function $convertI32PairToI53Checked():\n\n");

Callers 1

mainFunction · 0.70

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected