xref: /openbsd-src/gnu/usr.bin/perl/t/bigmem/subst.t (revision b8851fcc53cbe24fd20b090f26dd149e353f6174)
1*b8851fccSafresh1#!perl
2*b8851fccSafresh1BEGIN {
3*b8851fccSafresh1    chdir 't' if -d 't';
4*b8851fccSafresh1    @INC = "../lib";
5*b8851fccSafresh1    require './test.pl';
6*b8851fccSafresh1}
7*b8851fccSafresh1
8*b8851fccSafresh1use Config qw(%Config);
9*b8851fccSafresh1
10*b8851fccSafresh1$ENV{PERL_TEST_MEMORY} >= 4
11*b8851fccSafresh1    or skip_all("Need ~4Gb for this test");
12*b8851fccSafresh1$Config{ptrsize} >= 8
13*b8851fccSafresh1    or skip_all("Need 64-bit pointers for this test");
14*b8851fccSafresh1
15*b8851fccSafresh1plan(2);
16*b8851fccSafresh1
17*b8851fccSafresh1# [perl #103260] [perl #123071]
18*b8851fccSafresh1my $x;
19*b8851fccSafresh1$x .=" "x4096 for 1..2**30/4096;
20*b8851fccSafresh1is eval { $x =~ s/ /_/g }, 2**30, "subst on long strings" ;
21*b8851fccSafresh1is eval { $x =~ s/_/${\" "}/g },2**30,"subst on long strings (substcont)" ;
22