+ write proper rtti for large sets, resolves #12788

git-svn-id: trunk@12371 -
This commit is contained in:
florian 2008-12-16 17:18:16 +00:00
parent 6dd66f09b9
commit e213be26fd
4 changed files with 44 additions and 6 deletions

1
.gitattributes vendored
View File

@ -8654,6 +8654,7 @@ tests/webtbs/tw12614.pp svneol=native#text/plain
tests/webtbs/tw12685.pp svneol=native#text/plain
tests/webtbs/tw1269.pp svneol=native#text/plain
tests/webtbs/tw1275.pp svneol=native#text/plain
tests/webtbs/tw12788.pp svneol=native#text/plain
tests/webtbs/tw1279.pp svneol=native#text/plain
tests/webtbs/tw1283.pp svneol=native#text/plain
tests/webtbs/tw1284.pp svneol=native#text/plain

View File

@ -535,6 +535,8 @@ implementation
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(otUWord));
4:
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(otULong));
else
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(otUByte));
end;
if (tf_requires_proper_alignment in target_info.flags) then
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));

View File

@ -64,12 +64,14 @@ const
tkUString = 24;
tkUChar = 25;
otSByte = 0;
otUByte = 1;
otSWord = 2;
otUWord = 3;
otSLong = 4;
otULong = 5;
otSByte = 0;
otUByte = 1;
otSWord = 2;
otUWord = 3;
otSLong = 4;
otULong = 5;
otSLongLong = 6;
otULongLong = 7;
ftSingle = 0;
ftDouble = 1;

33
tests/webtbs/tw12788.pp Normal file
View File

@ -0,0 +1,33 @@
{$packset 1}
program t;
{$mode objfpc}{$h+}
uses typinfo;
type
tsmall = 0..11;
tsmallset = set of tsmall;
tbig = 25..200;
tbigset_ = set of tbig;
var
ti: PTypeInfo;
tdata: PTypeData;
begin
ti := typeinfo(tsmallset);
tdata := GetTypeData(ti);
writeln(ord(tdata^.OrdType));
if tdata^.CompType = typeinfo(tsmall) then
writeln('small ok')
else
halt(1);
ti := typeinfo(tbigset_);
tdata := GetTypeData(ti);
writeln(ord(tdata^.OrdType));
if tdata^.CompType = typeinfo(tbig) then
writeln('big ok')
else
halt(2);
end.