* new bug

This commit is contained in:
peter 2004-12-26 13:44:40 +00:00
parent a1a644cbb5
commit 96d29c3f2d
2 changed files with 106 additions and 0 deletions

27
tests/webtbf/tw3473.pp Normal file
View File

@ -0,0 +1,27 @@
{ %fail }
{$mode delphi}
type
TA = class
procedure douseful; virtual; abstract;
end;
TB = class(TA)
public
procedure callabs;
procedure douseful; override;
end;
procedure TB.douseful;
begin
{ This should give an error, comaptible with Kylix }
inherited;
end;
procedure TB.Callabs;
begin
end;
begin
end.

79
tests/webtbs/tw3467.pp Normal file
View File

@ -0,0 +1,79 @@
{ Source provided for Free Pascal Bug Report 3467 }
{ Submitted by "Micha Nelissen" on 2004-12-24 }
{ e-mail: micha@neli.hopto.org }
program threadvartest;
{$mode objfpc}
{$H+}
uses
erroru,
sysutils,
classes
{$ifdef unix}
, cthreads
{$endif}
;
type
tthread1 = class(tthread)
public
p : pointer;
procedure execute; override;
end;
tthread2 = class(tthread)
public
p : pointer;
procedure execute; override;
end;
threadvar
athreadvar: integer;
procedure tthread1.execute;
var
i: integer;
begin
writeln('thread 1 var is @', ptrint(@athreadvar));
athreadvar := 1;
p:=@athreadvar;
Sleep(2000);
for i := 0 to 100000 do
if athreadvar <> 1 then
begin
writeln(athreadvar);
error;
break;
end;
end;
procedure tthread2.execute;
var
i: integer;
begin
writeln('thread 2 var is @', ptrint(@athreadvar));
athreadvar := 9;
p:=@athreadvar;
Sleep(2000);
for i := 0 to 100000 do
if athreadvar <> 9 then
begin
writeln(' ', athreadvar);
error;
break;
end;
end;
var
thread1: tthread1;
thread2: tthread2;
begin
thread1 := tthread1.create(false);
thread2 := tthread2.create(false);
thread1.waitfor;
thread2.waitfor;
if thread1.p=thread2.p then
error;
end.