From 5132685b05e60ffbacd94fed3229ac45503c97c3 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 25 Mar 1998 13:43:38 +0000 Subject: [PATCH] * restored version --- tests/TS010009.PP | 13 +++++++++++++ tests/ts010010.pp | 15 +++++++++++++++ tests/ts010014.bat | 18 ++++++++++++++++++ tests/ts010014.pp | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/ts010100.bat | 18 ++++++++++++++++++ tests/ts010100.pp | 6 ++++++ tests/ts010101.pp | 11 +++++++++++ 7 files changed, 123 insertions(+) create mode 100644 tests/TS010009.PP create mode 100644 tests/ts010010.pp create mode 100644 tests/ts010014.bat create mode 100644 tests/ts010014.pp create mode 100644 tests/ts010100.bat create mode 100644 tests/ts010100.pp create mode 100644 tests/ts010101.pp diff --git a/tests/TS010009.PP b/tests/TS010009.PP new file mode 100644 index 0000000000..fc12dc1b75 --- /dev/null +++ b/tests/TS010009.PP @@ -0,0 +1,13 @@ +unit ts010009; + + interface + + type + tr = record + case a : (x,y,z) of + x : (l : longint); + end; + + implementation + +end. diff --git a/tests/ts010010.pp b/tests/ts010010.pp new file mode 100644 index 0000000000..ec5f3da522 --- /dev/null +++ b/tests/ts010010.pp @@ -0,0 +1,15 @@ +uses + ts010009; + + var + r : tr; + + begin + r.a:=x; + if r.a=x then + begin + with r do + if a=y then + ; + end; + end. diff --git a/tests/ts010014.bat b/tests/ts010014.bat new file mode 100644 index 0000000000..ae34678a12 --- /dev/null +++ b/tests/ts010014.bat @@ -0,0 +1,18 @@ +@echo off +rem +rem Batch file to compile and run ts010014 +rem +echo Compiling ts010014... +ppc386 ts010014 >nul +if errorlevel 1 goto comfailed +echo compilation of ts010014 : PASSED +ts010014 >nul +if errorlevel 0 goto runpassed +echo execution of ts010014 : FAILED +goto end +:runpassed +echo execution of ts010014 : PASSED +goto end +:comfailed +echo Compilation of ts010014 : FAILED +:end diff --git a/tests/ts010014.pp b/tests/ts010014.pp new file mode 100644 index 0000000000..df36464e35 --- /dev/null +++ b/tests/ts010014.pp @@ -0,0 +1,42 @@ +{$R+} +type + ta = object + constructor init; + destructor done; + procedure p;virtual; + end; + + pa = ^ta; + +constructor ta.init; + + begin + end; + +destructor ta.done; + + begin + end; + +procedure ta.p; + + begin + end; + +type + plongint = ^longint; + +var + p : pa; + data : array[0..4] of longint; + +begin + fillchar(data,sizeof(data),12); + p:=new(pa,init); + p^.p; + { the vmt pointer gets an invalid value: } + plongint(p)^:=longint(@data); + { causes runerror } + p^.p; + halt(1); +end. diff --git a/tests/ts010100.bat b/tests/ts010100.bat new file mode 100644 index 0000000000..c4cc3849d5 --- /dev/null +++ b/tests/ts010100.bat @@ -0,0 +1,18 @@ +@echo off +rem +rem Batch file to compile and run ts010100 +rem +echo Compiling ts010100... +ppc386 ts010100 >nul +if errorlevel 1 goto comfailed +echo compilation of ts010100 : PASSED +ts010100 >nul +if errorlevel 0 goto runpassed +echo execution of ts010100 : FAILED +goto end +:runpassed +echo execution of ts010100 : PASSED +goto end +:comfailed +echo Compilation of ts010100 : FAILED +:end diff --git a/tests/ts010100.pp b/tests/ts010100.pp new file mode 100644 index 0000000000..95993ffd40 --- /dev/null +++ b/tests/ts010100.pp @@ -0,0 +1,6 @@ +var + o : tobject; + +begin + halt(1); +end. diff --git a/tests/ts010101.pp b/tests/ts010101.pp new file mode 100644 index 0000000000..88be3b6843 --- /dev/null +++ b/tests/ts010101.pp @@ -0,0 +1,11 @@ +{ tests assignements and compare } + +var + o1,o2 : tobject; + +begin + o1:=nil; + o2:=o1; + if o2<>nil then + halt(1); +end.