+ added a very simple test for i8086-msdos for linking an external TASM

assembler .obj module. Note that TASM modules aren't fully supported yet,
  because our OMF internal linker doesn't support all features of the OMF object
  format. This test works, because it's really simple. As more OMF features are
  supported, this test will be extended.

git-svn-id: trunk@32353 -
This commit is contained in:
nickysn 2015-11-17 17:08:25 +00:00
parent e54be530d7
commit a19c506b46
6 changed files with 63 additions and 0 deletions

3
.gitattributes vendored
View File

@ -11073,6 +11073,7 @@ tests/test/cg/obj/linux/x86_64/tcext4.o -text
tests/test/cg/obj/linux/x86_64/tcext5.o -text
tests/test/cg/obj/linux/x86_64/tcext6.o -text
tests/test/cg/obj/macos/powerpc/ctest.o -text
tests/test/cg/obj/msdos/i8086/ttasm1.obj -text
tests/test/cg/obj/netbsd/i386/cpptcl1.o -text
tests/test/cg/obj/netbsd/i386/cpptcl2.o -text
tests/test/cg/obj/netbsd/i386/ctest.o -text
@ -11136,6 +11137,7 @@ tests/test/cg/obj/tcext3.c -text
tests/test/cg/obj/tcext4.c -text
tests/test/cg/obj/tcext5.c -text
tests/test/cg/obj/tcext6.c svneol=native#text/plain
tests/test/cg/obj/ttasm1.asm svneol=native#text/plain
tests/test/cg/obj/win32/i386/cpptcl1.o -text
tests/test/cg/obj/win32/i386/cpptcl2.o -text
tests/test/cg/obj/win32/i386/ctest.o -text
@ -11500,6 +11502,7 @@ tests/test/cpu16/i8086/tptrcon.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tptrsize.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tretf1.pp svneol=native#text/plain
tests/test/cpu16/i8086/tretf2.pp svneol=native#text/plain
tests/test/cpu16/i8086/ttasm1.pp svneol=native#text/plain
tests/test/cpu16/i8086/ttheap1.pp svneol=native#text/pascal
tests/test/cpu16/taddint1.pp svneol=native#text/pascal
tests/test/dumpclass.pp svneol=native#text/plain

View File

@ -2202,6 +2202,7 @@ endif
C_SOURCE_DIR=test/cg/obj
C_SOURCES=ctest.c tcext3.c tcext4.c tcext5.c tcext6.c
CPP_SOURCES=cpptcl1.cpp cpptcl2.cpp
TASM_SOURCES=ttasm1.asm
ifneq ($(TEST_ABI),)
C_OBJECTS_DIR=$(C_SOURCE_DIR)/$(TEST_OS_TARGET)/$(TEST_CPU_TARGET)-$(TEST_ABI)
else
@ -2209,6 +2210,7 @@ C_OBJECTS_DIR=$(C_SOURCE_DIR)/$(TEST_OS_TARGET)/$(TEST_CPU_TARGET)
endif
C_OBJECTS=$(addprefix $(C_OBJECTS_DIR)/, $(subst .c,.o, $(C_SOURCES)))
CPP_OBJECTS=$(addprefix $(C_OBJECTS_DIR)/, $(subst .cpp,.o, $(CPP_SOURCES)))
TASM_OBJECTS=$(addprefix $(C_OBJECTS_DIR)/, $(subst .asm,.obj, $(TASM_SOURCES)))
create_c_objects:
ifneq ($(TEST_CCOMPILER),)
-$(COPY) $(addprefix $(C_SOURCE_DIR)/, $(C_SOURCES)) $(C_OBJECTS_DIR)
@ -2235,6 +2237,7 @@ copyfiles: $(TEST_OUTPUTDIR)
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(C_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(CPP_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(TASM_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/units/system
testprep: testprep-stamp.$(TEST_FULL_TARGET)
testprep-stamp.$(TEST_FULL_TARGET): utils tstunits copyfiles

View File

@ -224,6 +224,7 @@ endif
C_SOURCE_DIR=test/cg/obj
C_SOURCES=ctest.c tcext3.c tcext4.c tcext5.c tcext6.c
CPP_SOURCES=cpptcl1.cpp cpptcl2.cpp
TASM_SOURCES=ttasm1.asm
ifneq ($(TEST_ABI),)
C_OBJECTS_DIR=$(C_SOURCE_DIR)/$(TEST_OS_TARGET)/$(TEST_CPU_TARGET)-$(TEST_ABI)
else
@ -231,6 +232,7 @@ C_OBJECTS_DIR=$(C_SOURCE_DIR)/$(TEST_OS_TARGET)/$(TEST_CPU_TARGET)
endif
C_OBJECTS=$(addprefix $(C_OBJECTS_DIR)/, $(subst .c,.o, $(C_SOURCES)))
CPP_OBJECTS=$(addprefix $(C_OBJECTS_DIR)/, $(subst .cpp,.o, $(CPP_SOURCES)))
TASM_OBJECTS=$(addprefix $(C_OBJECTS_DIR)/, $(subst .asm,.obj, $(TASM_SOURCES)))
create_c_objects:
@ -263,6 +265,7 @@ copyfiles: $(TEST_OUTPUTDIR)
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(C_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(CPP_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(COPY) $(TASM_OBJECTS) $(TEST_OUTPUTDIR)/test/cg
-$(MKDIRTREE) $(TEST_OUTPUTDIR)/test/units/system

Binary file not shown.

View File

@ -0,0 +1,16 @@
; test for linking a TASM external object module for the i8086-msdos platform
; assemble with TASM version 3.2 - it is the most commonly used version for
; linking with 16-bit pascal code, since it comes bundled with Borland Pascal 7
.MODEL large,PASCAL
.DATA
.CODE
IncDWord PROC FAR a: DWORD
PUBLIC IncDWord
mov ax, word ptr a
mov dx, word ptr [a+2]
add ax, 1
adc dx, 0
ret
IncDWord ENDP
END

View File

@ -0,0 +1,38 @@
{ %target=msdos }
{ Test for linking a TASM external module under i8086-msdos }
{ This test is Borland Pascal 7 compatible }
program ttasm1;
{$ifdef FPC}
{$ifdef FPC_MM_LARGE}
{$define ENABLE_TEST}
{$endif FPC_MM_LARGE}
{$else FPC}
{$define ENABLE_TEST}
{$endif FPC}
{$ifdef ENABLE_TEST}
function IncDWord(a: longint): longint; far; external {$ifdef fpc}name 'INCDWORD'{$endif};
{$L ttasm1.obj}
procedure Error;
begin
Writeln('Error!');
Halt(1);
end;
begin
if IncDWord(5)<>6 then
Error;
Writeln('Ok!');
end
{$else ENABLE_TEST}
begin
Writeln('This test is for a different memory model.');
end
{$endif ENABLE_TEST}
.