| 50 | } |
| 51 | |
| 52 | int 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 | } |