Browse Source

Fix 20093 bug report

git-svn-id: trunk@18922 -
pierre 14 years ago
parent
commit
041f3d0222
2 changed files with 9 additions and 1 deletions
  1. 1 1
      compiler/symdef.pas
  2. 8 0
      tests/webtbs/tw20093.pp

+ 1 - 1
compiler/symdef.pas

@@ -930,7 +930,7 @@ implementation
         if prefix<>'' then
           result:=result+'_'+prefix;
         if suffix<>'' then
-          result:=result+'_'+suffix;
+          result:=result+'_$'+suffix;
         { the Darwin assembler assumes that all symbols starting with 'L' are local }
         { Further, the Mac OS X 10.5 linker does not consider symbols which do not  }
         { start with '_' as regular symbols (it does not generate N_GSYM entries    }

+ 8 - 0
tests/webtbs/tw20093.pp

@@ -8,6 +8,9 @@
 { Use same name as unit to test also
   possible confusion there }
 
+{ Test should not fail anymore after this change
+  dated 2011-08-31 PM }
+
 {$mode objfpc}
 
 program vmt_uvmt;
@@ -15,6 +18,7 @@ program vmt_uvmt;
 uses
   uvmt, uvmt_a;
 
+{$ifndef VAR_ONLY}
 type
   tclass = class(tobject)
   end;
@@ -26,6 +30,8 @@ var
   a2 : uvmt.a_tclass;
   a3 : tclass;
   a4 : a_tclass;
+{$endif ndef VAR_ONLY}
+var
   t : longint;
 begin
   t:=6;
@@ -40,6 +46,7 @@ begin
         Writeln('Both variables are at same address');
       halt(1);
     end;
+{$ifndef VAR_ONLY}
   a1 := uvmt_a.tclass.create;
   a2 := uvmt.a_tclass.create;
   a3 := tclass.create;
@@ -48,4 +55,5 @@ begin
   a2.destroy;
   a3.destroy;
   a4.destroy;
+{$endif ndef VAR_ONLY}
 end.