@@ -0,0 +1,19 @@
+{ %opt=-Sew }
+
+{$mode objfpc}{$H+}
+function A: boolean;
+ procedure CheckResult;
+ begin
+ if not Result then writeln('Oha');
+ end;
+begin
+ Result:=false;
+ CheckResult;
+end;
+ A;
+end.
@@ -0,0 +1,26 @@
+{ %cpu=i386 }
+{$ifdef fpc}
+{$MODE DELPHI}
+{$ASMMODE INTEL}
+{$endif}
+const myoffset=10;
+var
+ r : array[0..19] of char;
+ c : char;
+ r:='01234567890123456789';
+ asm
+ lea eax,r
+ mov al,[eax].myoffset
+ mov c,al
+ writeln(c);
+ if c<>'0' then
+ writeln('ERROR!');
+ halt(1);
@@ -0,0 +1,10 @@
+{ %fail }
+procedure proc_value_smallset(smallset : set of tsmallset);
+ if [A_A,A_D] in smallset then
+ global_u8bit := RESULT_U8BIT;
@@ -0,0 +1,20 @@
+{ %ver=1.1 }
+{$mode objfpc}
+type
+ TFlowItem = class
+ text: string; //replace with "shortstring" and the crash goes away
+ TFlow = array of TFlowItem;
+ flow: tflow;
+ setlength(flow, 10);
+ setlength(flow, 1);
+ { release }
+ setlength(flow, 0);
+ writeln('no crash');
@@ -0,0 +1,11 @@
+var x : array[1..1000] of double;
+ z : array[1..100] of double absolute x;
+ z[10]:=10.0;
+ if x[10]<>10.0 then
@@ -0,0 +1,56 @@
+ TObj = object
+ constructor Init0;
+ constructor Init;
+ procedure Show;
+ function GetStr:string; virtual;
+ destructor Done;
+ TChild = object (TObj)
+ Err : boolean;
+constructor TObj.Init0;
+constructor TObj.Init;
+ Init0;
+function TObj.GetStr:string;
+ GetStr:='Bad';
+ Err:=true;
+procedure TObj.Show;
+ writeln(GetStr);
+destructor TObj.Done;
+function TChild.GetStr:string;
+ GetStr:='Good'
+ Obj:TChild;
+ Obj.Init;
+ Obj.Show;
+ Obj.Done;
+ if Err then
@@ -0,0 +1,13 @@
+uses SysUtils;
+ s : string;
+ s:=formatdatetime ('hh:nn:ss.zzz', encodetime (12, 30, 44, 4));
+ writeln(s);
+ if s<>'12:30:44.004' then
@@ -0,0 +1,6 @@
+{ Default extension .pp and .pas should be searched }
+{$i ub1883}
@@ -0,0 +1,46 @@
+program dumpprops;
+ {$mode objfpc}
+uses
+ Classes, TypInfo;
+ TBaseTest = class(TPersistent)
+ private
+ FCaption: String;
+ FNext: Integer;
+ protected
+ public
+ property Caption: String read FCaption write FCaption;
+ published
+ property Next: Integer read FNext write FNext;
+ TTest = class(TBaseTest)
+ FNext2: Integer;
+ property Caption;
+ property Next2: Integer read FNext2 write FNext2;
+ p : PPropInfo;
+ t : TTest;
+ t:=TTest.Create;
+ p:=GetPropInfo(t,'Next');
+ if (p<>nil) and
+ (p^.name='Next') then
+ writeln('Success')
+ else
@@ -0,0 +1,12 @@
+ t,t1:int64;
+ tsclo,tschi:cardinal;
+ f:int64;
+ tschi:=1;
+ tsclo:=0;
+ f:=1;
+ t1:=2;
+ t:=1;
+ writeln(((Int64(tscHi) shl 32 + tscLo) / ((T1-T) / F)));
@@ -0,0 +1,24 @@
+ value:real;
+ fin:text;
+ assign(fin,'tw1896.tmp');
+ rewrite(fin);
+ writeln(fin,'12.3');
+ writeln(fin,'13.2');
+ close(fin);
+ reset(fin);
+ while not eof(fin) do
+ read(fin,value);
+ writeln(value)
+ { Delphi returns 0 as last value }
+ if value<>0 then
+ writeln('Error');
@@ -0,0 +1,32 @@
+{ %version=1.1 }
+const Inf=1/0;
+ NaN=0/0;
+ MinusInf=-Inf;
+ error : boolean;
+ error:=false;
+ str(Inf,s);
+ writeln('Inf: "',s,'"');
+ if s<>' +Inf' then
+ error:=true;
+ str(NaN,s);
+ writeln('Nan: "',s,'"');
+ if s<>' Nan' then
+ str(MinusInf,s);
+ writeln('MinusInf: "',s,'"');
+ if s<>' -Inf' then
+ if error then
@@ -0,0 +1,25 @@
+{$R+}
+procedure x(arr : array of byte);
+ try
+ if arr[12] <> $55 then
+ WriteLn('Error! No Rangecheck error detected');
+ Halt(1);
+ except
+ on e : exception do
+ Writeln(e.message);
+ arr : array[1..12] of byte;
+ arr[12] := $55;
+ x(arr);
@@ -0,0 +1,22 @@
+ x,y,z : real;
+ x:=5.75;
+ y:=5.75;
+ z:=6;
+ z:=z/ln(x/y);
+ WriteLn('Error! No runtime error detected');
+ Writeln('z = ',z);
+ Writeln('Correct, found error: ',e.message);