blob: 88fbe202f53a6d87202c9c69d902c02e9cf9c6da (
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
32
33
34
35
36
37
38
39
40
|
{ %skiptarget=$nosharedlib }
{ %NEEDLIBRARY }
{ %delfiles=tlibrary1 }
{ Test program to test linking to fpc library }
{$ifdef mswindows}
{$define supported}
{$endif mswindows}
{$ifdef Unix}
{$define supported}
{$endif Unix}
{$ifndef fpc}
{$define supported}
{$endif}
{$ifdef supported}
const
{$ifdef windows}
libname='tlibrary1.dll';
{$else}
libname='tlibrary1';
{$linklib tlibrary1}
{$endif}
procedure test;external libname name 'TestName';
begin
if islibrary then
halt(3);
if moduleislib then
halt(4);
test;
end.
{$else not supported}
begin
Writeln('Dummy test because target does not support libraries');
end.
{$endif not supported}
|