add loongarch64 tests support

This commit is contained in:
Jinyang He 2022-10-17 09:30:55 +08:00 committed by Michael VAN CANNEYT
parent 33acbedd53
commit 6dcfed0e0b
13 changed files with 58 additions and 0 deletions

View File

@ -2580,7 +2580,9 @@ copyfiles:
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(C_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(CPP_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
ifeq ($(FULL_TARGET),i8086-msdos)
-$(COPY) $(TASM_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
endif
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/units/system
testprep: testprep-stamp.$(TEST_FULL_TARGET)
testprep-stamp.$(TEST_FULL_TARGET): utils tstunits copyfiles

View File

@ -284,7 +284,9 @@ copyfiles:
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(C_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(CPP_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
ifeq ($(FULL_TARGET),i8086-msdos)
-$(COPY) $(TASM_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
endif
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/units/system

View File

@ -73,6 +73,13 @@ asm
addi a1, y, 0
end;
{$endif CPURISCV64}
{$ifdef CPULOONGARCH64}
{$define SUPPORTED}
asm
addi.d $a0, x, 0
addi.d $a1, y, 0
end;
{$endif CPULOONGARCH6}
{$ifndef SUPPORTED}
asm
end;

View File

@ -70,6 +70,12 @@ end;
end;
{$define implemented}
{$endif cpuriscv64}
{$ifdef cpuloongarch64}
pcalau12i $a0, %got_pc_hi20(stacksize)
ld.d $a0, $a0, %got_pc_lo12(stacksize)
end;
{$define implemented}
{$endif cpuloongarch64}
{$ifndef implemented}
{$error This test does not supported this CPU}
end;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

31
tests/test/treturn1.pp Normal file
View File

@ -0,0 +1,31 @@
{ %opt=-O-}
type
TIpHtmlElemMarginStyle = (
hemsAuto, // use default
hemsPx // pixel
);
TIpHtmlElemMargin = record
Style: TIpHtmlElemMarginStyle;
Size: single;
end;
var
tmp2 :TIpHtmlElemMargin;
function test_fn:TIpHtmlElemMargin;
var
tmp1 :TIpHtmlElemMargin;
begin
tmp1.Size := 3.123;
tmp1.Style := hemsPx;
test_fn := tmp1;
end;
begin
tmp2 := test_fn();
if(tmp2.Style <> hemsPx)then
halt(1);
if(Abs(tmp2.Size - 3.123) > 0.01)then
halt(2);
writeln('ok ');
end.

View File

@ -27,6 +27,10 @@ program ExecStack;
{$ifdef cpum68k}
ret: word;
{$endif}
{$if defined(cpuloongarch64)}
ret: longint;
{$endif}
DoNothing: proc;
begin
@ -94,6 +98,12 @@ program ExecStack;
DoNothing;
{$endif cpuarm}
{$if defined(cpuloongarch64)}
ret := $20220829;
DoNothing := proc(@ret);
DoNothing;
{$endif cpuloongarch64}
end;
begin
DoIt;