summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/tlibrary3.pp
blob: 4291e9d11a06ee18bd1975dd860c4716f51a9173 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ %NORUN }
{ %SKIPTARGET=macos, go32v2, win64 }

{$ifdef darwin}
{$PIC+}
{$endif darwin}

{$ifdef CPUX86_64}
{$ifndef WINDOWS}
{$PIC+}
{$endif WINDOWS}
{$endif CPUX86_64}

{ The .so of the library needs to be in the current dir when
  testing the loading at runtime }

{$ifdef mswindows}
 {$define supported}
 {$define supportidx}
{$endif win32}
{$ifdef Unix}
 {$define supported}
{$endif Unix}
{$ifndef fpc}
   {$define supported}
{$endif}

{$ifdef supported}

library bug;

uses
  initc;

const
   publicname='TestName';
   publicindex = 1234;

procedure Test;export;

 begin
//   writeln('Hoi');
 end;

exports
  Test name publicname;
{$ifdef supportidx}
exports
  Test index publicindex;
{$endif}

begin
end.
{$else supported}
begin
  Writeln('No library for that target');
end.
{$endif supported}