|
@@ -1,12 +1,13 @@
|
|
|
-{ %opt=-gl }
|
|
|
+{ %opt=-gl -O- }
|
|
|
{ %needlibrary }
|
|
|
{$goto on}
|
|
|
|
|
|
-{ test lineinfo in libraries }
|
|
|
+{ test lineinfo in libraries, to get always proper results, the optimizer
|
|
|
+ must be turned off with -O- }
|
|
|
|
|
|
{$ifdef unix}
|
|
|
uses
|
|
|
- dl;
|
|
|
+ dl,sysutils;
|
|
|
{$endif unix}
|
|
|
|
|
|
procedure p(var a : pointer);external 'tlib1a' name 'p';
|
|
@@ -22,6 +23,7 @@ w:
|
|
|
{ library }
|
|
|
p(a);
|
|
|
GetLineInfo(PtrUInt(a),s1,s2,l);
|
|
|
+ s2:=ExtractFilename(s2);
|
|
|
writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
|
|
|
{ GetLineInfo of dwarf doesn't return the function name }
|
|
|
if { (s1<>'P') or } (s2<>'tlib1a.pp') or (l<>9) then
|
|
@@ -29,9 +31,10 @@ w:
|
|
|
|
|
|
{ main program }
|
|
|
GetLineInfo(PtrUInt(@w),s1,s2,l);
|
|
|
+ s2:=ExtractFilename(s2);
|
|
|
writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
|
|
|
{ GetLineInfo of dwarf doesn't return the function name }
|
|
|
- if { (s1<>'P') or } (s2<>'tlib1.pp') or (l<>20) then
|
|
|
+ if { (s1<>'P') or } (s2<>'tlib1.pp') or (l<>21) then
|
|
|
halt(1);
|
|
|
|
|
|
writeln('ok');
|