fpc/tests/test/tlibrary1.pp
Jonas Maebe 1b58fcc877 * set moduleislib to true for libraries. Differences with islibrary:
a) is also set to true for packages (when packages will beimplemented)
     b) exists for each package/library/application separately, instead of
        being stored in the package containing the system unit (when packages
        will be implemented)
    (mantis #15701)

git-svn-id: trunk@14880 -
2010-02-10 16:10:23 +00:00

60 lines
850 B
ObjectPascal

{ %NORUN }
{ %SKIPTARGET=macos }
{$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;
const
publicname='TestName';
publicindex = 1234;
procedure Test;export;
begin
if not islibrary then
halt(1);
if not moduleislib then
halt(2);
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}