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

Function main

test/core/test_emscripten_scan_registers.cpp:52–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52int main() {
53 int x = EM_ASM_INT({ return 314159 });
54 int y = EM_ASM_INT({ return 21828 });
55 inner(x, y);
56 x = EM_ASM_INT({ return $0 + 1 }, x);
57 y = EM_ASM_INT({ return $0 - 1 }, y);
58 DO_SCAN
59 printf("c %d, %d\n", x, y);
60 assert(seenInts.count(314160));
61 assert(seenInts.count(21827));
62 assert(seenInts.size() < 1000);
63 assert(scans == 6);
64 puts("ok");
65
66 // Also test a very large amount of scans in a loop, to check that we avoid
67 // unbounded call stack growth.
68 for (int i = 0; i < 100; i++) {
69 DO_SCAN
70 }
71}

Callers

nothing calls this directly

Calls 5

putsFunction · 0.85
innerFunction · 0.70
countMethod · 0.65
sizeMethod · 0.65
assertFunction · 0.50

Tested by

no test coverage detected