diff options
author | Bung <crc32@qq.com> | 2020-11-12 16:16:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 09:16:40 +0100 |
commit | 826e62953faa1f6cd9bac582246186935af4b8e6 (patch) | |
tree | 09dc416bf08bb46057c091aa3db5f396de354f16 /tests | |
parent | a81434a890d70e7146c440c59caadc701c6099b3 (diff) | |
download | Nim-826e62953faa1f6cd9bac582246186935af4b8e6.tar.gz |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/concurrency/tatomics_size.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/stdlib/concurrency/tatomics_size.nim b/tests/stdlib/concurrency/tatomics_size.nim new file mode 100644 index 000000000..49387c0c1 --- /dev/null +++ b/tests/stdlib/concurrency/tatomics_size.nim @@ -0,0 +1,18 @@ +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 \ No newline at end of file |