add more test for #20836 (#20842)

This commit is contained in:
Derek 呆 2022-11-15 02:49:11 +08:00 • committed by GitHub
commit de89f6ce32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,15 @@
discard """
valgrind: "leaks"
matrix: "-d:useMalloc"
targets: "c cpp"
"""
type
Obj = object
case b: bool
else: discard
a: UncheckedArray[byte]
var o: ref Obj
unsafeNew(o, sizeof(Obj) + 512)
zeroMem(addr o.a, 512)