mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-17 20:33:06 +00:00
adds a test case
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
discard """
|
||||
ccodeCheck: "\\i @'NIM_ALIGN(128) NI mylocal1' .*"
|
||||
matrix: "--mm:refc; --mm:orc"
|
||||
targets: "c cpp"
|
||||
output: "align ok"
|
||||
"""
|
||||
@@ -67,3 +68,22 @@ block: # bug #22419
|
||||
|
||||
f()()
|
||||
|
||||
|
||||
type Xxx = object
|
||||
v {.align: 128.}: byte
|
||||
|
||||
type Yyy = object
|
||||
v: byte
|
||||
v2: Xxx
|
||||
|
||||
for i in 0..<3:
|
||||
let x = new Yyy
|
||||
# echo "addr v2.v:", cast[uint](addr x.v2.v)
|
||||
doAssert cast[uint](addr x.v2.v) mod 128 == 0
|
||||
|
||||
let m = new Yyy
|
||||
m.v2.v = 42
|
||||
doAssert m.v2.v == 42
|
||||
m.v = 7
|
||||
doAssert m.v == 7
|
||||
|
||||
|
||||
Reference in New Issue
Block a user