fpc/tests/webtbs/tw33565.pp
florian c6659d62f8 * do not join register deallocations/allocations as it makes no use and causes later on trouble in
the assembler optimizer as register allocations are not correct, resolves #33565

git-svn-id: trunk@43384 -
2019-11-03 17:13:59 +00:00

33 lines
556 B
ObjectPascal

{ %OPT=-O- -OoREGVAR -Oolevel1 -Cr -Mobjfpc -Oopeephole }
program app_test_core;
uses
SysUtils, Classes;
procedure SetMemory(Stream: TStream; var P: Pointer; var PSize: Integer);
begin
PSize := Stream.Size;
GetMem(P, PSize);
Stream.Position := 0;
Stream.Read(P^, PSize);
end;
var
M: TMemoryStream;
L, V: Integer;
P: Pointer;
begin
M := TMemoryStream.Create;
V := -1;
M.Write(V, SizeOf(V));
M.Position := 0;
P := nil;
L := 0;
SetMemory(M, P, L);
FreeMem(P);
M.Free;
end.