Nim/tests/stdlib/concurrency/tatomics_size.nim
Bung 826e62953f
fix #12726 Cannot take the compile-time sizeof Atomic types (#15928)
* fix #12726 Cannot take the compile-time sizeof Atomic types

* fix for arch 32
2020-11-12 09:16:40 +01:00

18 lines
No EOL
390 B
Nim

discard """
targets: "c cpp"
"""
import std/atomics
block testSize: # issue 12726
type
Node = ptr object
# works
next: Atomic[pointer]
f:AtomicFlag
MyChannel = object
# type not defined completely
back: Atomic[ptr int]
f: AtomicFlag
static:
doAssert sizeof(Node) == sizeof(pointer)
doAssert sizeof(MyChannel) == sizeof(pointer) * 2