From 594c8943eb210365f1bc2f5cb3895fb80ee61c54 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 4 Apr 2005 16:29:44 +0000 Subject: [PATCH] * new bugs * added $mode fpc --- tests/tbs/tb0413.pp | 2 ++ tests/tbs/tb0441.pp | 4 +++- tests/webtbs/tw0938.pp | 3 +++ tests/webtbs/tw2109.pp | 2 ++ tests/webtbs/tw2388.pp | 2 ++ tests/webtbs/tw3863.pp | 25 +++++++++++++++++++++++++ tests/webtbs/tw3864.pp | 19 +++++++++++++++++++ tests/webtbs/tw3865.pp | 20 ++++++++++++++++++++ tests/webtbs/tw3870.pp | 22 ++++++++++++++++++++++ 9 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw3863.pp create mode 100644 tests/webtbs/tw3864.pp create mode 100644 tests/webtbs/tw3865.pp create mode 100644 tests/webtbs/tw3870.pp diff --git a/tests/tbs/tb0413.pp b/tests/tbs/tb0413.pp index fc556c6872..fc8f8c7cfb 100644 --- a/tests/tbs/tb0413.pp +++ b/tests/tbs/tb0413.pp @@ -1,3 +1,5 @@ +{$mode fpc} + var s : ansistring; ss : shortstring; diff --git a/tests/tbs/tb0441.pp b/tests/tbs/tb0441.pp index cc984d9264..8320c34d11 100644 --- a/tests/tbs/tb0441.pp +++ b/tests/tbs/tb0441.pp @@ -1,8 +1,10 @@ -program Test; +{$mode fpc} + operator :=(x:LongInt)RESULT:ShortString; begin Val(RESULT,x); end; + var s:ShortString; begin diff --git a/tests/webtbs/tw0938.pp b/tests/webtbs/tw0938.pp index bb00434211..85063b0e9b 100644 --- a/tests/webtbs/tw0938.pp +++ b/tests/webtbs/tw0938.pp @@ -1,4 +1,7 @@ Program test_operator; + +{$mode fpc} + type Vector = record X,Y,Z : extended; diff --git a/tests/webtbs/tw2109.pp b/tests/webtbs/tw2109.pp index 4b8cad8a8c..79cd719518 100644 --- a/tests/webtbs/tw2109.pp +++ b/tests/webtbs/tw2109.pp @@ -3,6 +3,8 @@ { e-mail: layton@brandom.com } unit tw2109; +{$mode fpc} + interface { warning!!! -- pascal re-generates every result in an operator statement } diff --git a/tests/webtbs/tw2388.pp b/tests/webtbs/tw2388.pp index 6ef6fd75b7..7389727d3d 100644 --- a/tests/webtbs/tw2388.pp +++ b/tests/webtbs/tw2388.pp @@ -1,3 +1,5 @@ +{$mode fpc} + var err : boolean; diff --git a/tests/webtbs/tw3863.pp b/tests/webtbs/tw3863.pp new file mode 100644 index 0000000000..719620da68 --- /dev/null +++ b/tests/webtbs/tw3863.pp @@ -0,0 +1,25 @@ +{ %cpu=i386 } + +{ Source provided for Free Pascal Bug Report 3863 } +{ Submitted by "Jernej" on 2005-04-01 } +{ e-mail: jernejcoder@gmail.com } + +{$mode delphi} + +function FormatBuf(var Buffer; BufLen: Cardinal; const Format; + FmtLen: Cardinal; const Args: array of const): Cardinal; +asm +CMP EAX,Args.Integer[-4] // -> "error building record offset" +CMP [EBX+EAX*8].Byte[4],vtInteger // -> error: assembler error in operand +CMP EBX,Args.Integer[-4] // -> "error building record offset" +MOVZX EBX,[ESI].Byte[4] // -> error: assembler error in operand +JMP @CvtVector.Pointer[EBX*4] // "error: assembler syntax error" +@CvtVector: + DD 0 + DD 0 + DD 0 + DD 0 +end; + +begin +end. \ No newline at end of file diff --git a/tests/webtbs/tw3864.pp b/tests/webtbs/tw3864.pp new file mode 100644 index 0000000000..65c7f4dba0 --- /dev/null +++ b/tests/webtbs/tw3864.pp @@ -0,0 +1,19 @@ +{ Source provided for Free Pascal Bug Report 3864 } +{ Submitted by "Jernej" on 2005-04-01 } +{ e-mail: jernejcoder@gmail.com } +const + rasteriso: array[0..2] of byte = // this is WAY too big + ( + $00, $00, $00 + ); + +procedure glBitMap(const pb:pbyte);cdecl; +begin +end; + +var + i : longint; +begin + i:=0; + glBitmap(@rasteriso[(255 - i) * 16]); // Add a character to the current Display list +end. diff --git a/tests/webtbs/tw3865.pp b/tests/webtbs/tw3865.pp new file mode 100644 index 0000000000..5886a87e91 --- /dev/null +++ b/tests/webtbs/tw3865.pp @@ -0,0 +1,20 @@ +{ Source provided for Free Pascal Bug Report 3865 } +{ Submitted by "Jernej" on 2005-04-01 } +{ e-mail: jernejcoder@gmail.com } +uses + SysUtils; + +procedure wantitchars(const text: string; var wot: array of char); +begin + fillchar(wot, sizeof(wot), 0); + StrPCopy(wot, text); // FPC ERROR: incompatible type for arg no. 1: got "array of char", expected "pchar" +end; + +var + a : array[0..10] of char; +begin + wantitchars('test',a); + writeln(a); + if a<>'test' then + halt(1); +end. diff --git a/tests/webtbs/tw3870.pp b/tests/webtbs/tw3870.pp new file mode 100644 index 0000000000..a0f79590c5 --- /dev/null +++ b/tests/webtbs/tw3870.pp @@ -0,0 +1,22 @@ +{ Source provided for Free Pascal Bug Report 3870 } +{ Submitted by "Tom Verhoeff" on 2005-04-04 } +{ e-mail: T.Verhoeff@tue.nl } +program AssertFormatBug; + { Illustrates bug with using Format in Assert } + +{$assertions on} + +uses + SysUtils { for IntToStr, Format }; + +begin + try + Assert(False, IntToStr(2)); { incorrectly raises EAccessViolation } + except + on E: EAssertionFailed do + begin + Writeln('Caught Assert: ',E.Message); + end; + end; +end. +