diff --git a/tests/Makefile b/tests/Makefile index 4a2b1c713e..b820533a13 100644 --- a/tests/Makefile +++ b/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 diff --git a/tests/Makefile.fpc b/tests/Makefile.fpc index 1b816e62cf..ba94322b14 100644 --- a/tests/Makefile.fpc +++ b/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 diff --git a/tests/tbs/tb0072.pp b/tests/tbs/tb0072.pp index 782cb05905..fa883c4a34 100644 --- a/tests/tbs/tb0072.pp +++ b/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; diff --git a/tests/tbs/tb0193.pp b/tests/tbs/tb0193.pp index 640089b4ea..73aa357d27 100644 --- a/tests/tbs/tb0193.pp +++ b/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; diff --git a/tests/test/cg/obj/linux/loongarch64/cpptcl1.o b/tests/test/cg/obj/linux/loongarch64/cpptcl1.o new file mode 100644 index 0000000000..b2ddc42f00 Binary files /dev/null and b/tests/test/cg/obj/linux/loongarch64/cpptcl1.o differ diff --git a/tests/test/cg/obj/linux/loongarch64/cpptcl2.o b/tests/test/cg/obj/linux/loongarch64/cpptcl2.o new file mode 100644 index 0000000000..e9314dc4b7 Binary files /dev/null and b/tests/test/cg/obj/linux/loongarch64/cpptcl2.o differ diff --git a/tests/test/cg/obj/linux/loongarch64/ctest.o b/tests/test/cg/obj/linux/loongarch64/ctest.o new file mode 100644 index 0000000000..5025c61263 Binary files /dev/null and b/tests/test/cg/obj/linux/loongarch64/ctest.o differ diff --git a/tests/test/cg/obj/linux/loongarch64/tcext3.o b/tests/test/cg/obj/linux/loongarch64/tcext3.o new file mode 100644 index 0000000000..6c4836aba5 Binary files /dev/null and b/tests/test/cg/obj/linux/loongarch64/tcext3.o differ diff --git a/tests/test/cg/obj/linux/loongarch64/tcext4.o b/tests/test/cg/obj/linux/loongarch64/tcext4.o new file mode 100644 index 0000000000..864c68a608 Binary files /dev/null and b/tests/test/cg/obj/linux/loongarch64/tcext4.o differ diff --git a/tests/test/cg/obj/linux/loongarch64/tcext5.o b/tests/test/cg/obj/linux/loongarch64/tcext5.o new file mode 100644 index 0000000000..8c89d1b11b Binary files /dev/null and b/tests/test/cg/obj/linux/loongarch64/tcext5.o differ diff --git a/tests/test/cg/obj/linux/loongarch64/tcext6.o b/tests/test/cg/obj/linux/loongarch64/tcext6.o new file mode 100644 index 0000000000..c76173b5ed Binary files /dev/null and b/tests/test/cg/obj/linux/loongarch64/tcext6.o differ diff --git a/tests/test/treturn1.pp b/tests/test/treturn1.pp new file mode 100644 index 0000000000..13d1afa96e --- /dev/null +++ b/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. diff --git a/tests/webtbs/tw11563.pp b/tests/webtbs/tw11563.pp index e52f69d5e8..cbb241cbaa 100644 --- a/tests/webtbs/tw11563.pp +++ b/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;