mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 04:28:00 +02:00
48 lines
616 B
ObjectPascal
48 lines
616 B
ObjectPascal
{%skiptarget=$nothread }
|
|
{ %opt=-CN }
|
|
|
|
{ the -CN is to generated null pointer load checks for AIX,
|
|
ignored on other platforms because there the OS performs
|
|
this checking for you }
|
|
|
|
{$mode objfpc}
|
|
|
|
uses
|
|
{$ifdef unix}
|
|
cthreads,
|
|
{$endif}
|
|
SysUtils, Classes;
|
|
|
|
type
|
|
tc = class(tthread)
|
|
procedure execute; override;
|
|
end;
|
|
|
|
var
|
|
caught: boolean;
|
|
|
|
procedure tc.execute;
|
|
type
|
|
plongint = ^longint;
|
|
var
|
|
p: plongint;
|
|
begin
|
|
p:=nil;
|
|
try
|
|
writeln(p^);
|
|
except
|
|
caught:=true;
|
|
end;
|
|
end;
|
|
|
|
var
|
|
c: tc;
|
|
begin
|
|
caught:=false;
|
|
c:=tc.create(false);
|
|
c.waitfor;
|
|
c.free;
|
|
halt(ord(not caught));
|
|
end.
|
|
|