Jelajahi Sumber

* bugs from mailinglist

peter 25 tahun lalu
induk
melakukan
2e0ef2edb7
3 mengubah file dengan 45 tambahan dan 0 penghapusan
  1. 16 0
      tests/tbs/tbs0333.pp
  2. 22 0
      tests/tbs/tbs0334.pp
  3. 7 0
      tests/tbs/tbs0335.pp

+ 16 - 0
tests/tbs/tbs0333.pp

@@ -0,0 +1,16 @@
+var
+  a,b : comp;
+  s1,s2 : string;
+begin
+  a:=11384563;
+  b:=a*a;
+  str(a*a:0:0,s1);
+  str(b:0:0,s2);
+  writeln(s1);
+  writeln(s2);
+  if (s1<>'129608274700969') or (s2<>'129608274700969') then
+   begin
+     writeln('Error with comp type rounding');
+     halt(1);
+   end;
+end.

+ 22 - 0
tests/tbs/tbs0334.pp

@@ -0,0 +1,22 @@
+{$ifdef fpc}{$mode objfpc}{$endif}
+
+type
+  tvarrec=record
+    vpointer : pointer;
+  end;
+var
+  r : tvarrec;
+  b : boolean;
+function Next: TVarRec;
+begin
+  next:=r;
+end;
+
+begin
+  r.vpointer:=@b;
+  { The result of next is loaded and a value is assigned }
+  with Next do
+   boolean(VPointer^) := true;
+  if not b then
+   writeln('Error with assigning to function result');
+end.

+ 7 - 0
tests/tbs/tbs0335.pp

@@ -0,0 +1,7 @@
+{$mode delphi}
+procedure f;stdcall export;
+asm
+end;
+
+begin
+end.