diff options
Diffstat (limited to 'tests/coroutines/tgc.nim')
-rw-r--r-- | tests/coroutines/tgc.nim | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/coroutines/tgc.nim b/tests/coroutines/tgc.nim index 46f4f8e83..770d413f5 100644 --- a/tests/coroutines/tgc.nim +++ b/tests/coroutines/tgc.nim @@ -1,19 +1,22 @@ discard """ - target: "c" + matrix: "--gc:refc; --gc:arc; --gc:orc" + targets: "c" """ -import coro +when compileOption("gc", "refc") or not defined(openbsd): + # xxx openbsd gave: stdlib_coro.nim.c:406:22: error: array type 'jmp_buf' (aka 'long [11]') is not assignable (*dest).execContext = src.execContext; + import coro -var maxOccupiedMemory = 0 + var maxOccupiedMemory = 0 -proc testGC() = - var numbers = newSeq[int](100) - maxOccupiedMemory = max(maxOccupiedMemory, getOccupiedMem()) - suspend(0) + proc testGC() = + var numbers = newSeq[int](100) + maxOccupiedMemory = max(maxOccupiedMemory, getOccupiedMem()) + suspend(0) -start(testGC) -start(testGC) -run() + start(testGC) + start(testGC) + run() -GC_fullCollect() -doAssert(getOccupiedMem() < maxOccupiedMemory, "GC did not free any memory allocated in coroutines") + GC_fullCollect() + doAssert(getOccupiedMem() < maxOccupiedMemory, "GC did not free any memory allocated in coroutines") |