fpc/tests/test/texception11.pp
svenbarth 2b3edb2c53 * in the default exception handler add the captured exception to the exception object stack as well
+ added test (needs to work with any exception handling mechanism; currently tested with SetJmp/LongJmp, SEH 32-bit and SEH 64-bit based exception handling)

git-svn-id: trunk@49486 -
2021-06-06 17:06:24 +00:00

26 lines
412 B
ObjectPascal

program texception11;
{$mode objfpc}
uses
SysUtils;
type
ETest = class(Exception);
procedure TestExcept(Obj : TObject; Addr : CodePointer; FrameCount:Longint; Frame: PCodePointer);
begin
if not (Obj is ETest) then
Halt(1);
if not (ExceptObject is ETest) then
Halt(2);
{ explicitely halt with exit code 0 }
Halt(0);
end;
begin
ExceptProc := @TestExcept;
raise ETest.Create('');
end.