Browse Source

check 784 with and without range check

pierre 25 years ago
parent
commit
f830cef394
2 changed files with 29 additions and 0 deletions
  1. 27 0
      tests/webtbf/tbug784.pp
  2. 2 0
      tests/webtbs/tbug784.pp

+ 27 - 0
tests/webtbf/tbug784.pp

@@ -0,0 +1,27 @@
+{$R+}
+{ should not compile if range check on }
+program BigRange;
+
+const
+  Limit   = 100000000; { Hundred millions }
+  One     =         1;
+
+var
+  Huge: longint;
+
+begin
+    Huge := Limit + One;
+
+    writeln(One, ' is the lower bound');
+    writeln(Limit, ' is the upper bound');
+
+    if Limit in [One .. Limit] then
+      writeln(Limit, ' is within the range')
+    else
+      writeln(Limit, ' is out of the range');
+
+    if Huge in [One .. Limit] then
+      writeln(Huge, ' is within the range')
+    else
+      writeln(Huge, ' is out of the range')
+end.

+ 2 - 0
tests/webtbs/tbug784.pp

@@ -1,3 +1,5 @@
+{$R-}
+{ should compile if no range check on }
 program BigRange;
 
 const