mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:06:14 +02:00
* handle case ranges properly for unsigned types with a non-zero base, resolves #10009
git-svn-id: trunk@8974 -
This commit is contained in:
parent
a193a1285f
commit
c3475dddc0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7598,6 +7598,7 @@ tests/webtbs/tw0961.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw0965.pp svneol=native#text/plain
|
tests/webtbs/tw0965.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw0966.pp svneol=native#text/plain
|
tests/webtbs/tw0966.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw0976.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/tw10013.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1021.pp svneol=native#text/plain
|
tests/webtbs/tw1021.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1023.pp svneol=native#text/plain
|
tests/webtbs/tw1023.pp svneol=native#text/plain
|
||||||
|
@ -153,7 +153,7 @@ implementation
|
|||||||
if first then
|
if first then
|
||||||
begin
|
begin
|
||||||
{ have we to ajust the first value ? }
|
{ 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
|
begin
|
||||||
tcgarm(cg).cgsetflags:=true;
|
tcgarm(cg).cgsetflags:=true;
|
||||||
cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(int64(t^._low)), hregister);
|
cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(int64(t^._low)), hregister);
|
||||||
|
@ -174,7 +174,7 @@ implementation
|
|||||||
if first then
|
if first then
|
||||||
begin
|
begin
|
||||||
{ have we to ajust the first value ? }
|
{ 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);
|
cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low.svalue), hregister);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -532,7 +532,7 @@ implementation
|
|||||||
if first then
|
if first then
|
||||||
begin
|
begin
|
||||||
{ have we to ajust the first value ? }
|
{ 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));
|
gensub(aint(t^._low.svalue));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -199,7 +199,7 @@ implementation
|
|||||||
if first then
|
if first then
|
||||||
begin
|
begin
|
||||||
{ have we to ajust the first value ? }
|
{ 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)));
|
gensub(longint(int64(t^._low)));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
13
tests/webtbs/tw10009.pp
Normal file
13
tests/webtbs/tw10009.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user