mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 11:08:02 +02:00
* make integer division instruction (div/idiv) on x86 dependent on the
resulttype of the div node set by the type checking pass, this is also how the generic code generator handles it, resolves #27173 git-svn-id: trunk@29382 -
This commit is contained in:
parent
3cdf2d0e53
commit
29d4037a9c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14173,6 +14173,7 @@ tests/webtbs/tw2710.pp svneol=native#text/plain
|
||||
tests/webtbs/tw27120.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2713.pp svneol=native#text/plain
|
||||
tests/webtbs/tw27153.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw27173.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw27185.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2721.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2723.pp svneol=native#text/plain
|
||||
|
@ -527,8 +527,8 @@ interface
|
||||
else
|
||||
emit_reg_reg(A_XOR,opsize,regd,regd);
|
||||
|
||||
{Division depends on the right type.}
|
||||
if is_signed(right.resultdef) then
|
||||
{ Division depends on the result type }
|
||||
if is_signed(resultdef) then
|
||||
op:=A_IDIV
|
||||
else
|
||||
op:=A_DIV;
|
||||
|
16
tests/webtbs/tw27173.pp
Normal file
16
tests/webtbs/tw27173.pp
Normal file
@ -0,0 +1,16 @@
|
||||
program error;
|
||||
|
||||
{$mode Delphi}
|
||||
|
||||
uses sysutils;
|
||||
|
||||
type a = 1..MaxInt;
|
||||
|
||||
var b: a;
|
||||
c: integer;
|
||||
|
||||
begin
|
||||
b := 3;
|
||||
c := -5 div b;
|
||||
writeln(c);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user