Jinyang He 2 лет назад
Родитель
Сommit
176462c39a

+ 2 - 0
tests/Makefile

@@ -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

+ 2 - 0
tests/Makefile.fpc

@@ -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
 
 

+ 7 - 0
tests/tbs/tb0072.pp

@@ -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;

+ 6 - 0
tests/tbs/tb0193.pp

@@ -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;

BIN
tests/test/cg/obj/linux/loongarch64/cpptcl1.o


BIN
tests/test/cg/obj/linux/loongarch64/cpptcl2.o


BIN
tests/test/cg/obj/linux/loongarch64/ctest.o


BIN
tests/test/cg/obj/linux/loongarch64/tcext3.o


BIN
tests/test/cg/obj/linux/loongarch64/tcext4.o


BIN
tests/test/cg/obj/linux/loongarch64/tcext5.o


BIN
tests/test/cg/obj/linux/loongarch64/tcext6.o


+ 31 - 0
tests/test/treturn1.pp

@@ -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.

+ 10 - 0
tests/webtbs/tw11563.pp

@@ -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;