5 use Exception::Guaranteed;
13 $SIG{__DIE__} = sub { $err = shift };
15 my $final_fn = __FILE__;
16 my $final_ln = __LINE__ + 1;
17 __SelfDestruct->spawn_n_kill( sub { guarantee_exception { die 'Final untrapped exception' } } );
19 while ($dummy < 2**31) {
22 fail ('Should never reach here :(');
25 diag( ($dummy||0) . " inc-ops executed before kill-signal delivery\n" );
29 "Final untrapped exception at $final_fn line $final_ln.\n",
30 'Untrapped DESTROY exception correctly propagated',
35 # on win32 the $? is *not* set to 255, not sure why :(
36 if ($^O eq 'MSWin32') {
37 cmp_ok ($?, '!=', 0, '$? correctly set to a non-0 value under windows' )
42 local $TODO = 'Win32 buggery - $? is unstable for some reason'
45 # check, and then change $? set by the last die
46 is ($?, 255, '$? correctly set by untrapped die()') # $? in END{} is *NOT* 16bit
50 $? = 0 if $ok; # adjust the exit to "passing" (0) IFF the test didn't fail