9 use Config qw(%Config);
11 # memory usage checked with top
12 $ENV{PERL_TEST_MEMORY} >= 2
13 or skip_all("Need ~2GB for this test");
15 or skip_all("Need 64-bit pointers for this test");
19 my $space = " "; # avoid constant folding from doubling memory usage
20 # concatenation here increases memory usage significantly
21 my $work = $space x 0x80000002;
22 substr($work, 0x80000000) = "\n\n";
25 is(index($work, "\n"), 0x80000000, "test index() over 2G mark");
27 # this would simply fail
28 is(rindex($work, "\n"), 0x80000001, "test rindex() over 2G mark");
33 is(index($work, "\n"), 0x80000000, "test index() over 2G mark (utf8-ish)");
35 # this would simply fail
36 is(rindex($work, "\n"), 0x80000001, "test rindex() over 2G mark (utf8-ish)");