fpc/tests/webtbs/tw23962.pp
Jonas Maebe 5d628b29bb * set the subregsize of OS_M64 SSE registers to R_SUBQ so we can
differentiate between 64 bit and 128 bit (R_SUBMMWHOLE) SSE vector regs,
    and support spilling/assembling for R_SUBQ SSE registers (8 bytes)
    (mantis #23962)

    We currently never use the full 128 bit of an SSE register, and
    spilling for those hasn't been implemented yet either (R_SUBMMWHOLE
    SSE regs are spilled into a 4-byte temp currently -> can overwrite data)

git-svn-id: trunk@23700 -
2013-03-06 12:42:46 +00:00

47 lines
746 B
ObjectPascal

{$MODE ObjFpc}
uses classes;
type
TVector3 = packed record
X, Y, Z: Single;
end;
TClassA = class
protected
fVector: TVector3;
public
procedure SetVector(AVector: TVector3); virtual; abstract;
end;
{ TClassB }
TClassB = class(TClassA)
public
procedure SetVector(AVector: TVector3); override;
end;
{ TClassB }
procedure TClassB.SetVector(AVector: TVector3);
begin
writeln('TClassB: ',AVector.X,',',AVector.Y,',',AVector.Z);
fVector:=AVector;
end;
var
MyVector: TVector3;
MyClassB: TClassB;
begin
MyVector.X:=0;
MyVector.Y:=0;
MyVector.Z:=3;
MyClassB:=TClassB.Create;
MyClassB.SetVector(MyVector);
if (MyClassB.fvector.x<>0) or
(MyClassB.fvector.y<>0) or
(MyClassB.fvector.z<>3) then
halt(1);
end.