GCCJIT
view release on metacpan or search on metacpan
t/04-wrapper.t view on Meta::CPAN
is $const->as_object->get_debug_string(), "const int", "const ok";
my $volatile = $const->get_volatile;
is $volatile->as_object->get_debug_string(), "volatile const int", "volatile ok";
my $sub = $ctx->new_child_context();
can_ok($sub, qw/get_type new_child_context/);
$ctx = undef;
is exception { $sub->get_type(GCC_JIT_TYPE_INT) }, undef, "subcontext is alive when parent is out of scope";
is exception { $volatile->as_object }, undef, "subcontext keeps parent's objects alive";
$sub = undef;
like exception { $volatile->as_object }, qr/this type is no longer usable/, "when all contexts are destroyed, objects become invalid";
done_testing;
( run in 2.877 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )