summary refs log tree commit diff stats
path: root/tests/align/talign.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/align/talign.nim')
-rw-r--r--tests/align/talign.nim18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/align/talign.nim b/tests/align/talign.nim
index e0503cc70..08373ee49 100644
--- a/tests/align/talign.nim
+++ b/tests/align/talign.nim
@@ -1,6 +1,6 @@
 discard """
 ccodeCheck: "\\i @'NIM_ALIGN(128) NI mylocal1' .*"
-target: "c cpp"
+targets: "c cpp"
 output: "align ok"
 """
 
@@ -51,3 +51,19 @@ type Bug[T] = object
 
 var bug: Bug[int]
 doAssert sizeof(bug) == 128, "Oops my size is " & $sizeof(bug) # 16
+
+
+block: # bug #22419
+  type
+    ValidatorPubKey = object
+      blob: array[96, byte]
+
+  proc f(): auto =
+    return iterator() =
+      var pad: int8 = 0
+      var y {.align: 16.}: ValidatorPubKey
+      let value = cast[uint64](addr y)
+      doAssert value mod 16 == 0
+
+  f()()
+