* procvar difference with smallint - longint should fail

This commit is contained in:
peter 2002-10-30 18:53:38 +00:00
parent 1bd92de936
commit 4d35408f01

31
tests/tbf/tb0138.pp Normal file
View File

@ -0,0 +1,31 @@
{ %fail }
type
p_int = procedure (var i : smallint);
procedure testl(var i : longint);
begin
i:=$ffff;
end;
var
p : p_int;
r : packed record
{$ifdef ENDIAN_BIG}
j,i : smallint;
{$else}
i,j : smallint;
{$endif}
end;
begin
p:=@testl;
r.j:=5;
p(r.i);
if r.j<>5 then
begin
writeln('Wrong code overwrites j');
halt(1);
end;
end.