The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;
use Test::More;

use B::Hooks::EndOfScope;

plan skip_all => 'Skiping XS test in PP mode'
  unless $INC{'B/Hooks/EndOfScope/XS.pm'};

eval q[
    sub foo {
        BEGIN {
            on_scope_end { die 'bar' };
        }
    }
];

like($@, qr/^bar/);

pass('no segfault');

done_testing;