Skip to content

Commit

Permalink
close nim-lang#13062(add testcase for nim-lang#13062) (nim-lang#15956)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored and irdassis committed Feb 12, 2021
1 parent f6bad6f commit 7469ef6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/ccgbugs/t13062.nim
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7469ef6

Please sign in to comment.