From fe1cefd621e0c0e06cb0c9a48d0f51b5f126b68f Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 11 Feb 2006 15:46:49 +0000 Subject: [PATCH] * crash test for automatic prefetching git-svn-id: trunk@2515 - --- .gitattributes | 1 + tests/test/tpftch1.pp | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/test/tpftch1.pp diff --git a/.gitattributes b/.gitattributes index 11112904d4..5d8c27104a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5684,6 +5684,7 @@ tests/test/tover2.pp svneol=native#text/plain tests/test/tpackrec.pp svneol=native#text/plain tests/test/tpara1.pp svneol=native#text/plain tests/test/tpara2.pp svneol=native#text/plain +tests/test/tpftch1.pp svneol=native#text/plain tests/test/tprocext.pp svneol=native#text/plain tests/test/tprocvar1.pp svneol=native#text/plain tests/test/tprocvar2.pp svneol=native#text/plain diff --git a/tests/test/tpftch1.pp b/tests/test/tpftch1.pp new file mode 100644 index 0000000000..1444c83361 --- /dev/null +++ b/tests/test/tpftch1.pp @@ -0,0 +1,28 @@ +{ %OPT=-S2 -O1 } + + +{ check if we don't cause sigsegvs when attempting to prefetch if } +{ typecasts are involved } + +type + tc1 = class + a: tc1; + x: boolean; + end; + + tc2 = class(tc1) + b: array[1..1000000000] of byte; + c: tc1; + end; + +var + a: tc1; + +begin + a := tc1.create; + while assigned(a) do + if a.x then + a := tc2(a).c + else + a := a.a; +end.