mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 04:50:51 +01:00
+ Add enormous arrays test.
git-svn-id: trunk@6359 -
This commit is contained in:
parent
8ed35dd5fb
commit
04819280cc
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6213,6 +6213,7 @@ tests/tbs/tb0524.pp svneol=native#text/x-pascal
|
||||
tests/tbs/tb0525.pp svneol=native#text/plain
|
||||
tests/tbs/tb0526.pp -text
|
||||
tests/tbs/tb0527.pp svneol=native#text/plain
|
||||
tests/tbs/tb0528.pp svneol=native#text/x-pascal
|
||||
tests/tbs/ub0060.pp svneol=native#text/plain
|
||||
tests/tbs/ub0069.pp svneol=native#text/plain
|
||||
tests/tbs/ub0119.pp svneol=native#text/plain
|
||||
|
||||
26
tests/tbs/tb0528.pp
Normal file
26
tests/tbs/tb0528.pp
Normal file
@ -0,0 +1,26 @@
|
||||
{%CPU=x86_64,ppc64}
|
||||
program tb0528;
|
||||
|
||||
{This program tests if huge arrays work on 64-bit systems. I got the idea
|
||||
testing this because today I had a Fortran program that didn't work. After
|
||||
inspection it appeared the mad scientist was using arrays > 2GB.
|
||||
|
||||
So, I did a test how well FPC handled such code. Disappointment, FPC
|
||||
did generate wrong code.
|
||||
|
||||
Note that this test does not use huge amounts of memory, as the operating
|
||||
system should allocate a page on write.
|
||||
does not get allocated.}
|
||||
|
||||
type huge_array=array[0..$ffffffff] of word;
|
||||
|
||||
var a,b,c:huge_array;
|
||||
|
||||
begin
|
||||
a[$ffffffff]:=1;
|
||||
b[$ffffffff]:=2;
|
||||
c[$ffffffff]:=3;
|
||||
writeln(a[$ffffffff]);
|
||||
writeln(b[$ffffffff]);
|
||||
writeln(c[$ffffffff]);
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user