mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:29:14 +02:00
* arithmetic overflow checking at compile time
This commit is contained in:
parent
186a03feb1
commit
ec433f758a
10
tests/tbf/tb0171.pp
Normal file
10
tests/tbf/tb0171.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
const
|
||||||
|
c1 = high(int64)-1;
|
||||||
|
{ Overflow }
|
||||||
|
c2 = c1+2;
|
||||||
|
begin
|
||||||
|
writeln(c2);
|
||||||
|
end.
|
||||||
|
|
10
tests/tbf/tb0172.pp
Normal file
10
tests/tbf/tb0172.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
const
|
||||||
|
c1 = high(int64)-1;
|
||||||
|
{ Overflow }
|
||||||
|
c2 = c1*2;
|
||||||
|
begin
|
||||||
|
writeln(c2);
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user