diff --git a/tests/objects/tunsafenew2.nim b/tests/objects/tunsafenew2.nim new file mode 100644 index 0000000000..83112bcfca --- /dev/null +++ b/tests/objects/tunsafenew2.nim @@ -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)