diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-01-07 18:09:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-07 18:09:57 +0100 |
commit | abad758a7eff72e9f97224c400e1b48d09ecd97a (patch) | |
tree | 03707e3429fc9e21c656a37b0e95138770a04607 /tests/misc | |
parent | 387831d657bcbd130b7e739e4d58f7ccc29adae9 (diff) | |
download | Nim-abad758a7eff72e9f97224c400e1b48d09ecd97a.tar.gz |
Fix for sizeof bitsize combination (#10227)
* fix #10082 * added test
Diffstat (limited to 'tests/misc')
-rw-r--r-- | tests/misc/tsizeof.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/misc/tsizeof.nim b/tests/misc/tsizeof.nim index 4422e900e..25c566171 100644 --- a/tests/misc/tsizeof.nim +++ b/tests/misc/tsizeof.nim @@ -402,6 +402,18 @@ type assert sizeof(C) == 3 + +type + MixedBitsize = object {.packed.} + a: uint32 + b {.bitsize: 8.}: uint8 + c {.bitsize: 1.}: uint8 + d {.bitsize: 7.}: uint8 + e {.bitsize: 16.}: uint16 + f: uint32 + +doAssert sizeof(MixedBitsize) == 12 + if failed: quit("FAIL") else: |