* perform -CTlowercaseprocstart conversion it tprocsym.create rather than

when building the mangled name, because the latter can also be performed
    when compiler another unit (and therefore if that other unit's setting
    is different from that of the original unit, a wrong mangled name was
    generated) + test for this case

git-svn-id: trunk@25388 -
This commit is contained in:
Jonas Maebe 2013-08-29 22:43:06 +00:00
parent a14ceba791
commit fcaad5baf2
4 changed files with 46 additions and 3 deletions

1
.gitattributes vendored
View File

@ -10639,6 +10639,7 @@ tests/test/jvm/tint.pp svneol=native#text/plain
tests/test/jvm/tintstr.pp svneol=native#text/plain
tests/test/jvm/tjavalowercaseproc.java svneol=native#text/plain
tests/test/jvm/tjsetter.java svneol=native#text/plain
tests/test/jvm/tlowercaseproc.pp svneol=native#text/plain
tests/test/jvm/tnestdynarr.pp svneol=native#text/plain
tests/test/jvm/tnestedset.pp svneol=native#text/plain
tests/test/jvm/tnestproc.pp svneol=native#text/plain

View File

@ -5271,8 +5271,6 @@ implementation
tmpresult:='$'+tprocdef(owner.defowner).procsym.realname+'$'+tostr(tprocdef(owner.defowner).procsym.symid)+'$'+tmpresult;
container:=container.defowner.owner;
end;
if ts_lowercase_proc_start in current_settings.targetswitches then
tmpresult[1]:=lower(tmpresult[1]);
end;
end
else

View File

@ -614,7 +614,11 @@ implementation
constructor tprocsym.create(const n : string);
begin
inherited create(procsym,n);
if not(ts_lowercase_proc_start in current_settings.targetswitches) or
(n='') then
inherited create(procsym,n)
else
inherited create(procsym,lowercase(n[1])+copy(n,2,length(n)-1));
FProcdefList:=TFPObjectList.Create(false);
FProcdefderefList:=nil;
{ the tprocdef have their own symoptions, make the procsym

View File

@ -0,0 +1,40 @@
{$namespace org.freepascal.test.lcproc}
unit tlowercaseproc;
{$mode delphi}
{$targetswitch lowercaseprocstart}
interface
procedure DoIt;
type
tc = class
procedure MethodName;
class procedure ClassMethodName; static;
end;
implementation
procedure DoIt;
var
a: ansistringclass;
begin
{ this routine is declared with uppercase C at the start in the system unit,
check that we don't lowercase this one as well }
a:=AnsistringClass(AnsistringClass.CreateFromLiteralStringBytes('abcdef',DefaultSystemCodePage));
end;
procedure tc.MethodName;
begin
doit;
classmethodname;
end;
class procedure tc.ClassMethodName; static;
begin
doit;
end;
end.