summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw16263b.pp
blob: c3404a593a75d428d0383b40bc7cafca40d306e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ %target=darwin,linux,freebsd,solaris,beos,haiku }
{ %NEEDLIBRARY }

{$mode delphi}
program MainApp;

uses
  dynlibs,
  Math;

const
{$ifdef windows}
  libname='tw16263a.dll';
{$else}
  {$ifdef darwin}
  libname = './libtw16263a.dylib';
  {$else darwin}
  libname = './libtw16263a.so';
  {$endif darwin}
{$endif}

var
  hdl: TLibHandle; 
begin
  // the library will perform a div-by-zero in its init code
  setexceptionmask([exZeroDivide]);
  hdl := loadlibrary(libname);
  if (hdl=nilhandle) then
    halt(1);
  unloadlibrary(hdl);
end.