mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 08:18:12 +02:00

the assembler optimizer as register allocations are not correct, resolves #33565 git-svn-id: trunk@43384 -
33 lines
556 B
ObjectPascal
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.
|