- return $ret;
- }
- TESTCASE
- is $@, '', "$desc compiled fine";
-
- my $ret = $code->();
- is_deeply $x, undef, "$desc did not autovivify";
- is $ret, 1, "$desc returned 1";
+ exit $ret;
+ TESTCASE
+ "$base_desc while loops" => <<' TESTCASE',
+ no autovivification;
+ my $ret = 0;
+ while (1) {
+ ++$ret;
+ exit $ret;
+ }
+ exit $ret;
+ TESTCASE
+ "$base_desc postfix while (RT #99458)" => <<' TESTCASE',
+ no autovivification;
+ my $ret = 0;
+ ++$ret && exit $ret while 1;
+ exit $ret;
+ TESTCASE
+ "$base_desc until loops" => <<' TESTCASE',
+ no autovivification;
+ my $ret = 0;
+ until (0) {
+ ++$ret;
+ exit $ret;
+ }
+ exit $ret;
+ TESTCASE
+ "$base_desc postfix until" => <<' TESTCASE',
+ no autovivification;
+ my $ret = 0;
+ ++$ret && exit $ret until 0;
+ exit $ret;
+ TESTCASE
+ );
+
+ for my $desc (keys %infinite_tests) {
+ my $code = $infinite_tests{$desc};
+ my $ret = run_perl $code;
+ my $stat = $ret & 255;
+ $ret >>= 8;
+ is $stat, 0, "$desc testcase did not crash";
+ is $ret, 1, "$desc compiled fine";
+ }