8 use Config qw(%Config);
10 $ENV{PERL_TEST_MEMORY} >= 2
11 or skip_all("Need ~2Gb for this test");
13 or skip_all("Need 64-bit pointers for this test");
18 # ${\2} to defeat constant folding, which in this case actually slows
20 my $x=" "x(${\2}**31) . "abcdefg";
21 ok $x =~ /./, 'match against long string succeeded';
22 is "$-[0]-$+[0]", '0-1', '@-/@+ after match against long string';
30 is $result," -a-b-c-d-", 'scalar //g hopping past the 2**31 threshold';
33 is "$'", 'efg', q "$' after match against long string";
34 is "$-[0],$+[0]", '2147483651,2147483652',
35 '@- and @+ after matches past 2**31';
37 # Substring optimisations
38 is $x =~ /(?:(?:.{32766}){32766}){2}(?:.{32766}){8}.{8}ef/, 1,
39 'anchored substr past 2**31';