diff options
author | cooldome <ariabushenko@gmail.com> | 2020-11-05 17:55:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 18:55:52 +0100 |
commit | 3af7818af4bb541e24146fa8f8334cf7c0b53128 (patch) | |
tree | ee4112cd9b48799906d2f669e57e0930ff76ab38 /tests | |
parent | 3aab6a409d0a02874717b1e10ca54a32da35cd1a (diff) | |
download | Nim-3af7818af4bb541e24146fa8f8334cf7c0b53128.tar.gz |
Fix #12636 (#15850)
* close #11142 * fix #12636 * undo unwanted changes * fix illegal recursion case
Diffstat (limited to 'tests')
-rw-r--r-- | tests/misc/tsizeof.nim | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/misc/tsizeof.nim b/tests/misc/tsizeof.nim index a09265667..0d96a5e04 100644 --- a/tests/misc/tsizeof.nim +++ b/tests/misc/tsizeof.nim @@ -361,6 +361,16 @@ testinstance: y: int32 z: AnotherEnum + Stack[N: static int, T: object] = object + pad: array[128 - sizeof(array[N, ptr T]) - sizeof(int) - sizeof(pointer), byte] + stack: array[N, ptr T] + len*: int + rawMem: ptr array[N, T] + + Stack2[T: object] = object + pad: array[128 - sizeof(array[sizeof(T), ptr T]), byte] + + const trivialSize = sizeof(TrivialType) # needs to be able to evaluate at compile time proc main(): void = @@ -377,6 +387,8 @@ testinstance: var po : PaddingOfSetEnum33 var capo: MyCustomAlignPackedObject var issue15516: MyObject + var issue12636_1: Stack[5, MyObject] + var issue12636_2: Stack2[MyObject] var e1: Enum1 @@ -395,7 +407,7 @@ testinstance: else: doAssert sizeof(SimpleAlignment) > 10 - testSizeAlignOf(t,a,b,c,d,e,f,g,ro,go,po, e1, e2, e4, e8, eoa, eob, capo, issue15516) + testSizeAlignOf(t,a,b,c,d,e,f,g,ro,go,po, e1, e2, e4, e8, eoa, eob, capo, issue15516, issue12636_1, issue12636_2) type WithBitsize {.objectconfig.} = object |