mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 18:29:33 +02:00
* finally it works on linux also from the testsuite script
git-svn-id: trunk@11012 -
This commit is contained in:
parent
38df5b4eae
commit
4dfd59a6f8
@ -1,12 +1,13 @@
|
|||||||
{ %opt=-gl }
|
{ %opt=-gl -O- }
|
||||||
{ %needlibrary }
|
{ %needlibrary }
|
||||||
{$goto on}
|
{$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}
|
{$ifdef unix}
|
||||||
uses
|
uses
|
||||||
dl;
|
dl,sysutils;
|
||||||
{$endif unix}
|
{$endif unix}
|
||||||
|
|
||||||
procedure p(var a : pointer);external 'tlib1a' name 'p';
|
procedure p(var a : pointer);external 'tlib1a' name 'p';
|
||||||
@ -22,6 +23,7 @@ w:
|
|||||||
{ library }
|
{ library }
|
||||||
p(a);
|
p(a);
|
||||||
GetLineInfo(PtrUInt(a),s1,s2,l);
|
GetLineInfo(PtrUInt(a),s1,s2,l);
|
||||||
|
s2:=ExtractFilename(s2);
|
||||||
writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
|
writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
|
||||||
{ GetLineInfo of dwarf doesn't return the function name }
|
{ GetLineInfo of dwarf doesn't return the function name }
|
||||||
if { (s1<>'P') or } (s2<>'tlib1a.pp') or (l<>9) then
|
if { (s1<>'P') or } (s2<>'tlib1a.pp') or (l<>9) then
|
||||||
@ -29,9 +31,10 @@ w:
|
|||||||
|
|
||||||
{ main program }
|
{ main program }
|
||||||
GetLineInfo(PtrUInt(@w),s1,s2,l);
|
GetLineInfo(PtrUInt(@w),s1,s2,l);
|
||||||
|
s2:=ExtractFilename(s2);
|
||||||
writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
|
writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
|
||||||
{ GetLineInfo of dwarf doesn't return the function name }
|
{ 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);
|
halt(1);
|
||||||
|
|
||||||
writeln('ok');
|
writeln('ok');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
{ %opt=-gl -O- }
|
||||||
{ %norun }
|
{ %norun }
|
||||||
{ %opt=-gl }
|
|
||||||
{$goto on}
|
{$goto on}
|
||||||
library tlib1a;
|
library tlib1a;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user