Browse Source

+ extended test to test main program as well

git-svn-id: trunk@11009 -
florian 17 years ago
parent
commit
605582a3ed
1 changed files with 19 additions and 2 deletions
  1. 19 2
      tests/test/tlib1.pp

+ 19 - 2
tests/test/tlib1.pp

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