mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 02:31:41 +00:00
baseline
This commit is contained in:
14
tests/compiler/gc/rc/global-init.ts
Normal file
14
tests/compiler/gc/rc/global-init.ts
Normal file
@ -0,0 +1,14 @@
|
||||
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);
|
Reference in New Issue
Block a user