+ extended test to test main program as well

git-svn-id: trunk@11009 -
This commit is contained in:
florian 2008-05-18 18:41:08 +00:00
parent 4f7a6bb637
commit 605582a3ed

View File

@ -1,4 +1,8 @@
{ %opt=-gl } { %opt=-gl }
{$goto on}
{ test lineinfo in libraries }
{$ifdef unix} {$ifdef unix}
uses uses
dl; dl;
@ -10,11 +14,24 @@ var
s1,s2 : string; s1,s2 : string;
l : longint; l : longint;
a : pointer; a : pointer;
label
w;
begin begin
w:
{ library }
p(a); p(a);
GetLineInfo(PtrUInt(a),s1,s2,l); GetLineInfo(PtrUInt(a),s1,s2,l);
writeln('Func: ',s1,' Source: ',s2,' Line: ',l); writeln({ 'Func: ',s1,'} 'Source: ',s2,' Line: ',l);
if (s1<>'P') or (s2<>'tlib1a.pp') or (l<>9) then { GetLineInfo of dwarf doesn't return the function name }
if { (s1<>'P') or } (s2<>'tlib1a.pp') or (l<>9) then
halt(1); halt(1);
{ main program }
GetLineInfo(PtrUInt(@w),s1,s2,l);
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<>19) then
halt(1);
writeln('ok'); writeln('ok');
end. end.