xref: /openbsd-src/gnu/usr.bin/perl/t/bigmem/stack_over.t (revision 5486feefcc8cb79b19e014ab332cc5dfd05b3b33)
1#!perl
2BEGIN {
3    chdir 't' if -d 't';
4    @INC = "../lib";
5    require './test.pl';
6}
7
8use strict;
9use Config qw(%Config);
10use XS::APItest;
11
12# memory usage checked with top
13$ENV{PERL_TEST_MEMORY} >= 17
14    or skip_all("Need ~17GB for this test");
15$Config{ptrsize} >= 8
16    or skip_all("Need 64-bit pointers for this test");
17# this tests what happens when we don't have wide marks
18XS::APItest::wide_marks()
19    and skip_all("Configured for SSize_t marks");
20
21my @x;
22$x[0x8000_0000] = "Hello";
23
24sub x { @x }
25
26ok(!eval { () = x(); 1 }, "stack overflow");
27done_testing();
28