Browse Source

* arithmetic overflow checking at compile time

peter 20 years ago
parent
commit
ec433f758a
2 changed files with 20 additions and 0 deletions
  1. 10 0
      tests/tbf/tb0171.pp
  2. 10 0
      tests/tbf/tb0172.pp

+ 10 - 0
tests/tbf/tb0171.pp

@@ -0,0 +1,10 @@
+{ %fail }
+
+const
+  c1 = high(int64)-1;
+  { Overflow }
+  c2 = c1+2;
+begin
+  writeln(c2);
+end.
+

+ 10 - 0
tests/tbf/tb0172.pp

@@ -0,0 +1,10 @@
+{ %fail }
+
+const
+  c1 = high(int64)-1;
+  { Overflow }
+  c2 = c1*2;
+begin
+  writeln(c2);
+end.
+