close #13062(add testcase for #13062) (#15956)

This commit is contained in:
flywind
2020-11-13 19:49:30 +08:00
committed by GitHub
parent 7d51ad96e9
commit d802a4a669

27
tests/ccgbugs/t13062.nim Normal file
View File

@@ -0,0 +1,27 @@
discard """
output: "[p = nil]"
targets: "c cpp"
"""
import atomics
type
Pledge* {.exportc.} = object
p: PledgePtr
PledgeKind {.exportc.} = enum
Single
Iteration
PledgePtr {.exportc.} = ptr object
case kind: PledgeKind
of Single:
impl: PledgeImpl
of Iteration:
discard
PledgeImpl {.exportc.} = object
fulfilled: Atomic[bool]
var x: Pledge
echo x.repr