* handle case ranges properly for unsigned types with a non-zero base, resolves #10009

git-svn-id: trunk@8974 -
This commit is contained in:
florian 2007-10-28 17:06:02 +00:00
parent a193a1285f
commit c3475dddc0
6 changed files with 18 additions and 4 deletions

1
.gitattributes vendored
View File

@ -7598,6 +7598,7 @@ tests/webtbs/tw0961.pp svneol=native#text/plain
tests/webtbs/tw0965.pp svneol=native#text/plain
tests/webtbs/tw0966.pp svneol=native#text/plain
tests/webtbs/tw0976.pp svneol=native#text/plain
tests/webtbs/tw10009.pp svneol=native#text/plain
tests/webtbs/tw10013.pp svneol=native#text/plain
tests/webtbs/tw1021.pp svneol=native#text/plain
tests/webtbs/tw1023.pp svneol=native#text/plain

View File

@ -153,7 +153,7 @@ implementation
if first then
begin
{ have we to ajust the first value ? }
if (t^._low>get_min_value(left.resultdef)) then
if (t^._low>get_min_value(left.resultdef)) or (get_min_value(left.resultdef)<>0) then
begin
tcgarm(cg).cgsetflags:=true;
cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(int64(t^._low)), hregister);

View File

@ -174,7 +174,7 @@ implementation
if first then
begin
{ have we to ajust the first value ? }
if (t^._low>get_min_value(left.resultdef)) then
if (t^._low>get_min_value(left.resultdef)) or (get_min_value(left.resultdef)<>0) then
cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low.svalue), hregister);
end
else

View File

@ -532,7 +532,7 @@ implementation
if first then
begin
{ have we to ajust the first value ? }
if (t^._low>get_min_value(left.resultdef)) then
if (t^._low>get_min_value(left.resultdef)) or (get_min_value(left.resultdef)<>0) then
gensub(aint(t^._low.svalue));
end
else

View File

@ -199,7 +199,7 @@ implementation
if first then
begin
{ have we to ajust the first value ? }
if (t^._low>get_min_value(left.resultdef)) then
if (t^._low>get_min_value(left.resultdef)) or (get_min_value(left.resultdef)<>0) then
gensub(longint(int64(t^._low)));
end
else

13
tests/webtbs/tw10009.pp Normal file
View File

@ -0,0 +1,13 @@
var
test : 2..14;
begin
test:=14;
case test of
2..9: halt(1);
14: ;
else
halt(1);
end;
writeln('ok');
end.