Files
Nim/tests/arc/t18645.nim
ringabout 0f5ad49971 [ARC] fixes #18645; C Compiler error when initializing {.global.} with a block (#19953)
* fixes #18645; C Compiler error when initializing {.global.} with a block:

* arguably cleaner solution

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Araq <rumpf_a@web.de>
2022-10-03 16:12:23 +02:00

19 lines
212 B
Nim

discard """
matrix: "--gc:arc; --gc:refc"
output: '''
1
2
3
'''
"""
proc bitTypeIdUnion() =
var bitId {.global.} = block:
0
inc bitId
echo bitId
bitTypeIdUnion()
bitTypeIdUnion()
bitTypeIdUnion()