assemblyscript/tests/compiler/gc/rc/global-init.ts

15 lines
378 B
TypeScript
Raw Normal View History

2019-04-06 20:17:48 +02:00
import "allocator/arena";
2019-03-27 14:43:35 +01:00
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);