From 0e57fc0f34526fe6140b68adfdcfb4575fe7823e Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 3 Jun 1999 10:28:26 +0000 Subject: [PATCH] + bug256-258 --- tests/tbs0215.pp | 1 - tests/tbs0220.pp | 14 ++++++++++++++ tests/tbs0221.pp | 13 +++++++++++++ tests/tbs0256.pp | 13 +++++++++++++ tests/tbs0257.pp | 18 ++++++++++++++++++ tests/tbs0258.pp | 43 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 tests/tbs0220.pp create mode 100644 tests/tbs0221.pp create mode 100644 tests/tbs0256.pp create mode 100644 tests/tbs0257.pp create mode 100644 tests/tbs0258.pp diff --git a/tests/tbs0215.pp b/tests/tbs0215.pp index d03354b69c..452ef549e4 100644 --- a/tests/tbs0215.pp +++ b/tests/tbs0215.pp @@ -18,7 +18,6 @@ Type Procedure VirtualMethod; virtual; End; - Constructor Y.Init(NewA:LongInt); Begin A:=NewA; diff --git a/tests/tbs0220.pp b/tests/tbs0220.pp new file mode 100644 index 0000000000..8f780e31ce --- /dev/null +++ b/tests/tbs0220.pp @@ -0,0 +1,14 @@ +type + a = array[0..100] of char; + +var + a1 : a; + s : string; +begin + a1[0]:='1';a1[2]:='2';a1[3]:='3'; + a1[4]:='4';a1[5]:='5';a1[6]:='6'; + a1[7]:='7';a1[8]:='8';a1[9]:='9'; + a1[10]:='0';a1[11]:='1'; + s:=Copy(a1,1,10); + if s<>'1234567890' then halt(1); +end. diff --git a/tests/tbs0221.pp b/tests/tbs0221.pp new file mode 100644 index 0000000000..5a466246f4 --- /dev/null +++ b/tests/tbs0221.pp @@ -0,0 +1,13 @@ + +var + r : double; + c : char; +begin + r:=1.; + c:=^.; { this compile in tp7, c should contain 'n'/#110 } + if c<>#110 then + begin + Writeln('FPC does not support ^. character!'); + Halt(1); + end; +end. diff --git a/tests/tbs0256.pp b/tests/tbs0256.pp new file mode 100644 index 0000000000..1ee2882082 --- /dev/null +++ b/tests/tbs0256.pp @@ -0,0 +1,13 @@ +{$mode tp} + +{$undef dummy } + +{$ifdef dummy} + procedure test; + begin + foreach({$ifndef TP}@{$endif}add_to_browserlog); + end; +{$endif BrowserLog} + +begin +end. diff --git a/tests/tbs0257.pp b/tests/tbs0257.pp new file mode 100644 index 0000000000..96f0303036 --- /dev/null +++ b/tests/tbs0257.pp @@ -0,0 +1,18 @@ +{$mode tp} + +type proc = procedure(a : longint); +procedure test(b : longint); +begin + Writeln('Test ',b); +end; + +var + t : proc; + +begin + t:=test; + t:=proc(test); + test(3); + t(5); +end. + diff --git a/tests/tbs0258.pp b/tests/tbs0258.pp new file mode 100644 index 0000000000..d30970d48a --- /dev/null +++ b/tests/tbs0258.pp @@ -0,0 +1,43 @@ +program test_set; + +var error : boolean; + + +procedure test; + + var + i : longint; + x : array [1..32] of byte; + + begin + error:=false; + for i:=1 to 32 do x[i]:=$ff; + i:=1; + if i in [1,3,5,8,11,14,15] then + writeln('1 is in [1,3,5,8,11,14,15]') + else + writeln('Error in set'); + i:=135; + if i in [1,3,5,8,11,14,15] then + begin + writeln('Error : 135 is in [1,3,5,8,11,14,15]'); + error:=true; + end; + for i:=1 to 32 do x[i]:=0; + i:=135; + if i in [1,3,5,8,11,14,15] then + begin + writeln('Second try Error : 135 is in [1,3,5,8,11,14,15]') + error:=true; + end + else + begin + if error then + writeln('Result of 135 in [1,3,5,8,11,14,15] depends on x array !!'); + end; + end; + +begin + test; + if error then halt(1); +end.