Browse Source

* new bugs

peter 20 years ago
parent
commit
e6d31875f2
5 changed files with 108 additions and 0 deletions
  1. 17 0
      tests/webtbs/tw3402.pp
  2. 21 0
      tests/webtbs/tw3443.pp
  3. 13 0
      tests/webtbs/tw3444.pp
  4. 18 0
      tests/webtbs/tw3534.pp
  5. 39 0
      tests/webtbs/tw3564.pp

+ 17 - 0
tests/webtbs/tw3402.pp

@@ -0,0 +1,17 @@
+{ %opt=-Cg }
+
+{ Source provided for Free Pascal Bug Report 3402 }
+{ Submitted by "Layton Davis" on  2004-11-26 }
+{ e-mail: [email protected] }
+library test;
+
+var
+  tic : integer;
+
+procedure SetTic(num:integer);
+begin
+  tic := num;
+end;
+
+begin
+end.

+ 21 - 0
tests/webtbs/tw3443.pp

@@ -0,0 +1,21 @@
+{ Source provided for Free Pascal Bug Report 3443 }
+{ Submitted by "Alexey Barkovoy" on  2004-12-08 }
+{ e-mail: [email protected] }
+
+{$mode delphi}
+
+uses SysUtils;
+
+procedure Test1(c: PChar; w: PWideChar);
+begin
+  if c <> Pointer(w) then Exit; // Do something
+end;
+
+begin
+  Test1(nil, nil);
+  Test1('SS', 'WW');
+  Test1(PChar('a'+'b'), PWideChar('a' + 'b')); //  Delphi can't compile this
+  Test1(@((AnsiString('xxx ' + IntToStr(1) + #10))[1]),
+        @((WideString('xxx ' + IntToStr(1) + #10))[1])); // FPC: "Error: Variable identifier expected"
+// Delphi CAN compile line above
+end.

+ 13 - 0
tests/webtbs/tw3444.pp

@@ -0,0 +1,13 @@
+{ %cpu=i386 }
+
+{ Source provided for Free Pascal Bug Report 3444 }
+{ Submitted by "Arnstein" on  2004-12-09 }
+{ e-mail: [email protected] }
+{$asmmode intel}
+program tmp;
+begin
+  asm
+    fstp st(1 );
+{------------^ NB space}
+  end;
+end.

+ 18 - 0
tests/webtbs/tw3534.pp

@@ -0,0 +1,18 @@
+{ Source provided for Free Pascal Bug Report 3534 }
+{ Submitted by "Mattias Gaertner" on  2005-01-08 }
+{ e-mail: [email protected] }
+program IntToStrSmallIntBug;
+
+{$mode objfpc}{$H+}
+
+uses
+  SysUtils;
+
+var
+  i: SmallInt;
+begin
+  i:=-3;
+  writeln(IntToStr(i));
+  if IntToStr(i)<>'-3' then
+    halt(1);
+end.

+ 39 - 0
tests/webtbs/tw3564.pp

@@ -0,0 +1,39 @@
+{ Source provided for Free Pascal Bug Report 3564 }
+{ Submitted by "Patrick Dietrich" on  2005-01-17 }
+{ e-mail: [email protected] }
+
+{$mode delphi}
+
+type
+   StringArray = array of string;
+
+   TestClass = class(TObject)
+   public
+      FArr : StringArray;
+      function getArr: StringArray;
+      function getCopy: StringArray;
+      constructor create;
+      property arr : StringArray read getArr;
+   end;
+
+function TestClass.getArr: StringArray;
+begin
+   result := self.FArr;
+end;
+
+function TestClass.getCopy: StringArray;
+begin
+   Result := Copy(arr, 0, Length(arr)-1);
+end; { getCopy }
+
+constructor TestClass.create;
+begin
+   setLength( Farr, 3);
+
+   Farr[0] := 'one';
+   Farr[1] := 'two';
+   Farr[2] := 'three';
+end;
+
+begin
+end.