diff --git a/src/test/01-Basic/229-dangle-ref-spork.ck b/src/test/01-Basic/229-dangle-ref-spork.ck new file mode 100644 index 000000000..1b9946035 --- /dev/null +++ b/src/test/01-Basic/229-dangle-ref-spork.ck @@ -0,0 +1,19 @@ +// verify no dangling reference with sporked +// functions that return Objects + +Object foo; + +// function that returns an Object +fun Object get() +{ + return foo; +} + +// spork +spork ~ get(); + +// give sporked function a chance to run +10::ms => now; + +// check reference count +if( Machine.refcount(foo) == 1 ) <<< "success" >>>; \ No newline at end of file