mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-01 08:26:16 +02:00
* restored version
This commit is contained in:
parent
ff187a0a4f
commit
5132685b05
13
tests/TS010009.PP
Normal file
13
tests/TS010009.PP
Normal file
@ -0,0 +1,13 @@
|
||||
unit ts010009;
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
tr = record
|
||||
case a : (x,y,z) of
|
||||
x : (l : longint);
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
15
tests/ts010010.pp
Normal file
15
tests/ts010010.pp
Normal file
@ -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.
|
18
tests/ts010014.bat
Normal file
18
tests/ts010014.bat
Normal file
@ -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
|
42
tests/ts010014.pp
Normal file
42
tests/ts010014.pp
Normal file
@ -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.
|
18
tests/ts010100.bat
Normal file
18
tests/ts010100.bat
Normal file
@ -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
|
6
tests/ts010100.pp
Normal file
6
tests/ts010100.pp
Normal file
@ -0,0 +1,6 @@
|
||||
var
|
||||
o : tobject;
|
||||
|
||||
begin
|
||||
halt(1);
|
||||
end.
|
11
tests/ts010101.pp
Normal file
11
tests/ts010101.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{ tests assignements and compare }
|
||||
|
||||
var
|
||||
o1,o2 : tobject;
|
||||
|
||||
begin
|
||||
o1:=nil;
|
||||
o2:=o1;
|
||||
if o2<>nil then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user