mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 04:02:41 +00:00
27
tests/ccgbugs/t13062.nim
Normal file
27
tests/ccgbugs/t13062.nim
Normal 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
|
||||
Reference in New Issue
Block a user