From 041f3d02221bf56313a5c78201e7ebaf916e6a3c Mon Sep 17 00:00:00 2001
From: pierre <pierre@freepascal.org>
Date: Wed, 31 Aug 2011 16:20:40 +0000
Subject: [PATCH]  Fix 20093 bug report

git-svn-id: trunk@18922 -
---
 compiler/symdef.pas     | 2 +-
 tests/webtbs/tw20093.pp | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/compiler/symdef.pas b/compiler/symdef.pas
index 82f3ac779f..850933421c 100644
--- a/compiler/symdef.pas
+++ b/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    }
diff --git a/tests/webtbs/tw20093.pp b/tests/webtbs/tw20093.pp
index b1922de127..2ad2f70b0f 100755
--- a/tests/webtbs/tw20093.pp
+++ b/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.