diff options
Diffstat (limited to 'mips/tests/test')
26 files changed, 524 insertions, 161 deletions
diff --git a/mips/tests/test/jvm/tenum2.pp b/mips/tests/test/jvm/tenum2.pp new file mode 100644 index 0000000000..a485691298 --- /dev/null +++ b/mips/tests/test/jvm/tenum2.pp @@ -0,0 +1,34 @@ +program tenum2; + +{$mode delphi} + +type + tenum2enum = (e_zero, e_one, e_two); + + tenum2base = class abstract + constructor create; + procedure init; virtual; abstract; + end; + + tenum2child = class(tenum2base) + fenum: tenum2enum; + procedure init; override; + end; + +constructor tenum2base.create; + begin + init; + end; + +procedure tenum2child.init; + begin + fenum:=e_one; + end; + +var + c: tenum2child; +begin + c:=tenum2child.create; + if c.fenum<>e_one then + halt(1); +end. diff --git a/mips/tests/test/jvm/testall.bat b/mips/tests/test/jvm/testall.bat index 2435e66f15..594e8b76f6 100644 --- a/mips/tests/test/jvm/testall.bat +++ b/mips/tests/test/jvm/testall.bat @@ -64,10 +64,14 @@ if %errorlevel% neq 0 exit /b %errorlevel% java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tbyte if %errorlevel% neq 0 exit /b %errorlevel% del uenum.ppu -ppcjvm -O2 -g tenum +ppcjvm -O2 -g -CTenumfieldinit tenum if %errorlevel% neq 0 exit /b %errorlevel% java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tenum if %errorlevel% neq 0 exit /b %errorlevel% +ppcjvm -O2 -g tenum2 +if %errorlevel% neq 0 exit /b %errorlevel% +java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tenum2 +if %errorlevel% neq 0 exit /b %errorlevel% ppcjvm -O2 -g tprop if %errorlevel% neq 0 exit /b %errorlevel% java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tprop @@ -236,4 +240,7 @@ ppcjvm -O2 -g -B taddbool if %errorlevel% neq 0 exit /b %errorlevel% java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. -Sa TAddBool if %errorlevel% neq 0 exit /b %errorlevel% - +ppcjvm -O2 -g -B tsetansistr +if %errorlevel% neq 0 exit /b %errorlevel% +java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. -Sa tsetansistr +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/mips/tests/test/jvm/testall.sh b/mips/tests/test/jvm/testall.sh index c80baf74a9..ddd869b8a7 100755 --- a/mips/tests/test/jvm/testall.sh +++ b/mips/tests/test/jvm/testall.sh @@ -47,8 +47,10 @@ $PPC -O2 -g forw $PPC -O2 -g tbyte java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tbyte rm -f uenum.ppu -$PPC -O2 -g tenum +$PPC -O2 -g -CTenumfieldinit tenum java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tenum +$PPC -O2 -g tenum2 +java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tenum2 $PPC -O2 -g tprop java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tprop $PPC -O2 -g tprop2 @@ -133,3 +135,5 @@ $PPC -O2 -g -B -Sa tassert java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tassert $PPC -O2 -g -B -Sa taddbool java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. TAddBool +$PPC -O2 -g -B -Sa tsetansistr +java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tsetansistr diff --git a/mips/tests/test/jvm/tsetansistr.pp b/mips/tests/test/jvm/tsetansistr.pp new file mode 100644 index 0000000000..1dd983dff0 --- /dev/null +++ b/mips/tests/test/jvm/tsetansistr.pp @@ -0,0 +1,31 @@ +program tsetansistr;
+
+{$mode delphi}
+{$modeswitch unicodestrings}
+
+type
+ ByteArray = array of byte;
+
+const
+ AnsiStrOffset = 1;
+
+function AnsiStringOfBytes(const Src : ByteArray) : AnsiString;
+var
+ i : integer;
+begin
+ SetLength(Result, Length(Src));
+
+ for i := 0 to Length(Src) - 1 do
+ Result[i + AnsiStrOffset] := Chr(Src[i]);
+end;
+
+var
+ A : ByteArray;
+ B : AnsiString;
+begin
+ DefaultSystemCodePage:=20127; // ASCII
+ SetLength(A, 1); A[0] := $98;
+ B := AnsiStringOfBytes(A);
+ if ord(B[1]) <> $98 then
+ halt(1);
+end.
diff --git a/mips/tests/test/opt/tretopt.pp b/mips/tests/test/opt/tretopt.pp index b10ac0933d..fa1294bd21 100644 --- a/mips/tests/test/opt/tretopt.pp +++ b/mips/tests/test/opt/tretopt.pp @@ -294,7 +294,7 @@ begin {$ifdef darwin} movl %eax,p3-.Lpic(%ecx) {$else darwin} - addl $_GLOBAL_OFFSET_TABLE_,%ecx + addl $_GLOBAL_OFFSET_TABLE_+1,%ecx movl %eax,p3@GOT(%ecx) {$endif darwin} {$endif FPC_PIC} @@ -349,7 +349,7 @@ begin {$ifdef darwin} movl %eax,p3-.Lpic(%ecx) {$else darwin} - addl $_GLOBAL_OFFSET_TABLE_,%ecx + addl $_GLOBAL_OFFSET_TABLE_+1,%ecx movl %eax,p3@GOT(%ecx) {$endif darwin} {$endif FPC_PIC} diff --git a/mips/tests/test/packages/bzip2/tbzip2streamtest.pp b/mips/tests/test/packages/bzip2/tbzip2streamtest.pp index b82616c5be..dfa10fe6ba 100644 --- a/mips/tests/test/packages/bzip2/tbzip2streamtest.pp +++ b/mips/tests/test/packages/bzip2/tbzip2streamtest.pp @@ -70,53 +70,56 @@ begin UncompressedFile:=SysUtils.GetTempFileName(EmptyStr, 'UNC'); CompressedFile:=SysUtils.GetTempFileName(EmptyStr, 'BZ2'); - // Set up test bz2 file - // create a resource stream which points to our resource - ExampleFileResourceStream := TResourceStream.Create(HInstance, 'ALL', 'RT_RCDATA'); try - ExampleFileStream := TFileStream.Create(CompressedFile, fmCreate); + // Set up test bz2 file + // create a resource stream which points to our resource + ExampleFileResourceStream := TResourceStream.Create(HInstance, 'ALL', 'RT_RCDATA'); try - ExampleFileStream.CopyFrom(ExampleFileResourceStream, ExampleFileResourceStream.Size); + ExampleFileStream := TFileStream.Create(CompressedFile, fmCreate); + try + ExampleFileStream.CopyFrom(ExampleFileResourceStream, ExampleFileResourceStream.Size); + finally + ExampleFileStream.Free; + end; finally - ExampleFileStream.Free; + ExampleFileResourceStream.Free; end; - finally - ExampleFileResourceStream.Free; - end; - // Actual decompression - if decompress(CompressedFile, UncompressedFile) then - begin - // Now check if contents match. - UncompressedHash:=MD5Print(MD5File(UncompressedFile, MDDefBufSize)); - if UncompressedHash=ExpectedHash then - begin - code:=0; //success - end - else - begin - writeln('MD5 hash comparison between original file and uncompressed file failed'); - writeln('Got hash:'+UncompressedHash); - writeln('Expected:'+ExpectedHash); - code:=2; - end; - end - else - begin - writeln('bunzip2 decompression failure'); - code:=1; - end; + // Actual decompression + if decompress(CompressedFile, UncompressedFile) then + begin + // Now check if contents match. + UncompressedHash:=MD5Print(MD5File(UncompressedFile, MDDefBufSize)); + if UncompressedHash=ExpectedHash then + begin + code:=0; //success + end + else + begin + writeln('MD5 hash comparison between original file and uncompressed file failed'); + writeln('Got hash:'+UncompressedHash); + writeln('Expected:'+ExpectedHash); + code:=2; + end; + end + else + begin + writeln('bunzip2 decompression failure'); + code:=1; + end; - try - if CompressedFile<>EmptyStr then DeleteFile(CompressedFile); - if UncompressedFile<>EmptyStr then DeleteFile(UncompressedFile); - finally - // Ignore errors; operating system should clean out temp files - end; - if code = 0 then - writeln('Basic bzip2 tests passed') - else - writeln('Basic bzip2 test failed: ', code); + if code = 0 then + writeln('Basic bzip2 tests passed') + else + writeln('Basic bzip2 test failed: ', code); + finally + try + if CompressedFile<>EmptyStr then DeleteFile(CompressedFile); + if UncompressedFile<>EmptyStr then DeleteFile(UncompressedFile); + finally + // Ignore errors; operating system should clean out temp files + end; + end; Halt(code); end. diff --git a/mips/tests/test/tasmread.pp b/mips/tests/test/tasmread.pp index c3ac8fd3a8..b7c0bf7372 100644 --- a/mips/tests/test/tasmread.pp +++ b/mips/tests/test/tasmread.pp @@ -20,7 +20,7 @@ begin {$ifdef darwin} mov [test.l-@@LPIC+ecx],5 {$else darwin} - add ecx, _GLOBAL_OFFSET_TABLE_ + add ecx, _GLOBAL_OFFSET_TABLE_+1 mov [test.l + ecx],5 {$endif darwin} {$endif FPC_PIC} diff --git a/mips/tests/test/tcg1.pp b/mips/tests/test/tcg1.pp index bd8f702c83..59a6818dbc 100644 --- a/mips/tests/test/tcg1.pp +++ b/mips/tests/test/tcg1.pp @@ -2,71 +2,32 @@ {$R-} program test_register_pushing; -var - before, after : longint; - wpush,lpush : longint; const haserror : boolean = false; - + +procedure dotest; +var + wpush,lpush: longint; begin -{$ifdef CPUI386} {$asmmode att} asm -{$ifndef FPC_PIC} - movl %esp,before - pushw %es - movl %esp,after - popw %es -{$else not FPC_PIC} - call .LPIC -.LPIC: - popl %ecx -{$ifdef darwin} - movl %esp,before-.LPIC(%ecx) - pushw %es - movl %esp,after-.LPIC(%ecx) - popw %es -{$else darwin} - addl $_GLOBAL_OFFSET_TABLE_,%ecx - movl %esp,before@GOT(%ecx) + movl %esp,wpush pushw %es - movl %esp,after@GOT(%ecx) + subl %esp,wpush popw %es -{$endif darwin} -{$endif not FPC_PIC} end; - wpush:=before-after; if wpush<>2 then begin Writeln('Compiler does not push "pushw %es" into 2 bytes'); haserror:=true; end; + asm -{$ifndef FPC_PIC} - movl %esp,before + movl %esp,lpush pushl %es - movl %esp,after + subl %esp,lpush popl %es -{$else not FPC_PIC} - call .LPIC -.LPIC: - popl %ecx -{$ifdef darwin} - movl %esp,before-.LPIC(%ecx) - pushl %es - movl %esp,after-.LPIC(%ecx) - popl %es -{$else darwin} - addl $_GLOBAL_OFFSET_TABLE_,%ecx - movl %esp,before@GOT(%ecx) - pushl %es - movl %esp,after@GOT(%ecx) - popl %es -{$endif darwin} -{$endif not FPC_PIC} end; - lpush:=before-after; - if lpush<>4 then begin Writeln('Compiler does not push "pushl %es" into 4 bytes'); @@ -74,61 +35,22 @@ begin end; asm -{$ifndef FPC_PIC} - movl %esp,before - pushw %gs - movl %esp,after - popw %gs -{$else not FPC_PIC} - call .LPIC -.LPIC: - popl %ecx -{$ifdef darwin} - movl %esp,before-.LPIC(%ecx) + movl %esp,wpush pushw %gs - movl %esp,after-.LPIC(%ecx) + subl %esp,wpush popw %gs -{$else darwin} - addl $_GLOBAL_OFFSET_TABLE_,%ecx - movl %esp,before@GOT(%ecx) - pushw %gs - movl %esp,after@GOT(%ecx) - popw %gs -{$endif darwin} -{$endif not FPC_PIC} end; - wpush:=before-after; if wpush<>2 then begin Writeln('Compiler does not push "pushw %gs" into 2 bytes'); haserror:=true; end; asm -{$ifndef FPC_PIC} - movl %esp,before - pushl %gs - movl %esp,after - popl %gs -{$else not FPC_PIC} - call .LPIC -.LPIC: - popl %ecx -{$ifdef darwin} - movl %esp,before-.LPIC(%ecx) + movl %esp,lpush pushl %gs - movl %esp,after-.LPIC(%ecx) + subl %esp,lpush popl %gs -{$else darwin} - addl $_GLOBAL_OFFSET_TABLE_,%ecx - movl %esp,before@GOT(%ecx) - pushl %gs - movl %esp,after@GOT(%ecx) - popl %gs -{$endif darwin} -{$endif not FPC_PIC} end; - lpush:=before-after; - if lpush<>4 then begin Writeln('Compiler does not push "pushl %gs" into 4 bytes'); @@ -136,31 +58,16 @@ begin end; {$asmmode intel} asm -{$ifndef FPC_PIC} - mov before,esp + mov lpush,esp push es - mov after,esp + sub lpush,esp pop es -{$else not FPC_PIC} - call @@LPIC -@@LPIC: - pop ecx -{$ifdef darwin} - mov [before-@@LPIC+ecx],esp - push es - mov [after-@@LPIC+ecx],esp - pop es -{$else darwin} - add ecx,@_GLOBAL_OFFSET_TABLE_ - mov [ecx].OFFSET before,esp - push es - mov [ecx].OFFSET after,esp - pop es -{$endif darwin} -{$endif not FPC_PIC} end; - Writeln('Intel "push es" uses ',before-after,' bytes'); -{$endif CPUI386} + Writeln('Intel "push es" uses ',lpush,' bytes'); if haserror then Halt(1); +end; + +begin + dotest; end. diff --git a/mips/tests/test/testsse2.pp b/mips/tests/test/testsse2.pp index e6ecd81ad9..5ad9cb0d30 100644 --- a/mips/tests/test/testsse2.pp +++ b/mips/tests/test/testsse2.pp @@ -22,7 +22,7 @@ begin psubq %xmm1,%xmm2 psubq q-.LPIC(%ecx),%xmm4 {$else darwin} - addl $_GLOBAL_OFFSET_TABLE_,%ecx + addl $_GLOBAL_OFFSET_TABLE_+1,%ecx movdqa %xmm1,%xmm2 movdqa q@GOT(%ecx),%xmm4 psubq %xmm1,%xmm2 diff --git a/mips/tests/test/tgeneric76.pp b/mips/tests/test/tgeneric76.pp new file mode 100644 index 0000000000..4b2aa6ef6e --- /dev/null +++ b/mips/tests/test/tgeneric76.pp @@ -0,0 +1,45 @@ +{$mode delphi} + +unit tgeneric76; + +interface + +type + + { TPointEx } + + TPointEx<T> = record + X, Y: T; + function Create(const AX, AY: T): TPointEx<T>; + class procedure Swap(var A, B: TPointEx<T>); static; + class procedure OrderByY(var A, B: TPointEx<T>); static; + end; + + TPoint = TPointEx<integer>; + TPointF = TPointEx<single>; + +implementation + +function TPointEx<T>.Create(const AX, AY: T): TPointEx<T>; +begin + result.X:=AX; + result.Y:=AY; +end; + +class procedure TPointEx<T>.Swap(var A, B: TPointEx<T>); +var + tmp: TPointEx<T>; +begin + tmp:=A; + A:=B; + B:=tmp; +end; + +class procedure TPointEx<T>.OrderByY(var A, B: TPointEx<T>); +begin + if A.Y > B.Y then + TPointEx<T>.Swap(A,B); +end; + + +end. diff --git a/mips/tests/test/tgeneric77.pp b/mips/tests/test/tgeneric77.pp new file mode 100644 index 0000000000..060c802d37 --- /dev/null +++ b/mips/tests/test/tgeneric77.pp @@ -0,0 +1,48 @@ +{$mode objfpc}{$h+} +{$modeswitch advancedrecords} + +unit tgeneric77; + +interface + +type + + { TPointEx } + + generic TPointEx<T> = record + X, Y: T; + function Create(const AX, AY: T): TPointEx; + class procedure Swap(var A, B: TPointEx); static; + class procedure OrderByY(var A, B: TPointEx); static; + end; + + //TPoint = specialize TPointEx<integer>; + TPointF = specialize TPointEx<single>; + +implementation + +{ TPoint<T> } + +function TPointEx.Create(const AX, AY: T): TPointEx; +begin + result.X:=AX; + result.Y:=AY; +end; + +class procedure TPointEx.Swap(var A, B: TPointEx); +var + tmp: TPointEx; +begin + tmp:=A; + A:=B; + B:=tmp; +end; + +class procedure TPointEx.OrderByY(var A, B: TPointEx); +begin + if A.Y > B.Y then + TPointEx.Swap(A,B); +end; + + +end. diff --git a/mips/tests/test/tgeneric78.pp b/mips/tests/test/tgeneric78.pp new file mode 100644 index 0000000000..4addc2b12e --- /dev/null +++ b/mips/tests/test/tgeneric78.pp @@ -0,0 +1,27 @@ +{ %NORUN } + +{ additional test based on 21064 } +program tgeneric78; + +{$mode delphi} + +type + IGenericIntf<T> = interface + function SomeMethod: T; + end; + + TGenericClass<T> = class(TInterfacedObject, IGenericIntf<LongInt>) + private + protected + function GenericIntf_SomeMethod: LongInt; + function IGenericIntf<LongInt>.SomeMethod = GenericIntf_SomeMethod; + end; + +function TGenericClass<T>.GenericIntf_SomeMethod: LongInt; +begin +end; + +type + TGenericClassLongInt = TGenericClass<String>; +begin +end. diff --git a/mips/tests/test/tgeneric79.pp b/mips/tests/test/tgeneric79.pp new file mode 100644 index 0000000000..da94c73e20 --- /dev/null +++ b/mips/tests/test/tgeneric79.pp @@ -0,0 +1,27 @@ +{ %NORUN } + +{ additional test based on 21064 } +program tgeneric79; + +{$mode objfpc} + +type + generic IGenericIntf<T> = interface + function SomeMethod: T; + end; + + generic TGenericClass<T> = class(TInterfacedObject, specialize IGenericIntf<LongInt>) + private + protected + function GenericIntf_SomeMethod: LongInt; + function IGenericIntf<LongInt>.SomeMethod = GenericIntf_SomeMethod; + end; + +function TGenericClass.GenericIntf_SomeMethod: LongInt; +begin +end; + +type + TGenericClassLongInt = specialize TGenericClass<String>; +begin +end. diff --git a/mips/tests/test/tgeneric80.pp b/mips/tests/test/tgeneric80.pp new file mode 100644 index 0000000000..f23c900dc1 --- /dev/null +++ b/mips/tests/test/tgeneric80.pp @@ -0,0 +1,18 @@ +{ %NORUN } + +program tgeneric80; + +{$mode delphi} + +type + TTest<T, S> = record + end; + TTest<T> = record + end; + PTest = ^TTest; + TTest = record + end; + +begin + +end. diff --git a/mips/tests/test/tgeneric81.pp b/mips/tests/test/tgeneric81.pp new file mode 100644 index 0000000000..8618e9ad39 --- /dev/null +++ b/mips/tests/test/tgeneric81.pp @@ -0,0 +1,18 @@ +{ %NORUN } + +program tgeneric81; + +{$mode delphi} + +type + PTest = ^TTest; + TTest<T, S> = record + end; + TTest<T> = record + end; + TTest = record + end; + +begin + +end. diff --git a/mips/tests/test/tgeneric82.pp b/mips/tests/test/tgeneric82.pp new file mode 100644 index 0000000000..7b556ce0f7 --- /dev/null +++ b/mips/tests/test/tgeneric82.pp @@ -0,0 +1,18 @@ +{ %NORUN } + +program tgeneric82; + +{$mode delphi} + +type + TTest = record + end; + TTest<T, S> = record + end; + TTest<T> = record + end; + PTest = ^TTest; + +begin + +end. diff --git a/mips/tests/test/tgeneric83.pp b/mips/tests/test/tgeneric83.pp new file mode 100644 index 0000000000..0e081956fd --- /dev/null +++ b/mips/tests/test/tgeneric83.pp @@ -0,0 +1,16 @@ +{ %FAIL } + +program tgeneric83; + +{$mode delphi} + +type + TTest<T> = record + end; + +const + Test: ^TTest = Nil; + +begin + +end. diff --git a/mips/tests/test/tgeneric84.pp b/mips/tests/test/tgeneric84.pp new file mode 100644 index 0000000000..ec33dd07a1 --- /dev/null +++ b/mips/tests/test/tgeneric84.pp @@ -0,0 +1,14 @@ +{ %FAIL } + +program tgeneric84; + +{$mode objfpc} + +type + generic TTest<T> = record + end; + + PTest = ^TTest; + +begin +end. diff --git a/mips/tests/test/tgeneric85.pp b/mips/tests/test/tgeneric85.pp new file mode 100644 index 0000000000..e7c634560f --- /dev/null +++ b/mips/tests/test/tgeneric85.pp @@ -0,0 +1,16 @@ +{ %FAIL } + +program tgeneric85; + +{$mode objfpc} + +type + generic TTest<T> = record + end; + +const + Test: ^TTest = Nil; + +begin + +end. diff --git a/mips/tests/test/tgeneric86.pp b/mips/tests/test/tgeneric86.pp new file mode 100644 index 0000000000..02520a0f41 --- /dev/null +++ b/mips/tests/test/tgeneric86.pp @@ -0,0 +1,17 @@ +{ %NORUN } + +program tgeneric86; + +{$mode objfpc}{$H+} +{$modeswitch advancedrecords} + +type + generic TTest<T> = record + type + PTest = ^TTest; + end; + +begin + +end. + diff --git a/mips/tests/test/tgeneric87.pp b/mips/tests/test/tgeneric87.pp new file mode 100644 index 0000000000..33e2afc92c --- /dev/null +++ b/mips/tests/test/tgeneric87.pp @@ -0,0 +1,18 @@ +{ %FAIL } + +program tgeneric87; + +{$mode objfpc} + +type + generic TTest<T> = record + + end; + +const + TestLongIntNil: ^specialize TTest<LongInt> = Nil; + TestBooleanNil: ^specialize TTest<Boolean> = Nil; + +begin + +end. diff --git a/mips/tests/test/tgeneric88.pp b/mips/tests/test/tgeneric88.pp new file mode 100644 index 0000000000..c8233ee7e2 --- /dev/null +++ b/mips/tests/test/tgeneric88.pp @@ -0,0 +1,17 @@ +{ %FAIL } + +program tgeneric88; + +{$mode objfpc} + +type + generic TTest<T> = record + + end; + + PTestLongInt = ^specialize TTest<LongInt>; + PTestBoolean = ^specialize TTest<Boolean>; + +begin + +end. diff --git a/mips/tests/test/tgeneric89.pp b/mips/tests/test/tgeneric89.pp new file mode 100644 index 0000000000..5e50ef1549 --- /dev/null +++ b/mips/tests/test/tgeneric89.pp @@ -0,0 +1,17 @@ +{ %NORUN } + +program tgeneric89; + +{$mode delphi} + +type + TTest<T> = record + + end; + + PTestLongInt = ^TTest<LongInt>; + PTestBoolean = ^TTest<Boolean>; + +begin + +end. diff --git a/mips/tests/test/tgeneric90.pp b/mips/tests/test/tgeneric90.pp new file mode 100644 index 0000000000..0c9ae3c4cb --- /dev/null +++ b/mips/tests/test/tgeneric90.pp @@ -0,0 +1,26 @@ +{ %NORUN } + +program tgeneric90; + +{$mode delphi} + +type + TTest = record + + end; + + TTest<T> = record + + end; + + TTest<T, S> = record + + end; + + PTestLongInt = ^TTest<LongInt>; + PTestLongIntLongInt = ^TTest<LongInt, LongInt>; + PTest = ^TTest; + +begin + +end. diff --git a/mips/tests/test/tint642.pp b/mips/tests/test/tint642.pp index 7beab28039..c60ab52a3b 100644 --- a/mips/tests/test/tint642.pp +++ b/mips/tests/test/tint642.pp @@ -248,6 +248,8 @@ procedure testshlshrqword; l1:=16; l2:=0; + if (q1 shl 0)<>q1 then + do_error(1499); if (q1 shl 16)<>q3 then do_error(1500); if (q1 shl 48)<>q0 then @@ -277,6 +279,8 @@ procedure testshlshrqword; if ((q1+q0) shl (l1+l2))<>q3 then do_error(1509); + if (q1 shr 0)<>q1 then + do_error(15091); if (q1 shr 16)<>q2 then do_error(1510); if (q1 shr 48)<>q0 then diff --git a/mips/tests/test/trhlp44.pp b/mips/tests/test/trhlp44.pp new file mode 100644 index 0000000000..4c4951ec3b --- /dev/null +++ b/mips/tests/test/trhlp44.pp @@ -0,0 +1,31 @@ +{ %NORUN } + +program trhlp44; + +{$mode delphi} + +type + TTest = record + + end; + + TTestHelper = record helper for TTest + procedure SayHello(const I: Integer); overload; + procedure SayHello(const S: string); overload; + end; + +procedure TTestHelper.SayHello(const I: Integer); overload; +begin + Writeln('Hello ', I); +end; + +procedure TTestHelper.SayHello(const S: string); overload; +begin + Writeln('Hello ', S); +end; + +var + Obj: TTest; +begin + Obj.SayHello('FPC'); +end. |