fpc/tests/test/tweaklib3.pp
Jonas Maebe a23630260b + "weakexternal" support for imported procedures and variables.
the syntax is exactly the same as for "external", except for
    the keyword. It is currently only active for Darwin targets.
    It should also work at least for Linux targets, but only with
    the GNU assembler (which is why it is not activated there)
  + test for this functionality

git-svn-id: trunk@12009 -
2008-11-01 18:38:32 +00:00

25 lines
305 B
ObjectPascal

{ %norun }
{ %target=darwin }
{ %opt=-olibtweaklib1.dylib }
{$PIC+}
library tweaklib;
var
_myvar: cardinal; export name '_MYVAR';
function _test: cardinal;
begin
writeln('this is a test');
_test:=$facef00d;
_myvar:=$12345678;
end;
exports
_test name '_TEST',
_myvar name '_MYVAR';
end.