assemblyscript/tests/compiler/gc/rc/global-init.ts
2019-04-06 20:17:48 +02:00

15 lines
378 B
TypeScript

import "allocator/arena";
import { register_count, retain_count, retain_ref, release_count } from "./_dummy";
@start export function main(): void {}
class Ref {}
// should register and retain, with nothing to release
var global = new Ref();
assert(register_count == 1);
assert(retain_count == 1);
assert(retain_ref == changetype<usize>(global));
assert(release_count == 0);