mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-24 19:03:24 +01:00
* test runtime loading of library
This commit is contained in:
parent
a2a1a36e83
commit
9875ffa598
@ -1,5 +1,9 @@
|
|||||||
|
{ %OPT=-FE. }
|
||||||
{ %NORUN }
|
{ %NORUN }
|
||||||
|
|
||||||
|
{ The .so of the library needs to be in the current dir when
|
||||||
|
testing the loading at runtime }
|
||||||
|
|
||||||
{$ifdef win32}
|
{$ifdef win32}
|
||||||
{$define supported}
|
{$define supported}
|
||||||
{$define supportidx}
|
{$define supportidx}
|
||||||
@ -7,6 +11,9 @@
|
|||||||
{$ifdef Unix}
|
{$ifdef Unix}
|
||||||
{$define supported}
|
{$define supported}
|
||||||
{$endif Unix}
|
{$endif Unix}
|
||||||
|
{$ifndef fpc}
|
||||||
|
{$define supported}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{$ifdef supported}
|
{$ifdef supported}
|
||||||
|
|
||||||
@ -19,6 +26,7 @@ const
|
|||||||
procedure Test;export;
|
procedure Test;export;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
writeln('Hoi');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
exports
|
exports
|
||||||
|
|||||||
22
tests/test/tlibrary2.pp
Normal file
22
tests/test/tlibrary2.pp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{ %NEEDLIBRARY }
|
||||||
|
|
||||||
|
{ Test program to test linking to fpc library }
|
||||||
|
|
||||||
|
{$ifdef win32}
|
||||||
|
{$define supported}
|
||||||
|
{$endif win32}
|
||||||
|
{$ifdef Unix}
|
||||||
|
{$define supported}
|
||||||
|
{$endif Unix}
|
||||||
|
{$ifndef fpc}
|
||||||
|
{$define supported}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$ifdef supported}
|
||||||
|
|
||||||
|
procedure test;external 'libtlibrary.so' name 'TestName';
|
||||||
|
|
||||||
|
begin
|
||||||
|
test;
|
||||||
|
end.
|
||||||
|
{$endif supported}
|
||||||
Loading…
Reference in New Issue
Block a user