
(********************************************************************)
(*                                                                  *)
(*  chkovf.sd7    Checks catching of integer overflows.             *)
(*  Copyright (C) 2014, 2018 - 2020  Thomas Mertes                  *)
(*                                                                  *)
(*  This program is free software; you can redistribute it and/or   *)
(*  modify it under the terms of the GNU General Public License as  *)
(*  published by the Free Software Foundation; either version 2 of  *)
(*  the License, or (at your option) any later version.             *)
(*                                                                  *)
(*  This program is distributed in the hope that it will be useful, *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of  *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *)
(*  GNU General Public License for more details.                    *)
(*                                                                  *)
(*  You should have received a copy of the GNU General Public       *)
(*  License along with this program; if not, write to the           *)
(*  Free Software Foundation, Inc., 51 Franklin Street,             *)
(*  Fifth Floor, Boston, MA  02110-1301, USA.                       *)
(*                                                                  *)
(********************************************************************)


$ include "seed7_05.s7i";
  include "stdio.s7i";
  include "bin32.s7i";


const integer: INT32_MIN is pred(-2147483647);
const integer: INT32_MAX is 2147483647;
const integer: INT64_MIN is integer.first;
const integer: INT64_MAX is integer.last;


const func integer: intExpr (in integer: number) is
  return number + length(str(rand(1, 9))[2 ..]);


const func string: striExpr (in string: stri) is
  return stri & str(rand(1, 9))[2 ..];


const func char: charExpr (in char: ch) is
  return chr(ord(ch) + length(str(rand(1, 9))[2 ..]));


const func boolean: boolExpr (ref boolean: value) is
  return value and str(rand(1, 9))[2 ..] = "";


const func boolean: raisesOverflowError (ref func integer: expression) is func
  result
    var boolean: raisesOverflowError is FALSE;
  local
    var integer: exprResult is 0;
  begin
    block
      exprResult := expression;
    exception
      catch NUMERIC_ERROR:  raisesOverflowError := FALSE;
      catch OVERFLOW_ERROR: raisesOverflowError := TRUE;
    end block;
  end func;


const func boolean: raisesOverflowError (ref func bin32: expression) is func
  result
    var boolean: raisesOverflowError is FALSE;
  local
    var bin32: exprResult is bin32(0);
  begin
    block
      exprResult := expression;
    exception
      catch NUMERIC_ERROR:  raisesOverflowError := FALSE;
      catch OVERFLOW_ERROR: raisesOverflowError := TRUE;
    end block;
  end func;


const func boolean: raisesOverflowError (ref proc: statement) is func
  result
    var boolean: raisesOverflowError is FALSE;
  begin
    block
      statement;
    exception
      catch NUMERIC_ERROR:  raisesOverflowError := FALSE;
      catch OVERFLOW_ERROR: raisesOverflowError := TRUE;
    end block;
  end func;


const func string: exceptionName (ref func integer: expression) is func
  result
    var string: exceptionName is "";
  local
    var integer: exprResult is 0;
  begin
    block
      exprResult := expression;
    exception
      catch NUMERIC_ERROR: exceptionName := "NUMERIC_ERROR";
      catch OVERFLOW_ERROR: exceptionName := "OVERFLOW_ERROR";
    end block;
  end func;


const func string: exceptionName (ref proc: statement) is func
  result
    var string: exceptionName is "";
  begin
    block
      statement;
    exception
      catch NUMERIC_ERROR: exceptionName := "NUMERIC_ERROR";
      catch OVERFLOW_ERROR: exceptionName := "OVERFLOW_ERROR";
    end block;
  end func;


const proc: check_negation is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(-                      INT64_MIN)   or
        not raisesOverflowError(-intExpr(              INT64_MIN))  or
        not raisesOverflowError(-        (-9223372036854775807-1))  or
        not raisesOverflowError(-intExpr((-9223372036854775807-1))) then
      writeln(" ***** Negation -(-9223372036854775808) does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of negation works correct.");
    else
      writeln(" ***** Overflow checking of negation does not work correct.");
    end if;
  end func;


(**
 *  Tests for the compiler optimization to reduce overflow checking
 *  for addition and subtraction.
 *)
const func boolean: check_reduced_overflow_checking_for_sums is func
  result
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(intExpr( integer.last) div -integer.last +        integer.first) or
        not raisesOverflowError(intExpr( integer.last) div  -34359738368 + -9223372036586340354) or
        not raisesOverflowError(intExpr( integer.last) div   -1234567890 + -9223372029383844392) or
        not raisesOverflowError(intExpr( integer.last) div            -2 + -4611686018427387906) or
        not raisesOverflowError(intExpr( integer.last) div            -1 +                   -2) or
        not raisesOverflowError(intExpr(integer.first) div             1 +                   -1) or
        not raisesOverflowError(intExpr(integer.first) div             2 + -4611686018427387905) or
        not raisesOverflowError(intExpr(integer.first) div    1234567890 + -9223372029383844392) or
        not raisesOverflowError(intExpr(integer.first) div   34359738368 + -9223372036586340353) or
        not raisesOverflowError(intExpr(integer.first) div  integer.last +        integer.first) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum division result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(integer.first) div integer.first +  9223372036854775807) or
        not raisesOverflowError(intExpr(integer.first) div -integer.last +  9223372036854775807) or
        not raisesOverflowError(intExpr(integer.first) div  -34359738368 +  9223372036586340352) or
        not raisesOverflowError(intExpr(integer.first) div   -1234567890 +  9223372029383844392) or
        not raisesOverflowError(intExpr(integer.first) div            -2 +  4611686018427387904) or
        not raisesOverflowError(intExpr( integer.last) div             1 +                    1) or
        not raisesOverflowError(intExpr( integer.last) div             2 +  4611686018427387905) or
        not raisesOverflowError(intExpr( integer.last) div    1234567890 +  9223372029383844391) or
        not raisesOverflowError(intExpr( integer.last) div   34359738368 +  9223372036586340353) or
        not raisesOverflowError(intExpr( integer.last) div  integer.last +  9223372036854775807) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum division result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(       integer.first div intExpr( 1) +                   -1) or
        not raisesOverflowError(-9223372036854775807 div intExpr( 1) +                   -2) or
        not raisesOverflowError(-9223372036854775806 div intExpr( 1) +                   -3) or
        not raisesOverflowError(-4611686018427387904 div intExpr( 1) + -4611686018427387905) or
        not raisesOverflowError(         -1234567890 div intExpr( 1) + -9223372035620207919) or
        not raisesOverflowError(                  -1 div intExpr( 1) +        integer.first) or
        not raisesOverflowError(                   1 div intExpr(-1) +        integer.first) or
        not raisesOverflowError(          1234567890 div intExpr(-1) + -9223372035620207919) or
        not raisesOverflowError( 4611686018427387904 div intExpr(-1) + -4611686018427387905) or
        not raisesOverflowError( 9223372036854775806 div intExpr(-1) +                   -3) or
        not raisesOverflowError( 9223372036854775807 div intExpr(-1) +                   -2) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum division result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(-9223372036854775807 div intExpr(-1) +                    1) or
        not raisesOverflowError(-9223372036854775806 div intExpr(-1) +                    2) or
        not raisesOverflowError(-4611686018427387904 div intExpr(-1) +  4611686018427387904) or
        not raisesOverflowError(         -1234567890 div intExpr(-1) +  9223372035620207918) or
        not raisesOverflowError(                  -1 div intExpr(-1) +  9223372036854775807) or
        not raisesOverflowError(                   1 div intExpr( 1) +  9223372036854775807) or
        not raisesOverflowError(          1234567890 div intExpr( 1) +  9223372035620207918) or
        not raisesOverflowError( 4611686018427387904 div intExpr( 1) +  4611686018427387904) or
        not raisesOverflowError( 9223372036854775806 div intExpr( 1) +                    2) or
        not raisesOverflowError( 9223372036854775807 div intExpr( 1) +                    1) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum division result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(       -integer.last) rem        integer.first +                   -2) or
        not raisesOverflowError(intExpr(       -integer.last) rem -4611686018427387904 + -4611686018427387906) or
        not raisesOverflowError(intExpr(       -integer.last) rem         -34359738368 + -9223372002495037442) or
        not raisesOverflowError(intExpr(         -6172839449) rem          -1234567890 + -9223372035620207920) or
        not raisesOverflowError(intExpr(       -123456789123) rem                   -2 +        integer.first) or
        not raisesOverflowError(intExpr(       -123456789123) rem                    2 +        integer.first) or
        not raisesOverflowError(intExpr(         -6172839449) rem           1234567890 + -9223372035620207920) or
        not raisesOverflowError(intExpr(       -integer.last) rem          34359738368 + -9223372002495037442) or
        not raisesOverflowError(intExpr(       -integer.last) rem  4611686018427387904 + -4611686018427387906) or
        not raisesOverflowError(intExpr(-9223372036854775806) rem         integer.last +                   -3) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum remainder result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(        integer.last) rem        integer.first +                    1) or
        not raisesOverflowError(intExpr(        integer.last) rem -4611686018427387904 +  4611686018427387905) or
        not raisesOverflowError(intExpr(        integer.last) rem         -34359738368 +  9223372002495037441) or
        not raisesOverflowError(intExpr(          6172839449) rem          -1234567890 +  9223372035620207919) or
        not raisesOverflowError(intExpr(        123456789123) rem                   -2 +  9223372036854775807) or
        not raisesOverflowError(intExpr(        123456789123) rem                    2 +  9223372036854775807) or
        not raisesOverflowError(intExpr(          6172839449) rem           1234567890 +  9223372035620207919) or
        not raisesOverflowError(intExpr(        integer.last) rem          34359738368 +  9223372002495037441) or
        not raisesOverflowError(intExpr(        integer.last) rem  4611686018427387904 +  4611686018427387905) or
        not raisesOverflowError(intExpr( 9223372036854775806) rem         integer.last +                    2) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum remainder result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(-9223372036854775807 rem intExpr(      integer.first) +                   -2) or
        not raisesOverflowError(         -1234567890 rem intExpr(         2345678901) + -9223372035620207919) or
        not raisesOverflowError(                  -1 rem intExpr(                  2) +        integer.first) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum remainder result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(                   1 rem intExpr(                  2) +  9223372036854775807) or
        not raisesOverflowError(          1234567890 rem intExpr(         2345678901) +  9223372035620207918) or
        not raisesOverflowError( 9223372036854775807 rem intExpr(      integer.first) +                    1) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum remainder result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr( integer.last) mdiv integer.first +        integer.first) or
        not raisesOverflowError(intExpr( integer.last) mdiv  -34359738368 + -9223372036586340353) or
        not raisesOverflowError(intExpr( integer.last) mdiv   -1234567890 + -9223372029383844391) or
        not raisesOverflowError(intExpr( integer.last) mdiv            -2 + -4611686018427387905) or
        not raisesOverflowError(intExpr( integer.last) mdiv            -1 +                   -2) or
        not raisesOverflowError(intExpr(integer.first) mdiv             1 +                   -1) or
        not raisesOverflowError(intExpr(integer.first) mdiv             2 + -4611686018427387905) or
        not raisesOverflowError(intExpr(integer.first) mdiv    1234567890 + -9223372029383844391) or
        not raisesOverflowError(intExpr(integer.first) mdiv   34359738368 + -9223372036586340353) or
        not raisesOverflowError(intExpr(integer.first) mdiv  integer.last + -9223372036854775807) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum mdiv division result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(integer.first) mdiv integer.first +  9223372036854775807) or
        not raisesOverflowError(intExpr(integer.first) mdiv  -34359738368 +  9223372036586340352) or
        not raisesOverflowError(intExpr(integer.first) mdiv   -1234567890 +  9223372029383844392) or
        not raisesOverflowError(intExpr(integer.first) mdiv            -2 +  4611686018427387904) or
        not raisesOverflowError(intExpr( integer.last) mdiv             1 +                    1) or
        not raisesOverflowError(intExpr( integer.last) mdiv             2 +  4611686018427387905) or
        not raisesOverflowError(intExpr( integer.last) mdiv    1234567890 +  9223372029383844391) or
        not raisesOverflowError(intExpr( integer.last) mdiv   34359738368 +  9223372036586340353) or
        not raisesOverflowError(intExpr( integer.last) mdiv  integer.last +  9223372036854775807) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum mdiv division result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(       integer.first mdiv intExpr( 1) +                   -1) or
        not raisesOverflowError(-9223372036854775807 mdiv intExpr( 1) +                   -2) or
        not raisesOverflowError(-9223372036854775806 mdiv intExpr( 1) +                   -3) or
        not raisesOverflowError(-4611686018427387904 mdiv intExpr( 1) + -4611686018427387905) or
        not raisesOverflowError(         -1234567890 mdiv intExpr( 1) + -9223372035620207919) or
        not raisesOverflowError(                  -1 mdiv intExpr( 1) +        integer.first) or
        not raisesOverflowError(                   1 mdiv intExpr(-1) +        integer.first) or
        not raisesOverflowError(          1234567890 mdiv intExpr(-1) + -9223372035620207919) or
        not raisesOverflowError( 4611686018427387904 mdiv intExpr(-1) + -4611686018427387905) or
        not raisesOverflowError( 9223372036854775806 mdiv intExpr(-1) +                   -3) or
        not raisesOverflowError( 9223372036854775807 mdiv intExpr(-1) +                   -2) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum mdiv division result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(-9223372036854775807 mdiv intExpr(-1) +                    1) or
        not raisesOverflowError(-9223372036854775806 mdiv intExpr(-1) +                    2) or
        not raisesOverflowError(-4611686018427387904 mdiv intExpr(-1) +  4611686018427387904) or
        not raisesOverflowError(         -1234567890 mdiv intExpr(-1) +  9223372035620207918) or
        not raisesOverflowError(                  -1 mdiv intExpr(-1) +  9223372036854775807) or
        not raisesOverflowError(                   1 mdiv intExpr( 1) +  9223372036854775807) or
        not raisesOverflowError(          1234567890 mdiv intExpr( 1) +  9223372035620207918) or
        not raisesOverflowError( 4611686018427387904 mdiv intExpr( 1) +  4611686018427387904) or
        not raisesOverflowError( 9223372036854775806 mdiv intExpr( 1) +                    2) or
        not raisesOverflowError( 9223372036854775807 mdiv intExpr( 1) +                    1) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum mdiv division result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(       -integer.last) mod        integer.first +                   -2) or
        not raisesOverflowError(intExpr( 4611686018427387905) mod -4611686018427387904 + -4611686018427387906) or
        not raisesOverflowError(intExpr( 9223372002495037441) mod         -34359738368 + -9223372002495037442) or
        not raisesOverflowError(intExpr(          6172839451) mod          -1234567890 + -9223372035620207920) or
        not raisesOverflowError(intExpr(        123456789123) mod                   -2 +        integer.first) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum modulo result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(        123456789123) mod                    2 +  9223372036854775807) or
        not raisesOverflowError(intExpr(          6172839449) mod           1234567890 +  9223372035620207919) or
        not raisesOverflowError(intExpr( 9223372002495037439) mod          34359738368 +  9223372002495037442) or
        not raisesOverflowError(intExpr(        integer.last) mod  4611686018427387904 +  4611686018427387905) or
        not raisesOverflowError(intExpr( 9223372036854775806) mod         integer.last +                    2) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum modulo result if the divisor is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(       integer.first mod intExpr(-4611686018427387905) + -4611686018427387906) or
        not raisesOverflowError(-9223372036854775807 mod intExpr(       integer.first) +                   -2) or
        not raisesOverflowError(-7654321098765432109 mod intExpr(-7654321098765432110) + -1569050938089343700) or
        not raisesOverflowError(-4611686018427387906 mod intExpr(-4611686018427387907) + -4611686018427387903) or
        not raisesOverflowError(-4611686018427387905 mod intExpr(-4611686018427387906) + -4611686018427387904) or
        not raisesOverflowError(-4611686018427387904 mod intExpr(-4611686018427387905) + -4611686018427387905) or
        not raisesOverflowError(         -1234567890 mod intExpr(         -1234567891) + -9223372035620207919) or
        not raisesOverflowError(                  -1 mod intExpr(                  -2) +        integer.first) or
        not raisesOverflowError(                   1 mod intExpr(       integer.first) +                   -2) or
        not raisesOverflowError(          1234567890 mod intExpr(       integer.first) +          -1234567891) or
        not raisesOverflowError( 4611686018427387904 mod intExpr(       integer.first) + -4611686018427387905) or
        not raisesOverflowError( 4611686018427387905 mod intExpr(-4611686018427387904) + -4611686018427387906) or
        not raisesOverflowError( 4611686018427387906 mod intExpr(-4611686018427387905) + -4611686018427387905) or
        not raisesOverflowError( 7654321098765432109 mod intExpr(-7654321098765432108) + -1569050938089343702) or
        not raisesOverflowError( 9223372036854775806 mod intExpr(-9223372036854775805) +                   -5) or
        not raisesOverflowError(        integer.last mod intExpr(-9223372036854775806) +                   -4) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum modulo result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(       integer.first mod intExpr(        integer.last) +                    2) or
        not raisesOverflowError(-9223372036854775807 mod intExpr( 9223372036854775806) +                    3) or
        not raisesOverflowError(-7654321098765432109 mod intExpr( 7654321098765432108) +  1569050938089343701) or
        not raisesOverflowError(-4611686018427387906 mod intExpr( 4611686018427387905) +  4611686018427387904) or
        not raisesOverflowError(-4611686018427387905 mod intExpr( 4611686018427387904) +  4611686018427387905) or
        not raisesOverflowError(-4611686018427387904 mod intExpr(        integer.last) +  4611686018427387905) or
        not raisesOverflowError(         -1234567890 mod intExpr(        integer.last) +           1234567891) or
        not raisesOverflowError(                  -1 mod intExpr(        integer.last) +                    2) or
        not raisesOverflowError(                   1 mod intExpr(                   2) +  9223372036854775807) or
        not raisesOverflowError(          1234567890 mod intExpr(          1234567891) +  9223372035620207918) or
        not raisesOverflowError( 4611686018427387904 mod intExpr( 4611686018427387905) +  4611686018427387904) or
        not raisesOverflowError( 4611686018427387905 mod intExpr( 4611686018427387906) +  4611686018427387903) or
        not raisesOverflowError( 4611686018427387906 mod intExpr( 4611686018427387907) +  4611686018427387902) or
        not raisesOverflowError( 7654321098765432109 mod intExpr( 7654321098765432110) +  1569050938089343699) or
        not raisesOverflowError( 9223372036854775806 mod intExpr( 9223372036854775807) +                    2) or
        not raisesOverflowError(        integer.last mod intExpr( 4611686018427387904) +  4611686018427387905) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum modulo result if the dividend is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((intExpr(integer.first) >>  0) +                   -1) or
        not raisesOverflowError((intExpr(integer.first) >>  1) + -4611686018427387905) or
        not raisesOverflowError((intExpr(integer.first) >> 30) + -9223372028264841217) or
        not raisesOverflowError((intExpr(integer.first) >> 62) + -9223372036854775807) or
        not raisesOverflowError((intExpr(integer.first) >> 63) +        integer.first) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum rshift result if the shift amount is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((intExpr( integer.last) >>  0) +                    1) or
        not raisesOverflowError((intExpr( integer.last) >>  1) +  4611686018427387905) or
        not raisesOverflowError((intExpr( integer.last) >> 30) +  9223372028264841217) or
        not raisesOverflowError((intExpr( integer.last) >> 62) +  9223372036854775807) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum rshift result if the shift amount is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((       integer.first >> intExpr( 0)) +                   -1) or
        not raisesOverflowError((       -integer.last >> intExpr( 0)) +                   -2) or
        not raisesOverflowError((-9012345678901234567 >> intExpr( 0)) +  -211026357953541242) or
        not raisesOverflowError((-4611686018427387904 >> intExpr( 0)) + -4611686018427387905) or
        not raisesOverflowError((         -1234567890 >> intExpr( 0)) + -9223372035620207919) or
        not raisesOverflowError((                  -2 >> intExpr( 0)) + -9223372036854775807) or
        not raisesOverflowError((                  -1 >> intExpr( 0)) +        integer.first) then
      writeln(" ***** Reduced overflow check for sums failed: Minimum rshift result if the shifted value is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((                   1 >> intExpr( 0)) +  9223372036854775807) or
        not raisesOverflowError((                   2 >> intExpr( 0)) +  9223372036854775806) or
        not raisesOverflowError((          1234567890 >> intExpr( 0)) +  9223372035620207918) or
        not raisesOverflowError(( 4611686018427387903 >> intExpr( 0)) +  4611686018427387905) or
        not raisesOverflowError(( 9012345678901234567 >> intExpr( 0)) +   211026357953541241) or
        not raisesOverflowError(( 9223372036854775806 >> intExpr( 0)) +                    2) or
        not raisesOverflowError((        integer.last >> intExpr( 0)) +                    1) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum rshift result if the shifted value is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError( abs(         intExpr( integer.last)) +                    1) or
        not raisesOverflowError(-abs(         intExpr( integer.last)) -                    2) or
        not raisesOverflowError(-abs(         intExpr(            0)) -        integer.first) or
        not raisesOverflowError( log2(        intExpr(            0)) +        integer.first) or
        not raisesOverflowError( log2(        intExpr( integer.last)) +  9223372036854775746) or
        not raisesOverflowError(-log2(        intExpr( integer.last)) -  9223372036854775747) or
        not raisesOverflowError(-log2(        intExpr(            0)) - -9223372036854775807) or
        not raisesOverflowError( log10(       intExpr(            0)) +        integer.first) or
        not raisesOverflowError( log10(       intExpr( integer.last)) +  9223372036854775790) or
        not raisesOverflowError(-log10(       intExpr( integer.last)) -  9223372036854775791) or
        not raisesOverflowError(-log10(       intExpr(            0)) - -9223372036854775807) or
        not raisesOverflowError( sqrt(        intExpr( integer.last)) +  9223372033817775309) or
        not raisesOverflowError(-sqrt(        intExpr( integer.last)) -  9223372033817775310) or
        not raisesOverflowError(-sqrt(        intExpr(            0)) -        integer.first) or
        not raisesOverflowError( bitLength(   intExpr( integer.last)) +  9223372036854775745) or
        not raisesOverflowError( bitLength(   intExpr( integer.last)) + bitLength(   intExpr( integer.last)) +  9223372036854775682) or
        not raisesOverflowError(-bitLength(   intExpr( integer.last)) -  9223372036854775746) or
        not raisesOverflowError(-bitLength(   intExpr(            0)) -        integer.first) or
        not raisesOverflowError(-bitLength(   intExpr( integer.last)) - bitLength(   intExpr( integer.last)) -  9223372036854775683) or
        not raisesOverflowError(-bitLength(   intExpr(            0)) - bitLength(   intExpr(            0)) -        integer.first) or
        not raisesOverflowError( lowestSetBit(intExpr(            0)) +        integer.first) or
        not raisesOverflowError( lowestSetBit(intExpr(integer.first)) +  9223372036854775745) or
        not raisesOverflowError(-lowestSetBit(intExpr(integer.first)) -  9223372036854775746) or
        not raisesOverflowError(-lowestSetBit(intExpr(            0)) - -9223372036854775807) or

        not raisesOverflowError( rand(        -1234567890,  intExpr(-1234567890)) + -9223372035620207919) or
        not raisesOverflowError( rand(intExpr( 1234567890),          1234567890 ) +  9223372035620207918) or
        not raisesOverflowError(-rand(intExpr( 1234567890),          1234567890 ) -  9223372035620207919) or
        not raisesOverflowError(-rand(        -1234567890,  intExpr(-1234567890)) - -9223372035620207918) or

        not raisesOverflowError( compare(intExpr(0), intExpr(1)) +        integer.first) or
        not raisesOverflowError( compare(intExpr(1), intExpr(0)) +  9223372036854775807) or
        not raisesOverflowError(-compare(intExpr(1), intExpr(0)) +        integer.first) or
        not raisesOverflowError(-compare(intExpr(0), intExpr(1)) - -9223372036854775807) then
      writeln(" ***** Reduced overflow check for sums failed: Various integer functions.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError( abs(ord(charExpr(char(-2147483648) ))) + 9223372034707292160) or
        not raisesOverflowError( abs(ord(charExpr(char(-2147483648) ))) + abs(ord(charExpr(char(-2147483648) ))) + 9223372032559808512) or
        not raisesOverflowError(-abs(ord(charExpr(char(-2147483648) ))) - 9223372034707292161) or
        not raisesOverflowError(-abs(ord(charExpr(char(-2147483648) ))) - abs(ord(charExpr(char(-2147483648) ))) - 9223372032559808513) then
      writeln(" ***** Reduced overflow check for sums failed: abs(ord(char))");
      okay := FALSE;
    end if;

    if  not raisesOverflowError( ord(boolExpr(TRUE)) + 9223372036854775807) or
        not raisesOverflowError(-ord(boolExpr(TRUE)) + integer.first) or
        not raisesOverflowError( ord(boolExpr(TRUE)) + ord(boolExpr(TRUE)) + 9223372036854775806) or
        not raisesOverflowError(-ord(boolExpr(TRUE)) - ord(boolExpr(TRUE)) - 9223372036854775807) or
        not raisesOverflowError(ord(boolExpr(TRUE)) + ord(boolExpr(TRUE)) + ord(boolExpr(TRUE)) + 9223372036854775805) or
        not raisesOverflowError(ord(boolExpr(TRUE)) + ord(boolExpr(TRUE)) + ord(boolExpr(TRUE)) + ord(boolExpr(TRUE)) + 9223372036854775804) or
        not raisesOverflowError(ord(boolExpr( TRUE)) + sqrt(intExpr(integer.last)) +  9223372033817775308) or
        not raisesOverflowError(ord(boolExpr(FALSE)) - sqrt(intExpr(integer.last)) + -9223372033817775310) or
        not raisesOverflowError(ord(boolExpr( TRUE)) - sqrt(intExpr(           0)) +         integer.last) or
        not raisesOverflowError(ord(boolExpr( TRUE)) + abs(intExpr(1)) +  9223372036854775806) or
        not raisesOverflowError(ord(boolExpr(FALSE)) - abs(intExpr(1)) +        integer.first) then
      writeln(" ***** Reduced overflow check for sums failed: ord(boolean)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError( ord(charExpr(char(-2147483648) )) + -9223372034707292161) or
        not raisesOverflowError( ord(charExpr(    '\2147483647;')) +  9223372034707292161) or
        not raisesOverflowError(-ord(charExpr(    '\2147483647;')) -  9223372034707292162) or
        not raisesOverflowError(-ord(charExpr(char(-2147483648) )) - -9223372034707292160) or
        not raisesOverflowError( ord(charExpr(char(-2147483648) )) + ord(charExpr(char(-2147483648) )) + -9223372032559808513) or
        not raisesOverflowError( ord(charExpr(    '\2147483647;')) + ord(charExpr(    '\2147483647;')) +  9223372032559808514) or
        not raisesOverflowError(-ord(charExpr(    '\2147483647;')) - ord(charExpr(    '\2147483647;')) -  9223372032559808515) or
        not raisesOverflowError(-ord(charExpr(char(-2147483648) )) - ord(charExpr(char(-2147483648) )) - -9223372032559808512) or
        not raisesOverflowError(ord(charExpr(char(-2147483648) )) + ord(charExpr(char(-2147483648) )) +
                                ord(charExpr(char(-2147483648) )) + -9223372030412324865) or
        not raisesOverflowError(ord(charExpr(    '\2147483647;')) + ord(charExpr(    '\2147483647;')) +
                                ord(charExpr(    '\2147483647;')) +  9223372030412324867) or
        not raisesOverflowError(ord(charExpr(char(-2147483648) )) + ord(charExpr(char(-2147483648) )) +
                                ord(charExpr(char(-2147483648) )) + ord(charExpr(char(-2147483648) )) + -9223372028264841217) or
        not raisesOverflowError(ord(charExpr(    '\2147483647;')) + ord(charExpr(    '\2147483647;')) +
                                ord(charExpr(    '\2147483647;')) + ord(charExpr(    '\2147483647;')) +  9223372028264841220) or
        not raisesOverflowError(ord(charExpr(char(-2147483648) )) - ord(charExpr(    '\2147483647;')) + -9223372032559808514) or
        not raisesOverflowError(ord(charExpr(    '\2147483647;')) - ord(charExpr(char(-2147483648) )) +  9223372032559808513) or
        not raisesOverflowError(ord(charExpr(char(-2147483648) )) + sqrt(intExpr(           0)) + -9223372034707292161) or
        not raisesOverflowError(ord(charExpr(    '\2147483647;')) + sqrt(intExpr(integer.last)) +  9223372031670291662) or
        not raisesOverflowError(ord(charExpr(char(-2147483648) )) - sqrt(intExpr(integer.last)) + -9223372031670291662) or
        not raisesOverflowError(ord(charExpr(    '\2147483647;')) - sqrt(intExpr(           0)) +  9223372034707292161) or
        not raisesOverflowError(ord(charExpr(char(-2147483648) )) + abs(intExpr(1)) + -9223372034707292162) or
        not raisesOverflowError(ord(charExpr(    '\2147483647;')) + abs(intExpr(1)) +  9223372034707292160) or
        not raisesOverflowError(ord(charExpr(char(-2147483648) )) - abs(intExpr(1)) + -9223372034707292160) or
        not raisesOverflowError(ord(charExpr(    '\2147483647;')) - abs(intExpr(1)) +  9223372034707292163) then
      writeln(" ***** Reduced overflow check for sums failed: ord(char)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(pos("a",   striExpr("a")) + 9223372036854775807) or
        not raisesOverflowError(pos("ab",  striExpr("b")) + 9223372036854775806) or
        not raisesOverflowError(pos("abc", striExpr("c")) + 9223372036854775805) then
      writeln(" ***** Reduced overflow check for sums failed: Maximum pos result if the main string is known.");
      okay := FALSE;
    end if;
  end func;


const proc: check_add is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(           INT64_MIN +                   -1) or
        not raisesOverflowError(-9223372036854775807 +                   -2) or
        not raisesOverflowError(-9223372036854775806 +                   -3) or
        not raisesOverflowError(-9223372036854775798 +                  -11) or
        not raisesOverflowError(-9223372036854774952 +                 -857) or
        not raisesOverflowError(-9223372036854771170 +                -4639) or
        not raisesOverflowError(-9223372036854737536 +               -38273) or
        not raisesOverflowError(-9223372036854131366 +              -644443) or
        not raisesOverflowError(-9223372036844899256 +             -9876553) or
        not raisesOverflowError(-9223372036842430156 +            -12345653) or
        not raisesOverflowError(-9223372036731319018 +           -123456791) or
        not raisesOverflowError(-9223372033817775310 +          -3037000499) or
        not raisesOverflowError(-9223371962145462841 +         -74709312968) or
        not raisesOverflowError(-9223371289760066696 +        -747094709113) or
        not raisesOverflowError(-9223371102989282772 +        -933865493037) or
        not raisesOverflowError(-9223357724693674122 +      -14312161101687) or
        not raisesOverflowError(-9223131047853734481 +     -240989001041328) or
        not raisesOverflowError(-9221383812660584222 +    -1988224194191587) or
        not raisesOverflowError(-9212609642412704893 +   -10762394442070916) or
        not raisesOverflowError(-8384883669867978009 +  -838488366986797800) or
        not raisesOverflowError(-6148914691236517207 + -3074457345618258602) or
        not raisesOverflowError(-3074457345618258602 + -6148914691236517207) or
        not raisesOverflowError( -838488366986797800 + -8384883669867978009) or
        not raisesOverflowError(  -10762394442070916 + -9212609642412704893) or
        not raisesOverflowError(   -1988224194191587 + -9221383812660584222) or
        not raisesOverflowError(    -240989001041328 + -9223131047853734481) or
        not raisesOverflowError(     -14312161101687 + -9223357724693674122) or
        not raisesOverflowError(       -933865493037 + -9223371102989282772) or
        not raisesOverflowError(       -747094709113 + -9223371289760066696) or
        not raisesOverflowError(        -74709312968 + -9223371962145462841) or
        not raisesOverflowError(         -3037000499 + -9223372033817775310) or
        not raisesOverflowError(          -123456791 + -9223372036731319018) or
        not raisesOverflowError(           -12345653 + -9223372036842430156) or
        not raisesOverflowError(            -9876553 + -9223372036844899256) or
        not raisesOverflowError(             -644443 + -9223372036854131366) or
        not raisesOverflowError(              -38273 + -9223372036854737536) or
        not raisesOverflowError(               -4639 + -9223372036854771170) or
        not raisesOverflowError(                -857 + -9223372036854774952) or
        not raisesOverflowError(                 -11 + -9223372036854775798) or
        not raisesOverflowError(                  -3 + -9223372036854775806) or
        not raisesOverflowError(                  -2 + -9223372036854775807) or
        not raisesOverflowError(                  -1 +            INT64_MIN) then
      writeln(" ***** Addition underflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) +                   -1) or
        not raisesOverflowError(intExpr(-9223372036854775807) +                   -2) or
        not raisesOverflowError(intExpr(-9223372036854775806) +                   -3) or
        not raisesOverflowError(intExpr(-9223372036854775798) +                  -11) or
        not raisesOverflowError(intExpr(-9223372036854774952) +                 -857) or
        not raisesOverflowError(intExpr(-9223372036854771170) +                -4639) or
        not raisesOverflowError(intExpr(-9223372036854737536) +               -38273) or
        not raisesOverflowError(intExpr(-9223372036854131366) +              -644443) or
        not raisesOverflowError(intExpr(-9223372036844899256) +             -9876553) or
        not raisesOverflowError(intExpr(-9223372036842430156) +            -12345653) or
        not raisesOverflowError(intExpr(-9223372036731319018) +           -123456791) or
        not raisesOverflowError(intExpr(-9223372033817775310) +          -3037000499) or
        not raisesOverflowError(intExpr(-9223371962145462841) +         -74709312968) or
        not raisesOverflowError(intExpr(-9223371289760066696) +        -747094709113) or
        not raisesOverflowError(intExpr(-9223371102989282772) +        -933865493037) or
        not raisesOverflowError(intExpr(-9223357724693674122) +      -14312161101687) or
        not raisesOverflowError(intExpr(-9223131047853734481) +     -240989001041328) or
        not raisesOverflowError(intExpr(-9221383812660584222) +    -1988224194191587) or
        not raisesOverflowError(intExpr(-9212609642412704893) +   -10762394442070916) or
        not raisesOverflowError(intExpr(-8384883669867978009) +  -838488366986797800) or
        not raisesOverflowError(intExpr(-6148914691236517207) + -3074457345618258602) or
        not raisesOverflowError(intExpr(-3074457345618258602) + -6148914691236517207) or
        not raisesOverflowError(intExpr( -838488366986797800) + -8384883669867978009) or
        not raisesOverflowError(intExpr(  -10762394442070916) + -9212609642412704893) or
        not raisesOverflowError(intExpr(   -1988224194191587) + -9221383812660584222) or
        not raisesOverflowError(intExpr(    -240989001041328) + -9223131047853734481) or
        not raisesOverflowError(intExpr(     -14312161101687) + -9223357724693674122) or
        not raisesOverflowError(intExpr(       -933865493037) + -9223371102989282772) or
        not raisesOverflowError(intExpr(       -747094709113) + -9223371289760066696) or
        not raisesOverflowError(intExpr(        -74709312968) + -9223371962145462841) or
        not raisesOverflowError(intExpr(         -3037000499) + -9223372033817775310) or
        not raisesOverflowError(intExpr(          -123456791) + -9223372036731319018) or
        not raisesOverflowError(intExpr(           -12345653) + -9223372036842430156) or
        not raisesOverflowError(intExpr(            -9876553) + -9223372036844899256) or
        not raisesOverflowError(intExpr(             -644443) + -9223372036854131366) or
        not raisesOverflowError(intExpr(              -38273) + -9223372036854737536) or
        not raisesOverflowError(intExpr(               -4639) + -9223372036854771170) or
        not raisesOverflowError(intExpr(                -857) + -9223372036854774952) or
        not raisesOverflowError(intExpr(                 -11) + -9223372036854775798) or
        not raisesOverflowError(intExpr(                  -3) + -9223372036854775806) or
        not raisesOverflowError(intExpr(                  -2) + -9223372036854775807) or
        not raisesOverflowError(intExpr(                  -1) +            INT64_MIN) then
      writeln(" ***** Addition underflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(           INT64_MIN + intExpr(                  -1)) or
        not raisesOverflowError(-9223372036854775807 + intExpr(                  -2)) or
        not raisesOverflowError(-9223372036854775806 + intExpr(                  -3)) or
        not raisesOverflowError(-9223372036854775798 + intExpr(                 -11)) or
        not raisesOverflowError(-9223372036854774952 + intExpr(                -857)) or
        not raisesOverflowError(-9223372036854771170 + intExpr(               -4639)) or
        not raisesOverflowError(-9223372036854737536 + intExpr(              -38273)) or
        not raisesOverflowError(-9223372036854131366 + intExpr(             -644443)) or
        not raisesOverflowError(-9223372036844899256 + intExpr(            -9876553)) or
        not raisesOverflowError(-9223372036842430156 + intExpr(           -12345653)) or
        not raisesOverflowError(-9223372036731319018 + intExpr(          -123456791)) or
        not raisesOverflowError(-9223372033817775310 + intExpr(         -3037000499)) or
        not raisesOverflowError(-9223371962145462841 + intExpr(        -74709312968)) or
        not raisesOverflowError(-9223371289760066696 + intExpr(       -747094709113)) or
        not raisesOverflowError(-9223371102989282772 + intExpr(       -933865493037)) or
        not raisesOverflowError(-9223357724693674122 + intExpr(     -14312161101687)) or
        not raisesOverflowError(-9223131047853734481 + intExpr(    -240989001041328)) or
        not raisesOverflowError(-9221383812660584222 + intExpr(   -1988224194191587)) or
        not raisesOverflowError(-9212609642412704893 + intExpr(  -10762394442070916)) or
        not raisesOverflowError(-8384883669867978009 + intExpr( -838488366986797800)) or
        not raisesOverflowError(-6148914691236517207 + intExpr(-3074457345618258602)) or
        not raisesOverflowError(-3074457345618258602 + intExpr(-6148914691236517207)) or
        not raisesOverflowError( -838488366986797800 + intExpr(-8384883669867978009)) or
        not raisesOverflowError(  -10762394442070916 + intExpr(-9212609642412704893)) or
        not raisesOverflowError(   -1988224194191587 + intExpr(-9221383812660584222)) or
        not raisesOverflowError(    -240989001041328 + intExpr(-9223131047853734481)) or
        not raisesOverflowError(     -14312161101687 + intExpr(-9223357724693674122)) or
        not raisesOverflowError(       -933865493037 + intExpr(-9223371102989282772)) or
        not raisesOverflowError(       -747094709113 + intExpr(-9223371289760066696)) or
        not raisesOverflowError(        -74709312968 + intExpr(-9223371962145462841)) or
        not raisesOverflowError(         -3037000499 + intExpr(-9223372033817775310)) or
        not raisesOverflowError(          -123456791 + intExpr(-9223372036731319018)) or
        not raisesOverflowError(           -12345653 + intExpr(-9223372036842430156)) or
        not raisesOverflowError(            -9876553 + intExpr(-9223372036844899256)) or
        not raisesOverflowError(             -644443 + intExpr(-9223372036854131366)) or
        not raisesOverflowError(              -38273 + intExpr(-9223372036854737536)) or
        not raisesOverflowError(               -4639 + intExpr(-9223372036854771170)) or
        not raisesOverflowError(                -857 + intExpr(-9223372036854774952)) or
        not raisesOverflowError(                 -11 + intExpr(-9223372036854775798)) or
        not raisesOverflowError(                  -3 + intExpr(-9223372036854775806)) or
        not raisesOverflowError(                  -2 + intExpr(-9223372036854775807)) or
        not raisesOverflowError(                  -1 + intExpr(           INT64_MIN)) then
      writeln(" ***** Addition underflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) + intExpr(                  -1)) or
        not raisesOverflowError(intExpr(-9223372036854775807) + intExpr(                  -2)) or
        not raisesOverflowError(intExpr(-9223372036854775806) + intExpr(                  -3)) or
        not raisesOverflowError(intExpr(-9223372036854775798) + intExpr(                 -11)) or
        not raisesOverflowError(intExpr(-9223372036854774952) + intExpr(                -857)) or
        not raisesOverflowError(intExpr(-9223372036854771170) + intExpr(               -4639)) or
        not raisesOverflowError(intExpr(-9223372036854737536) + intExpr(              -38273)) or
        not raisesOverflowError(intExpr(-9223372036854131366) + intExpr(             -644443)) or
        not raisesOverflowError(intExpr(-9223372036844899256) + intExpr(            -9876553)) or
        not raisesOverflowError(intExpr(-9223372036842430156) + intExpr(           -12345653)) or
        not raisesOverflowError(intExpr(-9223372036731319018) + intExpr(          -123456791)) or
        not raisesOverflowError(intExpr(-9223372033817775310) + intExpr(         -3037000499)) or
        not raisesOverflowError(intExpr(-9223371962145462841) + intExpr(        -74709312968)) or
        not raisesOverflowError(intExpr(-9223371289760066696) + intExpr(       -747094709113)) or
        not raisesOverflowError(intExpr(-9223371102989282772) + intExpr(       -933865493037)) or
        not raisesOverflowError(intExpr(-9223357724693674122) + intExpr(     -14312161101687)) or
        not raisesOverflowError(intExpr(-9223131047853734481) + intExpr(    -240989001041328)) or
        not raisesOverflowError(intExpr(-9221383812660584222) + intExpr(   -1988224194191587)) or
        not raisesOverflowError(intExpr(-9212609642412704893) + intExpr(  -10762394442070916)) or
        not raisesOverflowError(intExpr(-8384883669867978009) + intExpr( -838488366986797800)) or
        not raisesOverflowError(intExpr(-6148914691236517207) + intExpr(-3074457345618258602)) or
        not raisesOverflowError(intExpr(-3074457345618258602) + intExpr(-6148914691236517207)) or
        not raisesOverflowError(intExpr( -838488366986797800) + intExpr(-8384883669867978009)) or
        not raisesOverflowError(intExpr(  -10762394442070916) + intExpr(-9212609642412704893)) or
        not raisesOverflowError(intExpr(   -1988224194191587) + intExpr(-9221383812660584222)) or
        not raisesOverflowError(intExpr(    -240989001041328) + intExpr(-9223131047853734481)) or
        not raisesOverflowError(intExpr(     -14312161101687) + intExpr(-9223357724693674122)) or
        not raisesOverflowError(intExpr(       -933865493037) + intExpr(-9223371102989282772)) or
        not raisesOverflowError(intExpr(       -747094709113) + intExpr(-9223371289760066696)) or
        not raisesOverflowError(intExpr(        -74709312968) + intExpr(-9223371962145462841)) or
        not raisesOverflowError(intExpr(         -3037000499) + intExpr(-9223372033817775310)) or
        not raisesOverflowError(intExpr(          -123456791) + intExpr(-9223372036731319018)) or
        not raisesOverflowError(intExpr(           -12345653) + intExpr(-9223372036842430156)) or
        not raisesOverflowError(intExpr(            -9876553) + intExpr(-9223372036844899256)) or
        not raisesOverflowError(intExpr(             -644443) + intExpr(-9223372036854131366)) or
        not raisesOverflowError(intExpr(              -38273) + intExpr(-9223372036854737536)) or
        not raisesOverflowError(intExpr(               -4639) + intExpr(-9223372036854771170)) or
        not raisesOverflowError(intExpr(                -857) + intExpr(-9223372036854774952)) or
        not raisesOverflowError(intExpr(                 -11) + intExpr(-9223372036854775798)) or
        not raisesOverflowError(intExpr(                  -3) + intExpr(-9223372036854775806)) or
        not raisesOverflowError(intExpr(                  -2) + intExpr(-9223372036854775807)) or
        not raisesOverflowError(intExpr(                  -1) + intExpr(           INT64_MIN)) then
      writeln(" ***** Addition underflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(9223372036854775807 +                   1) or
        not raisesOverflowError(9223372036854775806 +                   2) or
        not raisesOverflowError(9223372036854775805 +                   3) or
        not raisesOverflowError(9223372036854775797 +                  11) or
        not raisesOverflowError(9223372036854774951 +                 857) or
        not raisesOverflowError(9223372036854771169 +                4639) or
        not raisesOverflowError(9223372036854737535 +               38273) or
        not raisesOverflowError(9223372036854131365 +              644443) or
        not raisesOverflowError(9223372036844899255 +             9876553) or
        not raisesOverflowError(9223372036842430155 +            12345653) or
        not raisesOverflowError(9223372036731319017 +           123456791) or
        not raisesOverflowError(9223372033817775309 +          3037000499) or
        not raisesOverflowError(9223371962145462840 +         74709312968) or
        not raisesOverflowError(9223371289760066695 +        747094709113) or
        not raisesOverflowError(9223371102989282771 +        933865493037) or
        not raisesOverflowError(9223357724693674121 +      14312161101687) or
        not raisesOverflowError(9223131047853734480 +     240989001041328) or
        not raisesOverflowError(9221383812660584221 +    1988224194191587) or
        not raisesOverflowError(9212609642412704892 +   10762394442070916) or
        not raisesOverflowError(8384883669867978008 +  838488366986797800) or
        not raisesOverflowError(6148914691236517206 + 3074457345618258602) or
        not raisesOverflowError(3074457345618258602 + 6148914691236517206) or
        not raisesOverflowError( 838488366986797800 + 8384883669867978008) or
        not raisesOverflowError(  10762394442070916 + 9212609642412704892) or
        not raisesOverflowError(   1988224194191587 + 9221383812660584221) or
        not raisesOverflowError(    240989001041328 + 9223131047853734480) or
        not raisesOverflowError(     14312161101687 + 9223357724693674121) or
        not raisesOverflowError(       933865493037 + 9223371102989282771) or
        not raisesOverflowError(       747094709113 + 9223371289760066695) or
        not raisesOverflowError(        74709312968 + 9223371962145462840) or
        not raisesOverflowError(         3037000499 + 9223372033817775309) or
        not raisesOverflowError(          123456791 + 9223372036731319017) or
        not raisesOverflowError(           12345653 + 9223372036842430155) or
        not raisesOverflowError(            9876553 + 9223372036844899255) or
        not raisesOverflowError(             644443 + 9223372036854131365) or
        not raisesOverflowError(              38273 + 9223372036854737535) or
        not raisesOverflowError(               4639 + 9223372036854771169) or
        not raisesOverflowError(                857 + 9223372036854774951) or
        not raisesOverflowError(                 11 + 9223372036854775797) or
        not raisesOverflowError(                  3 + 9223372036854775805) or
        not raisesOverflowError(                  2 + 9223372036854775806) or
        not raisesOverflowError(                  1 + 9223372036854775807) then
      writeln(" ***** Addition overflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(9223372036854775807) +                   1) or
        not raisesOverflowError(intExpr(9223372036854775806) +                   2) or
        not raisesOverflowError(intExpr(9223372036854775805) +                   3) or
        not raisesOverflowError(intExpr(9223372036854775797) +                  11) or
        not raisesOverflowError(intExpr(9223372036854774951) +                 857) or
        not raisesOverflowError(intExpr(9223372036854771169) +                4639) or
        not raisesOverflowError(intExpr(9223372036854737535) +               38273) or
        not raisesOverflowError(intExpr(9223372036854131365) +              644443) or
        not raisesOverflowError(intExpr(9223372036844899255) +             9876553) or
        not raisesOverflowError(intExpr(9223372036842430155) +            12345653) or
        not raisesOverflowError(intExpr(9223372036731319017) +           123456791) or
        not raisesOverflowError(intExpr(9223372033817775309) +          3037000499) or
        not raisesOverflowError(intExpr(9223371962145462840) +         74709312968) or
        not raisesOverflowError(intExpr(9223371289760066695) +        747094709113) or
        not raisesOverflowError(intExpr(9223371102989282771) +        933865493037) or
        not raisesOverflowError(intExpr(9223357724693674121) +      14312161101687) or
        not raisesOverflowError(intExpr(9223131047853734480) +     240989001041328) or
        not raisesOverflowError(intExpr(9221383812660584221) +    1988224194191587) or
        not raisesOverflowError(intExpr(9212609642412704892) +   10762394442070916) or
        not raisesOverflowError(intExpr(8384883669867978008) +  838488366986797800) or
        not raisesOverflowError(intExpr(6148914691236517206) + 3074457345618258602) or
        not raisesOverflowError(intExpr(3074457345618258602) + 6148914691236517206) or
        not raisesOverflowError(intExpr( 838488366986797800) + 8384883669867978008) or
        not raisesOverflowError(intExpr(  10762394442070916) + 9212609642412704892) or
        not raisesOverflowError(intExpr(   1988224194191587) + 9221383812660584221) or
        not raisesOverflowError(intExpr(    240989001041328) + 9223131047853734480) or
        not raisesOverflowError(intExpr(     14312161101687) + 9223357724693674121) or
        not raisesOverflowError(intExpr(       933865493037) + 9223371102989282771) or
        not raisesOverflowError(intExpr(       747094709113) + 9223371289760066695) or
        not raisesOverflowError(intExpr(        74709312968) + 9223371962145462840) or
        not raisesOverflowError(intExpr(         3037000499) + 9223372033817775309) or
        not raisesOverflowError(intExpr(          123456791) + 9223372036731319017) or
        not raisesOverflowError(intExpr(           12345653) + 9223372036842430155) or
        not raisesOverflowError(intExpr(            9876553) + 9223372036844899255) or
        not raisesOverflowError(intExpr(             644443) + 9223372036854131365) or
        not raisesOverflowError(intExpr(              38273) + 9223372036854737535) or
        not raisesOverflowError(intExpr(               4639) + 9223372036854771169) or
        not raisesOverflowError(intExpr(                857) + 9223372036854774951) or
        not raisesOverflowError(intExpr(                 11) + 9223372036854775797) or
        not raisesOverflowError(intExpr(                  3) + 9223372036854775805) or
        not raisesOverflowError(intExpr(                  2) + 9223372036854775806) or
        not raisesOverflowError(intExpr(                  1) + 9223372036854775807) then
      writeln(" ***** Addition overflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(9223372036854775807 + intExpr(                  1)) or
        not raisesOverflowError(9223372036854775806 + intExpr(                  2)) or
        not raisesOverflowError(9223372036854775805 + intExpr(                  3)) or
        not raisesOverflowError(9223372036854775797 + intExpr(                 11)) or
        not raisesOverflowError(9223372036854774951 + intExpr(                857)) or
        not raisesOverflowError(9223372036854771169 + intExpr(               4639)) or
        not raisesOverflowError(9223372036854737535 + intExpr(              38273)) or
        not raisesOverflowError(9223372036854131365 + intExpr(             644443)) or
        not raisesOverflowError(9223372036844899255 + intExpr(            9876553)) or
        not raisesOverflowError(9223372036842430155 + intExpr(           12345653)) or
        not raisesOverflowError(9223372036731319017 + intExpr(          123456791)) or
        not raisesOverflowError(9223372033817775309 + intExpr(         3037000499)) or
        not raisesOverflowError(9223371962145462840 + intExpr(        74709312968)) or
        not raisesOverflowError(9223371289760066695 + intExpr(       747094709113)) or
        not raisesOverflowError(9223371102989282771 + intExpr(       933865493037)) or
        not raisesOverflowError(9223357724693674121 + intExpr(     14312161101687)) or
        not raisesOverflowError(9223131047853734480 + intExpr(    240989001041328)) or
        not raisesOverflowError(9221383812660584221 + intExpr(   1988224194191587)) or
        not raisesOverflowError(9212609642412704892 + intExpr(  10762394442070916)) or
        not raisesOverflowError(8384883669867978008 + intExpr( 838488366986797800)) or
        not raisesOverflowError(6148914691236517206 + intExpr(3074457345618258602)) or
        not raisesOverflowError(3074457345618258602 + intExpr(6148914691236517206)) or
        not raisesOverflowError( 838488366986797800 + intExpr(8384883669867978008)) or
        not raisesOverflowError(  10762394442070916 + intExpr(9212609642412704892)) or
        not raisesOverflowError(   1988224194191587 + intExpr(9221383812660584221)) or
        not raisesOverflowError(    240989001041328 + intExpr(9223131047853734480)) or
        not raisesOverflowError(     14312161101687 + intExpr(9223357724693674121)) or
        not raisesOverflowError(       933865493037 + intExpr(9223371102989282771)) or
        not raisesOverflowError(       747094709113 + intExpr(9223371289760066695)) or
        not raisesOverflowError(        74709312968 + intExpr(9223371962145462840)) or
        not raisesOverflowError(         3037000499 + intExpr(9223372033817775309)) or
        not raisesOverflowError(          123456791 + intExpr(9223372036731319017)) or
        not raisesOverflowError(           12345653 + intExpr(9223372036842430155)) or
        not raisesOverflowError(            9876553 + intExpr(9223372036844899255)) or
        not raisesOverflowError(             644443 + intExpr(9223372036854131365)) or
        not raisesOverflowError(              38273 + intExpr(9223372036854737535)) or
        not raisesOverflowError(               4639 + intExpr(9223372036854771169)) or
        not raisesOverflowError(                857 + intExpr(9223372036854774951)) or
        not raisesOverflowError(                 11 + intExpr(9223372036854775797)) or
        not raisesOverflowError(                  3 + intExpr(9223372036854775805)) or
        not raisesOverflowError(                  2 + intExpr(9223372036854775806)) or
        not raisesOverflowError(                  1 + intExpr(9223372036854775807)) then
      writeln(" ***** Addition overflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(9223372036854775807) + intExpr(                  1)) or
        not raisesOverflowError(intExpr(9223372036854775806) + intExpr(                  2)) or
        not raisesOverflowError(intExpr(9223372036854775805) + intExpr(                  3)) or
        not raisesOverflowError(intExpr(9223372036854775797) + intExpr(                 11)) or
        not raisesOverflowError(intExpr(9223372036854774951) + intExpr(                857)) or
        not raisesOverflowError(intExpr(9223372036854771169) + intExpr(               4639)) or
        not raisesOverflowError(intExpr(9223372036854737535) + intExpr(              38273)) or
        not raisesOverflowError(intExpr(9223372036854131365) + intExpr(             644443)) or
        not raisesOverflowError(intExpr(9223372036844899255) + intExpr(            9876553)) or
        not raisesOverflowError(intExpr(9223372036842430155) + intExpr(           12345653)) or
        not raisesOverflowError(intExpr(9223372036731319017) + intExpr(          123456791)) or
        not raisesOverflowError(intExpr(9223372033817775309) + intExpr(         3037000499)) or
        not raisesOverflowError(intExpr(9223371962145462840) + intExpr(        74709312968)) or
        not raisesOverflowError(intExpr(9223371289760066695) + intExpr(       747094709113)) or
        not raisesOverflowError(intExpr(9223371102989282771) + intExpr(       933865493037)) or
        not raisesOverflowError(intExpr(9223357724693674121) + intExpr(     14312161101687)) or
        not raisesOverflowError(intExpr(9223131047853734480) + intExpr(    240989001041328)) or
        not raisesOverflowError(intExpr(9221383812660584221) + intExpr(   1988224194191587)) or
        not raisesOverflowError(intExpr(9212609642412704892) + intExpr(  10762394442070916)) or
        not raisesOverflowError(intExpr(8384883669867978008) + intExpr( 838488366986797800)) or
        not raisesOverflowError(intExpr(6148914691236517206) + intExpr(3074457345618258602)) or
        not raisesOverflowError(intExpr(3074457345618258602) + intExpr(6148914691236517206)) or
        not raisesOverflowError(intExpr( 838488366986797800) + intExpr(8384883669867978008)) or
        not raisesOverflowError(intExpr(  10762394442070916) + intExpr(9212609642412704892)) or
        not raisesOverflowError(intExpr(   1988224194191587) + intExpr(9221383812660584221)) or
        not raisesOverflowError(intExpr(    240989001041328) + intExpr(9223131047853734480)) or
        not raisesOverflowError(intExpr(     14312161101687) + intExpr(9223357724693674121)) or
        not raisesOverflowError(intExpr(       933865493037) + intExpr(9223371102989282771)) or
        not raisesOverflowError(intExpr(       747094709113) + intExpr(9223371289760066695)) or
        not raisesOverflowError(intExpr(        74709312968) + intExpr(9223371962145462840)) or
        not raisesOverflowError(intExpr(         3037000499) + intExpr(9223372033817775309)) or
        not raisesOverflowError(intExpr(          123456791) + intExpr(9223372036731319017)) or
        not raisesOverflowError(intExpr(           12345653) + intExpr(9223372036842430155)) or
        not raisesOverflowError(intExpr(            9876553) + intExpr(9223372036844899255)) or
        not raisesOverflowError(intExpr(             644443) + intExpr(9223372036854131365)) or
        not raisesOverflowError(intExpr(              38273) + intExpr(9223372036854737535)) or
        not raisesOverflowError(intExpr(               4639) + intExpr(9223372036854771169)) or
        not raisesOverflowError(intExpr(                857) + intExpr(9223372036854774951)) or
        not raisesOverflowError(intExpr(                 11) + intExpr(9223372036854775797)) or
        not raisesOverflowError(intExpr(                  3) + intExpr(9223372036854775805)) or
        not raisesOverflowError(intExpr(                  2) + intExpr(9223372036854775806)) or
        not raisesOverflowError(intExpr(                  1) + intExpr(9223372036854775807)) then
      writeln(" ***** Addition overflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(           INT64_MIN +            INT64_MIN) or
        not raisesOverflowError(           INT64_MIN + -9223372036854775807) or
        not raisesOverflowError(-9223372036854775807 +            INT64_MIN) or
        not raisesOverflowError(-9223372036854775807 + -9223372036854775807) or
        not raisesOverflowError(intExpr(           INT64_MIN) +            INT64_MIN) or
        not raisesOverflowError(intExpr(           INT64_MIN) + -9223372036854775807) or
        not raisesOverflowError(intExpr(-9223372036854775807) +            INT64_MIN) or
        not raisesOverflowError(intExpr(-9223372036854775807) + -9223372036854775807) or
        not raisesOverflowError(           INT64_MIN + intExpr(           INT64_MIN)) or
        not raisesOverflowError(           INT64_MIN + intExpr(-9223372036854775807)) or
        not raisesOverflowError(-9223372036854775807 + intExpr(           INT64_MIN)) or
        not raisesOverflowError(-9223372036854775807 + intExpr(-9223372036854775807)) or
        not raisesOverflowError(intExpr(           INT64_MIN) + intExpr(           INT64_MIN)) or
        not raisesOverflowError(intExpr(           INT64_MIN) + intExpr(-9223372036854775807)) or
        not raisesOverflowError(intExpr(-9223372036854775807) + intExpr(           INT64_MIN)) or
        not raisesOverflowError(intExpr(-9223372036854775807) + intExpr(-9223372036854775807)) then
      writeln(" ***** Addition underflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(9223372036854775807 + 9223372036854775807) or
        not raisesOverflowError(9223372036854775807 + 9223372036854775806) or
        not raisesOverflowError(9223372036854775806 + 9223372036854775807) or
        not raisesOverflowError(9223372036854775806 + 9223372036854775806) or
        not raisesOverflowError(intExpr(9223372036854775807) + 9223372036854775807) or
        not raisesOverflowError(intExpr(9223372036854775807) + 9223372036854775806) or
        not raisesOverflowError(intExpr(9223372036854775806) + 9223372036854775807) or
        not raisesOverflowError(intExpr(9223372036854775806) + 9223372036854775806) or
        not raisesOverflowError(9223372036854775807 + intExpr(9223372036854775807)) or
        not raisesOverflowError(9223372036854775807 + intExpr(9223372036854775806)) or
        not raisesOverflowError(9223372036854775806 + intExpr(9223372036854775807)) or
        not raisesOverflowError(9223372036854775806 + intExpr(9223372036854775806)) or
        not raisesOverflowError(intExpr(9223372036854775807) + intExpr(9223372036854775807)) or
        not raisesOverflowError(intExpr(9223372036854775807) + intExpr(9223372036854775806)) or
        not raisesOverflowError(intExpr(9223372036854775806) + intExpr(9223372036854775807)) or
        not raisesOverflowError(intExpr(9223372036854775806) + intExpr(9223372036854775806)) then
      writeln(" ***** Addition overflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if not check_reduced_overflow_checking_for_sums then
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of addition works correct.");
    else
      writeln(" ***** Overflow checking of addition does not work correct.");
    end if;
  end func;


const proc: check_add_assign is func
  local
    var boolean: okay is TRUE;
    var boolean: ok is TRUE;
    var integer: num is 0;
    var array integer: arr is [] (0);
  begin
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num +:=                   -1);
    num := -9223372036854775807; ok := ok and raisesOverflowError(num +:=                   -2);
    num := -9223372036854775806; ok := ok and raisesOverflowError(num +:=                   -3);
    num := -9223372036854775798; ok := ok and raisesOverflowError(num +:=                  -11);
    num := -9223372036854774952; ok := ok and raisesOverflowError(num +:=                 -857);
    num := -9223372036854771170; ok := ok and raisesOverflowError(num +:=                -4639);
    num := -9223372036854737536; ok := ok and raisesOverflowError(num +:=               -38273);
    num := -9223372036854131366; ok := ok and raisesOverflowError(num +:=              -644443);
    num := -9223372036844899256; ok := ok and raisesOverflowError(num +:=             -9876553);
    num := -9223372036842430156; ok := ok and raisesOverflowError(num +:=            -12345653);
    num := -9223372036731319018; ok := ok and raisesOverflowError(num +:=           -123456791);
    num := -9223372033817775310; ok := ok and raisesOverflowError(num +:=          -3037000499);
    num := -9223371962145462841; ok := ok and raisesOverflowError(num +:=         -74709312968);
    num := -9223371289760066696; ok := ok and raisesOverflowError(num +:=        -747094709113);
    num := -9223371102989282772; ok := ok and raisesOverflowError(num +:=        -933865493037);
    num := -9223357724693674122; ok := ok and raisesOverflowError(num +:=      -14312161101687);
    num := -9223131047853734481; ok := ok and raisesOverflowError(num +:=     -240989001041328);
    num := -9221383812660584222; ok := ok and raisesOverflowError(num +:=    -1988224194191587);
    num := -9212609642412704893; ok := ok and raisesOverflowError(num +:=   -10762394442070916);
    num := -8384883669867978009; ok := ok and raisesOverflowError(num +:=  -838488366986797800);
    num := -6148914691236517207; ok := ok and raisesOverflowError(num +:= -3074457345618258602);
    num := -3074457345618258602; ok := ok and raisesOverflowError(num +:= -6148914691236517207);
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num +:= -8384883669867978009);
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num +:= -9212609642412704893);
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num +:= -9221383812660584222);
    num :=     -240989001041328; ok := ok and raisesOverflowError(num +:= -9223131047853734481);
    num :=      -14312161101687; ok := ok and raisesOverflowError(num +:= -9223357724693674122);
    num :=        -933865493037; ok := ok and raisesOverflowError(num +:= -9223371102989282772);
    num :=        -747094709113; ok := ok and raisesOverflowError(num +:= -9223371289760066696);
    num :=         -74709312968; ok := ok and raisesOverflowError(num +:= -9223371962145462841);
    num :=          -3037000499; ok := ok and raisesOverflowError(num +:= -9223372033817775310);
    num :=           -123456791; ok := ok and raisesOverflowError(num +:= -9223372036731319018);
    num :=            -12345653; ok := ok and raisesOverflowError(num +:= -9223372036842430156);
    num :=             -9876553; ok := ok and raisesOverflowError(num +:= -9223372036844899256);
    num :=              -644443; ok := ok and raisesOverflowError(num +:= -9223372036854131366);
    num :=               -38273; ok := ok and raisesOverflowError(num +:= -9223372036854737536);
    num :=                -4639; ok := ok and raisesOverflowError(num +:= -9223372036854771170);
    num :=                 -857; ok := ok and raisesOverflowError(num +:= -9223372036854774952);
    num :=                  -11; ok := ok and raisesOverflowError(num +:= -9223372036854775798);
    num :=                   -3; ok := ok and raisesOverflowError(num +:= -9223372036854775806);
    num :=                   -2; ok := ok and raisesOverflowError(num +:= -9223372036854775807);
    num :=                   -1; ok := ok and raisesOverflowError(num +:=            INT64_MIN);
    if not ok then
      writeln(" ***** Addition assignment underflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num +:= intExpr(                  -1));
    num := -9223372036854775807; ok := ok and raisesOverflowError(num +:= intExpr(                  -2));
    num := -9223372036854775806; ok := ok and raisesOverflowError(num +:= intExpr(                  -3));
    num := -9223372036854775798; ok := ok and raisesOverflowError(num +:= intExpr(                 -11));
    num := -9223372036854774952; ok := ok and raisesOverflowError(num +:= intExpr(                -857));
    num := -9223372036854771170; ok := ok and raisesOverflowError(num +:= intExpr(               -4639));
    num := -9223372036854737536; ok := ok and raisesOverflowError(num +:= intExpr(              -38273));
    num := -9223372036854131366; ok := ok and raisesOverflowError(num +:= intExpr(             -644443));
    num := -9223372036844899256; ok := ok and raisesOverflowError(num +:= intExpr(            -9876553));
    num := -9223372036842430156; ok := ok and raisesOverflowError(num +:= intExpr(           -12345653));
    num := -9223372036731319018; ok := ok and raisesOverflowError(num +:= intExpr(          -123456791));
    num := -9223372033817775310; ok := ok and raisesOverflowError(num +:= intExpr(         -3037000499));
    num := -9223371962145462841; ok := ok and raisesOverflowError(num +:= intExpr(        -74709312968));
    num := -9223371289760066696; ok := ok and raisesOverflowError(num +:= intExpr(       -747094709113));
    num := -9223371102989282772; ok := ok and raisesOverflowError(num +:= intExpr(       -933865493037));
    num := -9223357724693674122; ok := ok and raisesOverflowError(num +:= intExpr(     -14312161101687));
    num := -9223131047853734481; ok := ok and raisesOverflowError(num +:= intExpr(    -240989001041328));
    num := -9221383812660584222; ok := ok and raisesOverflowError(num +:= intExpr(   -1988224194191587));
    num := -9212609642412704893; ok := ok and raisesOverflowError(num +:= intExpr(  -10762394442070916));
    num := -8384883669867978009; ok := ok and raisesOverflowError(num +:= intExpr( -838488366986797800));
    num := -6148914691236517207; ok := ok and raisesOverflowError(num +:= intExpr(-3074457345618258602));
    num := -3074457345618258602; ok := ok and raisesOverflowError(num +:= intExpr(-6148914691236517207));
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num +:= intExpr(-8384883669867978009));
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num +:= intExpr(-9212609642412704893));
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num +:= intExpr(-9221383812660584222));
    num :=     -240989001041328; ok := ok and raisesOverflowError(num +:= intExpr(-9223131047853734481));
    num :=      -14312161101687; ok := ok and raisesOverflowError(num +:= intExpr(-9223357724693674122));
    num :=        -933865493037; ok := ok and raisesOverflowError(num +:= intExpr(-9223371102989282772));
    num :=        -747094709113; ok := ok and raisesOverflowError(num +:= intExpr(-9223371289760066696));
    num :=         -74709312968; ok := ok and raisesOverflowError(num +:= intExpr(-9223371962145462841));
    num :=          -3037000499; ok := ok and raisesOverflowError(num +:= intExpr(-9223372033817775310));
    num :=           -123456791; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036731319018));
    num :=            -12345653; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036842430156));
    num :=             -9876553; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036844899256));
    num :=              -644443; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854131366));
    num :=               -38273; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854737536));
    num :=                -4639; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854771170));
    num :=                 -857; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854774952));
    num :=                  -11; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854775798));
    num :=                   -3; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854775806));
    num :=                   -2; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854775807));
    num :=                   -1; ok := ok and raisesOverflowError(num +:= intExpr(           INT64_MIN));
    if not ok then
      writeln(" ***** Addition assignment underflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] +:=                   -1);
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:=                   -2);
    arr[1] := -9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:=                   -3);
    arr[1] := -9223372036854775798; ok := ok and raisesOverflowError(arr[1] +:=                  -11);
    arr[1] := -9223372036854774952; ok := ok and raisesOverflowError(arr[1] +:=                 -857);
    arr[1] := -9223372036854771170; ok := ok and raisesOverflowError(arr[1] +:=                -4639);
    arr[1] := -9223372036854737536; ok := ok and raisesOverflowError(arr[1] +:=               -38273);
    arr[1] := -9223372036854131366; ok := ok and raisesOverflowError(arr[1] +:=              -644443);
    arr[1] := -9223372036844899256; ok := ok and raisesOverflowError(arr[1] +:=             -9876553);
    arr[1] := -9223372036842430156; ok := ok and raisesOverflowError(arr[1] +:=            -12345653);
    arr[1] := -9223372036731319018; ok := ok and raisesOverflowError(arr[1] +:=           -123456791);
    arr[1] := -9223372033817775310; ok := ok and raisesOverflowError(arr[1] +:=          -3037000499);
    arr[1] := -9223371962145462841; ok := ok and raisesOverflowError(arr[1] +:=         -74709312968);
    arr[1] := -9223371289760066696; ok := ok and raisesOverflowError(arr[1] +:=        -747094709113);
    arr[1] := -9223371102989282772; ok := ok and raisesOverflowError(arr[1] +:=        -933865493037);
    arr[1] := -9223357724693674122; ok := ok and raisesOverflowError(arr[1] +:=      -14312161101687);
    arr[1] := -9223131047853734481; ok := ok and raisesOverflowError(arr[1] +:=     -240989001041328);
    arr[1] := -9221383812660584222; ok := ok and raisesOverflowError(arr[1] +:=    -1988224194191587);
    arr[1] := -9212609642412704893; ok := ok and raisesOverflowError(arr[1] +:=   -10762394442070916);
    arr[1] := -8384883669867978009; ok := ok and raisesOverflowError(arr[1] +:=  -838488366986797800);
    arr[1] := -6148914691236517207; ok := ok and raisesOverflowError(arr[1] +:= -3074457345618258602);
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] +:= -6148914691236517207);
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] +:= -8384883669867978009);
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] +:= -9212609642412704893);
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] +:= -9221383812660584222);
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] +:= -9223131047853734481);
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] +:= -9223357724693674122);
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] +:= -9223371102989282772);
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] +:= -9223371289760066696);
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] +:= -9223371962145462841);
    arr[1] :=          -3037000499; ok := ok and raisesOverflowError(arr[1] +:= -9223372033817775310);
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] +:= -9223372036731319018);
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] +:= -9223372036842430156);
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] +:= -9223372036844899256);
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854131366);
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854737536);
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854771170);
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854774952);
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854775798);
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854775806);
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854775807);
    arr[1] :=                   -1; ok := ok and raisesOverflowError(arr[1] +:=            INT64_MIN);
    if not ok then
      writeln(" ***** Addition assignment underflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                  -1));
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                  -2));
    arr[1] := -9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                  -3));
    arr[1] := -9223372036854775798; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                 -11));
    arr[1] := -9223372036854774952; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                -857));
    arr[1] := -9223372036854771170; ok := ok and raisesOverflowError(arr[1] +:= intExpr(               -4639));
    arr[1] := -9223372036854737536; ok := ok and raisesOverflowError(arr[1] +:= intExpr(              -38273));
    arr[1] := -9223372036854131366; ok := ok and raisesOverflowError(arr[1] +:= intExpr(             -644443));
    arr[1] := -9223372036844899256; ok := ok and raisesOverflowError(arr[1] +:= intExpr(            -9876553));
    arr[1] := -9223372036842430156; ok := ok and raisesOverflowError(arr[1] +:= intExpr(           -12345653));
    arr[1] := -9223372036731319018; ok := ok and raisesOverflowError(arr[1] +:= intExpr(          -123456791));
    arr[1] := -9223372033817775310; ok := ok and raisesOverflowError(arr[1] +:= intExpr(         -3037000499));
    arr[1] := -9223371962145462841; ok := ok and raisesOverflowError(arr[1] +:= intExpr(        -74709312968));
    arr[1] := -9223371289760066696; ok := ok and raisesOverflowError(arr[1] +:= intExpr(       -747094709113));
    arr[1] := -9223371102989282772; ok := ok and raisesOverflowError(arr[1] +:= intExpr(       -933865493037));
    arr[1] := -9223357724693674122; ok := ok and raisesOverflowError(arr[1] +:= intExpr(     -14312161101687));
    arr[1] := -9223131047853734481; ok := ok and raisesOverflowError(arr[1] +:= intExpr(    -240989001041328));
    arr[1] := -9221383812660584222; ok := ok and raisesOverflowError(arr[1] +:= intExpr(   -1988224194191587));
    arr[1] := -9212609642412704893; ok := ok and raisesOverflowError(arr[1] +:= intExpr(  -10762394442070916));
    arr[1] := -8384883669867978009; ok := ok and raisesOverflowError(arr[1] +:= intExpr( -838488366986797800));
    arr[1] := -6148914691236517207; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-3074457345618258602));
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-6148914691236517207));
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-8384883669867978009));
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9212609642412704893));
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9221383812660584222));
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223131047853734481));
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223357724693674122));
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223371102989282772));
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223371289760066696));
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223371962145462841));
    arr[1] :=          -3037000499; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372033817775310));
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036731319018));
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036842430156));
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036844899256));
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854131366));
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854737536));
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854771170));
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854774952));
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854775798));
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854775806));
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854775807));
    arr[1] :=                   -1; ok := ok and raisesOverflowError(arr[1] +:= intExpr(           INT64_MIN));
    if not ok then
      writeln(" ***** Addition assignment underflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num := 9223372036854775807; ok := ok and raisesOverflowError(num +:=                   1);
    num := 9223372036854775806; ok := ok and raisesOverflowError(num +:=                   2);
    num := 9223372036854775805; ok := ok and raisesOverflowError(num +:=                   3);
    num := 9223372036854775797; ok := ok and raisesOverflowError(num +:=                  11);
    num := 9223372036854774951; ok := ok and raisesOverflowError(num +:=                 857);
    num := 9223372036854771169; ok := ok and raisesOverflowError(num +:=                4639);
    num := 9223372036854737535; ok := ok and raisesOverflowError(num +:=               38273);
    num := 9223372036854131365; ok := ok and raisesOverflowError(num +:=              644443);
    num := 9223372036844899255; ok := ok and raisesOverflowError(num +:=             9876553);
    num := 9223372036842430155; ok := ok and raisesOverflowError(num +:=            12345653);
    num := 9223372036731319017; ok := ok and raisesOverflowError(num +:=           123456791);
    num := 9223372033817775309; ok := ok and raisesOverflowError(num +:=          3037000499);
    num := 9223371962145462840; ok := ok and raisesOverflowError(num +:=         74709312968);
    num := 9223371289760066695; ok := ok and raisesOverflowError(num +:=        747094709113);
    num := 9223371102989282771; ok := ok and raisesOverflowError(num +:=        933865493037);
    num := 9223357724693674121; ok := ok and raisesOverflowError(num +:=      14312161101687);
    num := 9223131047853734480; ok := ok and raisesOverflowError(num +:=     240989001041328);
    num := 9221383812660584221; ok := ok and raisesOverflowError(num +:=    1988224194191587);
    num := 9212609642412704892; ok := ok and raisesOverflowError(num +:=   10762394442070916);
    num := 8384883669867978008; ok := ok and raisesOverflowError(num +:=  838488366986797800);
    num := 6148914691236517206; ok := ok and raisesOverflowError(num +:= 3074457345618258602);
    num := 3074457345618258602; ok := ok and raisesOverflowError(num +:= 6148914691236517206);
    num :=  838488366986797800; ok := ok and raisesOverflowError(num +:= 8384883669867978008);
    num :=   10762394442070916; ok := ok and raisesOverflowError(num +:= 9212609642412704892);
    num :=    1988224194191587; ok := ok and raisesOverflowError(num +:= 9221383812660584221);
    num :=     240989001041328; ok := ok and raisesOverflowError(num +:= 9223131047853734480);
    num :=      14312161101687; ok := ok and raisesOverflowError(num +:= 9223357724693674121);
    num :=        933865493037; ok := ok and raisesOverflowError(num +:= 9223371102989282771);
    num :=        747094709113; ok := ok and raisesOverflowError(num +:= 9223371289760066695);
    num :=         74709312968; ok := ok and raisesOverflowError(num +:= 9223371962145462840);
    num :=          3037000499; ok := ok and raisesOverflowError(num +:= 9223372033817775309);
    num :=           123456791; ok := ok and raisesOverflowError(num +:= 9223372036731319017);
    num :=            12345653; ok := ok and raisesOverflowError(num +:= 9223372036842430155);
    num :=             9876553; ok := ok and raisesOverflowError(num +:= 9223372036844899255);
    num :=              644443; ok := ok and raisesOverflowError(num +:= 9223372036854131365);
    num :=               38273; ok := ok and raisesOverflowError(num +:= 9223372036854737535);
    num :=                4639; ok := ok and raisesOverflowError(num +:= 9223372036854771169);
    num :=                 857; ok := ok and raisesOverflowError(num +:= 9223372036854774951);
    num :=                  11; ok := ok and raisesOverflowError(num +:= 9223372036854775797);
    num :=                   3; ok := ok and raisesOverflowError(num +:= 9223372036854775805);
    num :=                   2; ok := ok and raisesOverflowError(num +:= 9223372036854775806);
    num :=                   1; ok := ok and raisesOverflowError(num +:= 9223372036854775807);
    if not ok then
      writeln(" ***** Addition assignment overflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num := 9223372036854775807; ok := ok and raisesOverflowError(num +:= intExpr(                  1));
    num := 9223372036854775806; ok := ok and raisesOverflowError(num +:= intExpr(                  2));
    num := 9223372036854775805; ok := ok and raisesOverflowError(num +:= intExpr(                  3));
    num := 9223372036854775797; ok := ok and raisesOverflowError(num +:= intExpr(                 11));
    num := 9223372036854774951; ok := ok and raisesOverflowError(num +:= intExpr(                857));
    num := 9223372036854771169; ok := ok and raisesOverflowError(num +:= intExpr(               4639));
    num := 9223372036854737535; ok := ok and raisesOverflowError(num +:= intExpr(              38273));
    num := 9223372036854131365; ok := ok and raisesOverflowError(num +:= intExpr(             644443));
    num := 9223372036844899255; ok := ok and raisesOverflowError(num +:= intExpr(            9876553));
    num := 9223372036842430155; ok := ok and raisesOverflowError(num +:= intExpr(           12345653));
    num := 9223372036731319017; ok := ok and raisesOverflowError(num +:= intExpr(          123456791));
    num := 9223372033817775309; ok := ok and raisesOverflowError(num +:= intExpr(         3037000499));
    num := 9223371962145462840; ok := ok and raisesOverflowError(num +:= intExpr(        74709312968));
    num := 9223371289760066695; ok := ok and raisesOverflowError(num +:= intExpr(       747094709113));
    num := 9223371102989282771; ok := ok and raisesOverflowError(num +:= intExpr(       933865493037));
    num := 9223357724693674121; ok := ok and raisesOverflowError(num +:= intExpr(     14312161101687));
    num := 9223131047853734480; ok := ok and raisesOverflowError(num +:= intExpr(    240989001041328));
    num := 9221383812660584221; ok := ok and raisesOverflowError(num +:= intExpr(   1988224194191587));
    num := 9212609642412704892; ok := ok and raisesOverflowError(num +:= intExpr(  10762394442070916));
    num := 8384883669867978008; ok := ok and raisesOverflowError(num +:= intExpr( 838488366986797800));
    num := 6148914691236517206; ok := ok and raisesOverflowError(num +:= intExpr(3074457345618258602));
    num := 3074457345618258602; ok := ok and raisesOverflowError(num +:= intExpr(6148914691236517206));
    num :=  838488366986797800; ok := ok and raisesOverflowError(num +:= intExpr(8384883669867978008));
    num :=   10762394442070916; ok := ok and raisesOverflowError(num +:= intExpr(9212609642412704892));
    num :=    1988224194191587; ok := ok and raisesOverflowError(num +:= intExpr(9221383812660584221));
    num :=     240989001041328; ok := ok and raisesOverflowError(num +:= intExpr(9223131047853734480));
    num :=      14312161101687; ok := ok and raisesOverflowError(num +:= intExpr(9223357724693674121));
    num :=        933865493037; ok := ok and raisesOverflowError(num +:= intExpr(9223371102989282771));
    num :=        747094709113; ok := ok and raisesOverflowError(num +:= intExpr(9223371289760066695));
    num :=         74709312968; ok := ok and raisesOverflowError(num +:= intExpr(9223371962145462840));
    num :=          3037000499; ok := ok and raisesOverflowError(num +:= intExpr(9223372033817775309));
    num :=           123456791; ok := ok and raisesOverflowError(num +:= intExpr(9223372036731319017));
    num :=            12345653; ok := ok and raisesOverflowError(num +:= intExpr(9223372036842430155));
    num :=             9876553; ok := ok and raisesOverflowError(num +:= intExpr(9223372036844899255));
    num :=              644443; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854131365));
    num :=               38273; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854737535));
    num :=                4639; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854771169));
    num :=                 857; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854774951));
    num :=                  11; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775797));
    num :=                   3; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775805));
    num :=                   2; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775806));
    num :=                   1; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775807));
    if not ok then
      writeln(" ***** Addition assignment overflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:=                   1);
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:=                   2);
    arr[1] := 9223372036854775805; ok := ok and raisesOverflowError(arr[1] +:=                   3);
    arr[1] := 9223372036854775797; ok := ok and raisesOverflowError(arr[1] +:=                  11);
    arr[1] := 9223372036854774951; ok := ok and raisesOverflowError(arr[1] +:=                 857);
    arr[1] := 9223372036854771169; ok := ok and raisesOverflowError(arr[1] +:=                4639);
    arr[1] := 9223372036854737535; ok := ok and raisesOverflowError(arr[1] +:=               38273);
    arr[1] := 9223372036854131365; ok := ok and raisesOverflowError(arr[1] +:=              644443);
    arr[1] := 9223372036844899255; ok := ok and raisesOverflowError(arr[1] +:=             9876553);
    arr[1] := 9223372036842430155; ok := ok and raisesOverflowError(arr[1] +:=            12345653);
    arr[1] := 9223372036731319017; ok := ok and raisesOverflowError(arr[1] +:=           123456791);
    arr[1] := 9223372033817775309; ok := ok and raisesOverflowError(arr[1] +:=          3037000499);
    arr[1] := 9223371962145462840; ok := ok and raisesOverflowError(arr[1] +:=         74709312968);
    arr[1] := 9223371289760066695; ok := ok and raisesOverflowError(arr[1] +:=        747094709113);
    arr[1] := 9223371102989282771; ok := ok and raisesOverflowError(arr[1] +:=        933865493037);
    arr[1] := 9223357724693674121; ok := ok and raisesOverflowError(arr[1] +:=      14312161101687);
    arr[1] := 9223131047853734480; ok := ok and raisesOverflowError(arr[1] +:=     240989001041328);
    arr[1] := 9221383812660584221; ok := ok and raisesOverflowError(arr[1] +:=    1988224194191587);
    arr[1] := 9212609642412704892; ok := ok and raisesOverflowError(arr[1] +:=   10762394442070916);
    arr[1] := 8384883669867978008; ok := ok and raisesOverflowError(arr[1] +:=  838488366986797800);
    arr[1] := 6148914691236517206; ok := ok and raisesOverflowError(arr[1] +:= 3074457345618258602);
    arr[1] := 3074457345618258602; ok := ok and raisesOverflowError(arr[1] +:= 6148914691236517206);
    arr[1] :=  838488366986797800; ok := ok and raisesOverflowError(arr[1] +:= 8384883669867978008);
    arr[1] :=   10762394442070916; ok := ok and raisesOverflowError(arr[1] +:= 9212609642412704892);
    arr[1] :=    1988224194191587; ok := ok and raisesOverflowError(arr[1] +:= 9221383812660584221);
    arr[1] :=     240989001041328; ok := ok and raisesOverflowError(arr[1] +:= 9223131047853734480);
    arr[1] :=      14312161101687; ok := ok and raisesOverflowError(arr[1] +:= 9223357724693674121);
    arr[1] :=        933865493037; ok := ok and raisesOverflowError(arr[1] +:= 9223371102989282771);
    arr[1] :=        747094709113; ok := ok and raisesOverflowError(arr[1] +:= 9223371289760066695);
    arr[1] :=         74709312968; ok := ok and raisesOverflowError(arr[1] +:= 9223371962145462840);
    arr[1] :=          3037000499; ok := ok and raisesOverflowError(arr[1] +:= 9223372033817775309);
    arr[1] :=           123456791; ok := ok and raisesOverflowError(arr[1] +:= 9223372036731319017);
    arr[1] :=            12345653; ok := ok and raisesOverflowError(arr[1] +:= 9223372036842430155);
    arr[1] :=             9876553; ok := ok and raisesOverflowError(arr[1] +:= 9223372036844899255);
    arr[1] :=              644443; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854131365);
    arr[1] :=               38273; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854737535);
    arr[1] :=                4639; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854771169);
    arr[1] :=                 857; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854774951);
    arr[1] :=                  11; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775797);
    arr[1] :=                   3; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775805);
    arr[1] :=                   2; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775806);
    arr[1] :=                   1; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775807);
    if not ok then
      writeln(" ***** Addition assignment overflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                  1));
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                  2));
    arr[1] := 9223372036854775805; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                  3));
    arr[1] := 9223372036854775797; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                 11));
    arr[1] := 9223372036854774951; ok := ok and raisesOverflowError(arr[1] +:= intExpr(                857));
    arr[1] := 9223372036854771169; ok := ok and raisesOverflowError(arr[1] +:= intExpr(               4639));
    arr[1] := 9223372036854737535; ok := ok and raisesOverflowError(arr[1] +:= intExpr(              38273));
    arr[1] := 9223372036854131365; ok := ok and raisesOverflowError(arr[1] +:= intExpr(             644443));
    arr[1] := 9223372036844899255; ok := ok and raisesOverflowError(arr[1] +:= intExpr(            9876553));
    arr[1] := 9223372036842430155; ok := ok and raisesOverflowError(arr[1] +:= intExpr(           12345653));
    arr[1] := 9223372036731319017; ok := ok and raisesOverflowError(arr[1] +:= intExpr(          123456791));
    arr[1] := 9223372033817775309; ok := ok and raisesOverflowError(arr[1] +:= intExpr(         3037000499));
    arr[1] := 9223371962145462840; ok := ok and raisesOverflowError(arr[1] +:= intExpr(        74709312968));
    arr[1] := 9223371289760066695; ok := ok and raisesOverflowError(arr[1] +:= intExpr(       747094709113));
    arr[1] := 9223371102989282771; ok := ok and raisesOverflowError(arr[1] +:= intExpr(       933865493037));
    arr[1] := 9223357724693674121; ok := ok and raisesOverflowError(arr[1] +:= intExpr(     14312161101687));
    arr[1] := 9223131047853734480; ok := ok and raisesOverflowError(arr[1] +:= intExpr(    240989001041328));
    arr[1] := 9221383812660584221; ok := ok and raisesOverflowError(arr[1] +:= intExpr(   1988224194191587));
    arr[1] := 9212609642412704892; ok := ok and raisesOverflowError(arr[1] +:= intExpr(  10762394442070916));
    arr[1] := 8384883669867978008; ok := ok and raisesOverflowError(arr[1] +:= intExpr( 838488366986797800));
    arr[1] := 6148914691236517206; ok := ok and raisesOverflowError(arr[1] +:= intExpr(3074457345618258602));
    arr[1] := 3074457345618258602; ok := ok and raisesOverflowError(arr[1] +:= intExpr(6148914691236517206));
    arr[1] :=  838488366986797800; ok := ok and raisesOverflowError(arr[1] +:= intExpr(8384883669867978008));
    arr[1] :=   10762394442070916; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9212609642412704892));
    arr[1] :=    1988224194191587; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9221383812660584221));
    arr[1] :=     240989001041328; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223131047853734480));
    arr[1] :=      14312161101687; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223357724693674121));
    arr[1] :=        933865493037; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223371102989282771));
    arr[1] :=        747094709113; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223371289760066695));
    arr[1] :=         74709312968; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223371962145462840));
    arr[1] :=          3037000499; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372033817775309));
    arr[1] :=           123456791; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036731319017));
    arr[1] :=            12345653; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036842430155));
    arr[1] :=             9876553; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036844899255));
    arr[1] :=              644443; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854131365));
    arr[1] :=               38273; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854737535));
    arr[1] :=                4639; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854771169));
    arr[1] :=                 857; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854774951));
    arr[1] :=                  11; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775797));
    arr[1] :=                   3; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775805));
    arr[1] :=                   2; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775806));
    arr[1] :=                   1; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775807));
    if not ok then
      writeln(" ***** Addition assignment overflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num +:=            INT64_MIN);
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num +:= -9223372036854775807);
    num := -9223372036854775807; ok := ok and raisesOverflowError(num +:=            INT64_MIN);
    num := -9223372036854775807; ok := ok and raisesOverflowError(num +:= -9223372036854775807);
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num +:= intExpr(           INT64_MIN));
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854775807));
    num := -9223372036854775807; ok := ok and raisesOverflowError(num +:= intExpr(           INT64_MIN));
    num := -9223372036854775807; ok := ok and raisesOverflowError(num +:= intExpr(-9223372036854775807));
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] +:=            INT64_MIN);
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854775807);
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:=            INT64_MIN);
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= -9223372036854775807);
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] +:= intExpr(           INT64_MIN));
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854775807));
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= intExpr(           INT64_MIN));
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= intExpr(-9223372036854775807));
    if not ok then
      writeln(" ***** Addition assignment underflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    ok := TRUE;
    num := 9223372036854775807; ok := ok and raisesOverflowError(num +:= 9223372036854775807);
    num := 9223372036854775807; ok := ok and raisesOverflowError(num +:= 9223372036854775806);
    num := 9223372036854775806; ok := ok and raisesOverflowError(num +:= 9223372036854775807);
    num := 9223372036854775806; ok := ok and raisesOverflowError(num +:= 9223372036854775806);
    num := 9223372036854775807; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775807));
    num := 9223372036854775807; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775806));
    num := 9223372036854775806; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775807));
    num := 9223372036854775806; ok := ok and raisesOverflowError(num +:= intExpr(9223372036854775806));
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775807);
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775806);
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775807);
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:= 9223372036854775806);
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775807));
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775806));
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775807));
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] +:= intExpr(9223372036854775806));
    if not ok then
      writeln(" ***** Addition assignment overflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of addition assignment works correct.");
    else
      writeln(" ***** Overflow checking of addition assignment does not work correct.");
    end if;
  end func;


const proc: check_subtract is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(           INT64_MIN -                   1) or
        not raisesOverflowError(-9223372036854775807 -                   2) or
        not raisesOverflowError(-9223372036854775806 -                   3) or
        not raisesOverflowError(-9223372036854775798 -                  11) or
        not raisesOverflowError(-9223372036854774952 -                 857) or
        not raisesOverflowError(-9223372036854771170 -                4639) or
        not raisesOverflowError(-9223372036854737536 -               38273) or
        not raisesOverflowError(-9223372036854131366 -              644443) or
        not raisesOverflowError(-9223372036844899256 -             9876553) or
        not raisesOverflowError(-9223372036842430156 -            12345653) or
        not raisesOverflowError(-9223372036731319018 -           123456791) or
        not raisesOverflowError(-9223372033817775310 -          3037000499) or
        not raisesOverflowError(-9223371962145462841 -         74709312968) or
        not raisesOverflowError(-9223371289760066696 -        747094709113) or
        not raisesOverflowError(-9223371102989282772 -        933865493037) or
        not raisesOverflowError(-9223357724693674122 -      14312161101687) or
        not raisesOverflowError(-9223131047853734481 -     240989001041328) or
        not raisesOverflowError(-9221383812660584222 -    1988224194191587) or
        not raisesOverflowError(-9212609642412704893 -   10762394442070916) or
        not raisesOverflowError(-8384883669867978009 -  838488366986797800) or
        not raisesOverflowError(-6148914691236517207 - 3074457345618258602) or
        not raisesOverflowError(-3074457345618258602 - 6148914691236517207) or
        not raisesOverflowError( -838488366986797800 - 8384883669867978009) or
        not raisesOverflowError(  -10762394442070916 - 9212609642412704893) or
        not raisesOverflowError(   -1988224194191587 - 9221383812660584222) or
        not raisesOverflowError(    -240989001041328 - 9223131047853734481) or
        not raisesOverflowError(     -14312161101687 - 9223357724693674122) or
        not raisesOverflowError(       -933865493037 - 9223371102989282772) or
        not raisesOverflowError(       -747094709113 - 9223371289760066696) or
        not raisesOverflowError(        -74709312968 - 9223371962145462841) or
        not raisesOverflowError(         -3037000499 - 9223372033817775310) or
        not raisesOverflowError(          -123456791 - 9223372036731319018) or
        not raisesOverflowError(           -12345653 - 9223372036842430156) or
        not raisesOverflowError(            -9876553 - 9223372036844899256) or
        not raisesOverflowError(             -644443 - 9223372036854131366) or
        not raisesOverflowError(              -38273 - 9223372036854737536) or
        not raisesOverflowError(               -4639 - 9223372036854771170) or
        not raisesOverflowError(                -857 - 9223372036854774952) or
        not raisesOverflowError(                 -11 - 9223372036854775798) or
        not raisesOverflowError(                  -3 - 9223372036854775806) or
        not raisesOverflowError(                  -2 - 9223372036854775807) then
      writeln(" ***** Subtraction underflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) -                   1) or
        not raisesOverflowError(intExpr(-9223372036854775807) -                   2) or
        not raisesOverflowError(intExpr(-9223372036854775806) -                   3) or
        not raisesOverflowError(intExpr(-9223372036854775798) -                  11) or
        not raisesOverflowError(intExpr(-9223372036854774952) -                 857) or
        not raisesOverflowError(intExpr(-9223372036854771170) -                4639) or
        not raisesOverflowError(intExpr(-9223372036854737536) -               38273) or
        not raisesOverflowError(intExpr(-9223372036854131366) -              644443) or
        not raisesOverflowError(intExpr(-9223372036844899256) -             9876553) or
        not raisesOverflowError(intExpr(-9223372036842430156) -            12345653) or
        not raisesOverflowError(intExpr(-9223372036731319018) -           123456791) or
        not raisesOverflowError(intExpr(-9223372033817775310) -          3037000499) or
        not raisesOverflowError(intExpr(-9223371962145462841) -         74709312968) or
        not raisesOverflowError(intExpr(-9223371289760066696) -        747094709113) or
        not raisesOverflowError(intExpr(-9223371102989282772) -        933865493037) or
        not raisesOverflowError(intExpr(-9223357724693674122) -      14312161101687) or
        not raisesOverflowError(intExpr(-9223131047853734481) -     240989001041328) or
        not raisesOverflowError(intExpr(-9221383812660584222) -    1988224194191587) or
        not raisesOverflowError(intExpr(-9212609642412704893) -   10762394442070916) or
        not raisesOverflowError(intExpr(-8384883669867978009) -  838488366986797800) or
        not raisesOverflowError(intExpr(-6148914691236517207) - 3074457345618258602) or
        not raisesOverflowError(intExpr(-3074457345618258602) - 6148914691236517207) or
        not raisesOverflowError(intExpr( -838488366986797800) - 8384883669867978009) or
        not raisesOverflowError(intExpr(  -10762394442070916) - 9212609642412704893) or
        not raisesOverflowError(intExpr(   -1988224194191587) - 9221383812660584222) or
        not raisesOverflowError(intExpr(    -240989001041328) - 9223131047853734481) or
        not raisesOverflowError(intExpr(     -14312161101687) - 9223357724693674122) or
        not raisesOverflowError(intExpr(       -933865493037) - 9223371102989282772) or
        not raisesOverflowError(intExpr(       -747094709113) - 9223371289760066696) or
        not raisesOverflowError(intExpr(        -74709312968) - 9223371962145462841) or
        not raisesOverflowError(intExpr(         -3037000499) - 9223372033817775310) or
        not raisesOverflowError(intExpr(          -123456791) - 9223372036731319018) or
        not raisesOverflowError(intExpr(           -12345653) - 9223372036842430156) or
        not raisesOverflowError(intExpr(            -9876553) - 9223372036844899256) or
        not raisesOverflowError(intExpr(             -644443) - 9223372036854131366) or
        not raisesOverflowError(intExpr(              -38273) - 9223372036854737536) or
        not raisesOverflowError(intExpr(               -4639) - 9223372036854771170) or
        not raisesOverflowError(intExpr(                -857) - 9223372036854774952) or
        not raisesOverflowError(intExpr(                 -11) - 9223372036854775798) or
        not raisesOverflowError(intExpr(                  -3) - 9223372036854775806) or
        not raisesOverflowError(intExpr(                  -2) - 9223372036854775807) then
      writeln(" ***** Subtraction underflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(           INT64_MIN - intExpr(                  1)) or
        not raisesOverflowError(-9223372036854775807 - intExpr(                  2)) or
        not raisesOverflowError(-9223372036854775806 - intExpr(                  3)) or
        not raisesOverflowError(-9223372036854775798 - intExpr(                 11)) or
        not raisesOverflowError(-9223372036854774952 - intExpr(                857)) or
        not raisesOverflowError(-9223372036854771170 - intExpr(               4639)) or
        not raisesOverflowError(-9223372036854737536 - intExpr(              38273)) or
        not raisesOverflowError(-9223372036854131366 - intExpr(             644443)) or
        not raisesOverflowError(-9223372036844899256 - intExpr(            9876553)) or
        not raisesOverflowError(-9223372036842430156 - intExpr(           12345653)) or
        not raisesOverflowError(-9223372036731319018 - intExpr(          123456791)) or
        not raisesOverflowError(-9223372033817775310 - intExpr(         3037000499)) or
        not raisesOverflowError(-9223371962145462841 - intExpr(        74709312968)) or
        not raisesOverflowError(-9223371289760066696 - intExpr(       747094709113)) or
        not raisesOverflowError(-9223371102989282772 - intExpr(       933865493037)) or
        not raisesOverflowError(-9223357724693674122 - intExpr(     14312161101687)) or
        not raisesOverflowError(-9223131047853734481 - intExpr(    240989001041328)) or
        not raisesOverflowError(-9221383812660584222 - intExpr(   1988224194191587)) or
        not raisesOverflowError(-9212609642412704893 - intExpr(  10762394442070916)) or
        not raisesOverflowError(-8384883669867978009 - intExpr( 838488366986797800)) or
        not raisesOverflowError(-6148914691236517207 - intExpr(3074457345618258602)) or
        not raisesOverflowError(-3074457345618258602 - intExpr(6148914691236517207)) or
        not raisesOverflowError( -838488366986797800 - intExpr(8384883669867978009)) or
        not raisesOverflowError(  -10762394442070916 - intExpr(9212609642412704893)) or
        not raisesOverflowError(   -1988224194191587 - intExpr(9221383812660584222)) or
        not raisesOverflowError(    -240989001041328 - intExpr(9223131047853734481)) or
        not raisesOverflowError(     -14312161101687 - intExpr(9223357724693674122)) or
        not raisesOverflowError(       -933865493037 - intExpr(9223371102989282772)) or
        not raisesOverflowError(       -747094709113 - intExpr(9223371289760066696)) or
        not raisesOverflowError(        -74709312968 - intExpr(9223371962145462841)) or
        not raisesOverflowError(         -3037000499 - intExpr(9223372033817775310)) or
        not raisesOverflowError(          -123456791 - intExpr(9223372036731319018)) or
        not raisesOverflowError(           -12345653 - intExpr(9223372036842430156)) or
        not raisesOverflowError(            -9876553 - intExpr(9223372036844899256)) or
        not raisesOverflowError(             -644443 - intExpr(9223372036854131366)) or
        not raisesOverflowError(              -38273 - intExpr(9223372036854737536)) or
        not raisesOverflowError(               -4639 - intExpr(9223372036854771170)) or
        not raisesOverflowError(                -857 - intExpr(9223372036854774952)) or
        not raisesOverflowError(                 -11 - intExpr(9223372036854775798)) or
        not raisesOverflowError(                  -3 - intExpr(9223372036854775806)) or
        not raisesOverflowError(                  -2 - intExpr(9223372036854775807)) then
      writeln(" ***** Subtraction underflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) - intExpr(                  1)) or
        not raisesOverflowError(intExpr(-9223372036854775807) - intExpr(                  2)) or
        not raisesOverflowError(intExpr(-9223372036854775806) - intExpr(                  3)) or
        not raisesOverflowError(intExpr(-9223372036854775798) - intExpr(                 11)) or
        not raisesOverflowError(intExpr(-9223372036854774952) - intExpr(                857)) or
        not raisesOverflowError(intExpr(-9223372036854771170) - intExpr(               4639)) or
        not raisesOverflowError(intExpr(-9223372036854737536) - intExpr(              38273)) or
        not raisesOverflowError(intExpr(-9223372036854131366) - intExpr(             644443)) or
        not raisesOverflowError(intExpr(-9223372036844899256) - intExpr(            9876553)) or
        not raisesOverflowError(intExpr(-9223372036842430156) - intExpr(           12345653)) or
        not raisesOverflowError(intExpr(-9223372036731319018) - intExpr(          123456791)) or
        not raisesOverflowError(intExpr(-9223372033817775310) - intExpr(         3037000499)) or
        not raisesOverflowError(intExpr(-9223371962145462841) - intExpr(        74709312968)) or
        not raisesOverflowError(intExpr(-9223371289760066696) - intExpr(       747094709113)) or
        not raisesOverflowError(intExpr(-9223371102989282772) - intExpr(       933865493037)) or
        not raisesOverflowError(intExpr(-9223357724693674122) - intExpr(     14312161101687)) or
        not raisesOverflowError(intExpr(-9223131047853734481) - intExpr(    240989001041328)) or
        not raisesOverflowError(intExpr(-9221383812660584222) - intExpr(   1988224194191587)) or
        not raisesOverflowError(intExpr(-9212609642412704893) - intExpr(  10762394442070916)) or
        not raisesOverflowError(intExpr(-8384883669867978009) - intExpr( 838488366986797800)) or
        not raisesOverflowError(intExpr(-6148914691236517207) - intExpr(3074457345618258602)) or
        not raisesOverflowError(intExpr(-3074457345618258602) - intExpr(6148914691236517207)) or
        not raisesOverflowError(intExpr( -838488366986797800) - intExpr(8384883669867978009)) or
        not raisesOverflowError(intExpr(  -10762394442070916) - intExpr(9212609642412704893)) or
        not raisesOverflowError(intExpr(   -1988224194191587) - intExpr(9221383812660584222)) or
        not raisesOverflowError(intExpr(    -240989001041328) - intExpr(9223131047853734481)) or
        not raisesOverflowError(intExpr(     -14312161101687) - intExpr(9223357724693674122)) or
        not raisesOverflowError(intExpr(       -933865493037) - intExpr(9223371102989282772)) or
        not raisesOverflowError(intExpr(       -747094709113) - intExpr(9223371289760066696)) or
        not raisesOverflowError(intExpr(        -74709312968) - intExpr(9223371962145462841)) or
        not raisesOverflowError(intExpr(         -3037000499) - intExpr(9223372033817775310)) or
        not raisesOverflowError(intExpr(          -123456791) - intExpr(9223372036731319018)) or
        not raisesOverflowError(intExpr(           -12345653) - intExpr(9223372036842430156)) or
        not raisesOverflowError(intExpr(            -9876553) - intExpr(9223372036844899256)) or
        not raisesOverflowError(intExpr(             -644443) - intExpr(9223372036854131366)) or
        not raisesOverflowError(intExpr(              -38273) - intExpr(9223372036854737536)) or
        not raisesOverflowError(intExpr(               -4639) - intExpr(9223372036854771170)) or
        not raisesOverflowError(intExpr(                -857) - intExpr(9223372036854774952)) or
        not raisesOverflowError(intExpr(                 -11) - intExpr(9223372036854775798)) or
        not raisesOverflowError(intExpr(                  -3) - intExpr(9223372036854775806)) or
        not raisesOverflowError(intExpr(                  -2) - intExpr(9223372036854775807)) then
      writeln(" ***** Subtraction underflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(9223372036854775807 -                   -1) or
        not raisesOverflowError(9223372036854775806 -                   -2) or
        not raisesOverflowError(9223372036854775805 -                   -3) or
        not raisesOverflowError(9223372036854775797 -                  -11) or
        not raisesOverflowError(9223372036854774951 -                 -857) or
        not raisesOverflowError(9223372036854771169 -                -4639) or
        not raisesOverflowError(9223372036854737535 -               -38273) or
        not raisesOverflowError(9223372036854131365 -              -644443) or
        not raisesOverflowError(9223372036844899255 -             -9876553) or
        not raisesOverflowError(9223372036842430155 -            -12345653) or
        not raisesOverflowError(9223372036731319017 -           -123456791) or
        not raisesOverflowError(9223372033817775309 -          -3037000499) or
        not raisesOverflowError(9223371962145462840 -         -74709312968) or
        not raisesOverflowError(9223371289760066695 -        -747094709113) or
        not raisesOverflowError(9223371102989282771 -        -933865493037) or
        not raisesOverflowError(9223357724693674121 -      -14312161101687) or
        not raisesOverflowError(9223131047853734480 -     -240989001041328) or
        not raisesOverflowError(9221383812660584221 -    -1988224194191587) or
        not raisesOverflowError(9212609642412704892 -   -10762394442070916) or
        not raisesOverflowError(8384883669867978008 -  -838488366986797800) or
        not raisesOverflowError(6148914691236517206 - -3074457345618258602) or
        not raisesOverflowError(3074457345618258602 - -6148914691236517206) or
        not raisesOverflowError( 838488366986797800 - -8384883669867978008) or
        not raisesOverflowError(  10762394442070916 - -9212609642412704892) or
        not raisesOverflowError(   1988224194191587 - -9221383812660584221) or
        not raisesOverflowError(    240989001041328 - -9223131047853734480) or
        not raisesOverflowError(     14312161101687 - -9223357724693674121) or
        not raisesOverflowError(       933865493037 - -9223371102989282771) or
        not raisesOverflowError(       747094709113 - -9223371289760066695) or
        not raisesOverflowError(        74709312968 - -9223371962145462840) or
        not raisesOverflowError(         3037000499 - -9223372033817775309) or
        not raisesOverflowError(          123456791 - -9223372036731319017) or
        not raisesOverflowError(           12345653 - -9223372036842430155) or
        not raisesOverflowError(            9876553 - -9223372036844899255) or
        not raisesOverflowError(             644443 - -9223372036854131365) or
        not raisesOverflowError(              38273 - -9223372036854737535) or
        not raisesOverflowError(               4639 - -9223372036854771169) or
        not raisesOverflowError(                857 - -9223372036854774951) or
        not raisesOverflowError(                 11 - -9223372036854775797) or
        not raisesOverflowError(                  3 - -9223372036854775805) or
        not raisesOverflowError(                  2 - -9223372036854775806) or
        not raisesOverflowError(                  1 - -9223372036854775807) or
        not raisesOverflowError(                  0 -            INT64_MIN) then
      writeln(" ***** Subtraction overflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(9223372036854775807) -                   -1) or
        not raisesOverflowError(intExpr(9223372036854775806) -                   -2) or
        not raisesOverflowError(intExpr(9223372036854775805) -                   -3) or
        not raisesOverflowError(intExpr(9223372036854775797) -                  -11) or
        not raisesOverflowError(intExpr(9223372036854774951) -                 -857) or
        not raisesOverflowError(intExpr(9223372036854771169) -                -4639) or
        not raisesOverflowError(intExpr(9223372036854737535) -               -38273) or
        not raisesOverflowError(intExpr(9223372036854131365) -              -644443) or
        not raisesOverflowError(intExpr(9223372036844899255) -             -9876553) or
        not raisesOverflowError(intExpr(9223372036842430155) -            -12345653) or
        not raisesOverflowError(intExpr(9223372036731319017) -           -123456791) or
        not raisesOverflowError(intExpr(9223372033817775309) -          -3037000499) or
        not raisesOverflowError(intExpr(9223371962145462840) -         -74709312968) or
        not raisesOverflowError(intExpr(9223371289760066695) -        -747094709113) or
        not raisesOverflowError(intExpr(9223371102989282771) -        -933865493037) or
        not raisesOverflowError(intExpr(9223357724693674121) -      -14312161101687) or
        not raisesOverflowError(intExpr(9223131047853734480) -     -240989001041328) or
        not raisesOverflowError(intExpr(9221383812660584221) -    -1988224194191587) or
        not raisesOverflowError(intExpr(9212609642412704892) -   -10762394442070916) or
        not raisesOverflowError(intExpr(8384883669867978008) -  -838488366986797800) or
        not raisesOverflowError(intExpr(6148914691236517206) - -3074457345618258602) or
        not raisesOverflowError(intExpr(3074457345618258602) - -6148914691236517206) or
        not raisesOverflowError(intExpr( 838488366986797800) - -8384883669867978008) or
        not raisesOverflowError(intExpr(  10762394442070916) - -9212609642412704892) or
        not raisesOverflowError(intExpr(   1988224194191587) - -9221383812660584221) or
        not raisesOverflowError(intExpr(    240989001041328) - -9223131047853734480) or
        not raisesOverflowError(intExpr(     14312161101687) - -9223357724693674121) or
        not raisesOverflowError(intExpr(       933865493037) - -9223371102989282771) or
        not raisesOverflowError(intExpr(       747094709113) - -9223371289760066695) or
        not raisesOverflowError(intExpr(        74709312968) - -9223371962145462840) or
        not raisesOverflowError(intExpr(         3037000499) - -9223372033817775309) or
        not raisesOverflowError(intExpr(          123456791) - -9223372036731319017) or
        not raisesOverflowError(intExpr(           12345653) - -9223372036842430155) or
        not raisesOverflowError(intExpr(            9876553) - -9223372036844899255) or
        not raisesOverflowError(intExpr(             644443) - -9223372036854131365) or
        not raisesOverflowError(intExpr(              38273) - -9223372036854737535) or
        not raisesOverflowError(intExpr(               4639) - -9223372036854771169) or
        not raisesOverflowError(intExpr(                857) - -9223372036854774951) or
        not raisesOverflowError(intExpr(                 11) - -9223372036854775797) or
        not raisesOverflowError(intExpr(                  3) - -9223372036854775805) or
        not raisesOverflowError(intExpr(                  2) - -9223372036854775806) or
        not raisesOverflowError(intExpr(                  1) - -9223372036854775807) or
        not raisesOverflowError(intExpr(                  0) -            INT64_MIN) then
      writeln(" ***** Subtraction overflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(9223372036854775807 - intExpr(                  -1)) or
        not raisesOverflowError(9223372036854775806 - intExpr(                  -2)) or
        not raisesOverflowError(9223372036854775805 - intExpr(                  -3)) or
        not raisesOverflowError(9223372036854775797 - intExpr(                 -11)) or
        not raisesOverflowError(9223372036854774951 - intExpr(                -857)) or
        not raisesOverflowError(9223372036854771169 - intExpr(               -4639)) or
        not raisesOverflowError(9223372036854737535 - intExpr(              -38273)) or
        not raisesOverflowError(9223372036854131365 - intExpr(             -644443)) or
        not raisesOverflowError(9223372036844899255 - intExpr(            -9876553)) or
        not raisesOverflowError(9223372036842430155 - intExpr(           -12345653)) or
        not raisesOverflowError(9223372036731319017 - intExpr(          -123456791)) or
        not raisesOverflowError(9223372033817775309 - intExpr(         -3037000499)) or
        not raisesOverflowError(9223371962145462840 - intExpr(        -74709312968)) or
        not raisesOverflowError(9223371289760066695 - intExpr(       -747094709113)) or
        not raisesOverflowError(9223371102989282771 - intExpr(       -933865493037)) or
        not raisesOverflowError(9223357724693674121 - intExpr(     -14312161101687)) or
        not raisesOverflowError(9223131047853734480 - intExpr(    -240989001041328)) or
        not raisesOverflowError(9221383812660584221 - intExpr(   -1988224194191587)) or
        not raisesOverflowError(9212609642412704892 - intExpr(  -10762394442070916)) or
        not raisesOverflowError(8384883669867978008 - intExpr( -838488366986797800)) or
        not raisesOverflowError(6148914691236517206 - intExpr(-3074457345618258602)) or
        not raisesOverflowError(3074457345618258602 - intExpr(-6148914691236517206)) or
        not raisesOverflowError( 838488366986797800 - intExpr(-8384883669867978008)) or
        not raisesOverflowError(  10762394442070916 - intExpr(-9212609642412704892)) or
        not raisesOverflowError(   1988224194191587 - intExpr(-9221383812660584221)) or
        not raisesOverflowError(    240989001041328 - intExpr(-9223131047853734480)) or
        not raisesOverflowError(     14312161101687 - intExpr(-9223357724693674121)) or
        not raisesOverflowError(       933865493037 - intExpr(-9223371102989282771)) or
        not raisesOverflowError(       747094709113 - intExpr(-9223371289760066695)) or
        not raisesOverflowError(        74709312968 - intExpr(-9223371962145462840)) or
        not raisesOverflowError(         3037000499 - intExpr(-9223372033817775309)) or
        not raisesOverflowError(          123456791 - intExpr(-9223372036731319017)) or
        not raisesOverflowError(           12345653 - intExpr(-9223372036842430155)) or
        not raisesOverflowError(            9876553 - intExpr(-9223372036844899255)) or
        not raisesOverflowError(             644443 - intExpr(-9223372036854131365)) or
        not raisesOverflowError(              38273 - intExpr(-9223372036854737535)) or
        not raisesOverflowError(               4639 - intExpr(-9223372036854771169)) or
        not raisesOverflowError(                857 - intExpr(-9223372036854774951)) or
        not raisesOverflowError(                 11 - intExpr(-9223372036854775797)) or
        not raisesOverflowError(                  3 - intExpr(-9223372036854775805)) or
        not raisesOverflowError(                  2 - intExpr(-9223372036854775806)) or
        not raisesOverflowError(                  1 - intExpr(-9223372036854775807)) or
        not raisesOverflowError(                  0 - intExpr(           INT64_MIN)) then
      writeln(" ***** Subtraction overflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(9223372036854775807) - intExpr(                  -1)) or
        not raisesOverflowError(intExpr(9223372036854775806) - intExpr(                  -2)) or
        not raisesOverflowError(intExpr(9223372036854775805) - intExpr(                  -3)) or
        not raisesOverflowError(intExpr(9223372036854775797) - intExpr(                 -11)) or
        not raisesOverflowError(intExpr(9223372036854774951) - intExpr(                -857)) or
        not raisesOverflowError(intExpr(9223372036854771169) - intExpr(               -4639)) or
        not raisesOverflowError(intExpr(9223372036854737535) - intExpr(              -38273)) or
        not raisesOverflowError(intExpr(9223372036854131365) - intExpr(             -644443)) or
        not raisesOverflowError(intExpr(9223372036844899255) - intExpr(            -9876553)) or
        not raisesOverflowError(intExpr(9223372036842430155) - intExpr(           -12345653)) or
        not raisesOverflowError(intExpr(9223372036731319017) - intExpr(          -123456791)) or
        not raisesOverflowError(intExpr(9223372033817775309) - intExpr(         -3037000499)) or
        not raisesOverflowError(intExpr(9223371962145462840) - intExpr(        -74709312968)) or
        not raisesOverflowError(intExpr(9223371289760066695) - intExpr(       -747094709113)) or
        not raisesOverflowError(intExpr(9223371102989282771) - intExpr(       -933865493037)) or
        not raisesOverflowError(intExpr(9223357724693674121) - intExpr(     -14312161101687)) or
        not raisesOverflowError(intExpr(9223131047853734480) - intExpr(    -240989001041328)) or
        not raisesOverflowError(intExpr(9221383812660584221) - intExpr(   -1988224194191587)) or
        not raisesOverflowError(intExpr(9212609642412704892) - intExpr(  -10762394442070916)) or
        not raisesOverflowError(intExpr(8384883669867978008) - intExpr( -838488366986797800)) or
        not raisesOverflowError(intExpr(6148914691236517206) - intExpr(-3074457345618258602)) or
        not raisesOverflowError(intExpr(3074457345618258602) - intExpr(-6148914691236517206)) or
        not raisesOverflowError(intExpr( 838488366986797800) - intExpr(-8384883669867978008)) or
        not raisesOverflowError(intExpr(  10762394442070916) - intExpr(-9212609642412704892)) or
        not raisesOverflowError(intExpr(   1988224194191587) - intExpr(-9221383812660584221)) or
        not raisesOverflowError(intExpr(    240989001041328) - intExpr(-9223131047853734480)) or
        not raisesOverflowError(intExpr(     14312161101687) - intExpr(-9223357724693674121)) or
        not raisesOverflowError(intExpr(       933865493037) - intExpr(-9223371102989282771)) or
        not raisesOverflowError(intExpr(       747094709113) - intExpr(-9223371289760066695)) or
        not raisesOverflowError(intExpr(        74709312968) - intExpr(-9223371962145462840)) or
        not raisesOverflowError(intExpr(         3037000499) - intExpr(-9223372033817775309)) or
        not raisesOverflowError(intExpr(          123456791) - intExpr(-9223372036731319017)) or
        not raisesOverflowError(intExpr(           12345653) - intExpr(-9223372036842430155)) or
        not raisesOverflowError(intExpr(            9876553) - intExpr(-9223372036844899255)) or
        not raisesOverflowError(intExpr(             644443) - intExpr(-9223372036854131365)) or
        not raisesOverflowError(intExpr(              38273) - intExpr(-9223372036854737535)) or
        not raisesOverflowError(intExpr(               4639) - intExpr(-9223372036854771169)) or
        not raisesOverflowError(intExpr(                857) - intExpr(-9223372036854774951)) or
        not raisesOverflowError(intExpr(                 11) - intExpr(-9223372036854775797)) or
        not raisesOverflowError(intExpr(                  3) - intExpr(-9223372036854775805)) or
        not raisesOverflowError(intExpr(                  2) - intExpr(-9223372036854775806)) or
        not raisesOverflowError(intExpr(                  1) - intExpr(-9223372036854775807)) or
        not raisesOverflowError(intExpr(                  0) - intExpr(           INT64_MIN)) then
      writeln(" ***** Subtraction overflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(           INT64_MIN - 9223372036854775807) or
        not raisesOverflowError(           INT64_MIN - 9223372036854775806) or
        not raisesOverflowError(-9223372036854775807 - 9223372036854775807) or
        not raisesOverflowError(-9223372036854775807 - 9223372036854775806) or
        not raisesOverflowError(intExpr(           INT64_MIN) - 9223372036854775807) or
        not raisesOverflowError(intExpr(           INT64_MIN) - 9223372036854775806) or
        not raisesOverflowError(intExpr(-9223372036854775807) - 9223372036854775807) or
        not raisesOverflowError(intExpr(-9223372036854775807) - 9223372036854775806) or
        not raisesOverflowError(           INT64_MIN - intExpr(9223372036854775807)) or
        not raisesOverflowError(           INT64_MIN - intExpr(9223372036854775806)) or
        not raisesOverflowError(-9223372036854775807 - intExpr(9223372036854775807)) or
        not raisesOverflowError(-9223372036854775807 - intExpr(9223372036854775806)) or
        not raisesOverflowError(intExpr(           INT64_MIN) - intExpr(9223372036854775807)) or
        not raisesOverflowError(intExpr(           INT64_MIN) - intExpr(9223372036854775806)) or
        not raisesOverflowError(intExpr(-9223372036854775807) - intExpr(9223372036854775807)) or
        not raisesOverflowError(intExpr(-9223372036854775807) - intExpr(9223372036854775806)) then
      writeln(" ***** Subtraction underflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(9223372036854775807 -            INT64_MIN) or
        not raisesOverflowError(9223372036854775807 - -9223372036854775807) or
        not raisesOverflowError(9223372036854775806 -            INT64_MIN) or
        not raisesOverflowError(9223372036854775806 - -9223372036854775807) or
        not raisesOverflowError(intExpr(9223372036854775807) -            INT64_MIN) or
        not raisesOverflowError(intExpr(9223372036854775807) - -9223372036854775807) or
        not raisesOverflowError(intExpr(9223372036854775806) -            INT64_MIN) or
        not raisesOverflowError(intExpr(9223372036854775806) - -9223372036854775807) or
        not raisesOverflowError(9223372036854775807 - intExpr(           INT64_MIN)) or
        not raisesOverflowError(9223372036854775807 - intExpr(-9223372036854775807)) or
        not raisesOverflowError(9223372036854775806 - intExpr(           INT64_MIN)) or
        not raisesOverflowError(9223372036854775806 - intExpr(-9223372036854775807)) or
        not raisesOverflowError(intExpr(9223372036854775807) - intExpr(           INT64_MIN)) or
        not raisesOverflowError(intExpr(9223372036854775807) - intExpr(-9223372036854775807)) or
        not raisesOverflowError(intExpr(9223372036854775806) - intExpr(           INT64_MIN)) or
        not raisesOverflowError(intExpr(9223372036854775806) - intExpr(-9223372036854775807)) then
      writeln(" ***** Subtraction overflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of subtraction works correct.");
    else
      writeln(" ***** Overflow checking of subtraction does not work correct.");
    end if;
  end func;


const proc: check_subtract_assign is func
  local
    var boolean: okay is TRUE;
    var boolean: ok is TRUE;
    var integer: num is 0;
    var array integer: arr is [] (0);
  begin
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num -:=                   1);
    num := -9223372036854775807; ok := ok and raisesOverflowError(num -:=                   2);
    num := -9223372036854775806; ok := ok and raisesOverflowError(num -:=                   3);
    num := -9223372036854775798; ok := ok and raisesOverflowError(num -:=                  11);
    num := -9223372036854774952; ok := ok and raisesOverflowError(num -:=                 857);
    num := -9223372036854771170; ok := ok and raisesOverflowError(num -:=                4639);
    num := -9223372036854737536; ok := ok and raisesOverflowError(num -:=               38273);
    num := -9223372036854131366; ok := ok and raisesOverflowError(num -:=              644443);
    num := -9223372036844899256; ok := ok and raisesOverflowError(num -:=             9876553);
    num := -9223372036842430156; ok := ok and raisesOverflowError(num -:=            12345653);
    num := -9223372036731319018; ok := ok and raisesOverflowError(num -:=           123456791);
    num := -9223372033817775310; ok := ok and raisesOverflowError(num -:=          3037000499);
    num := -9223371962145462841; ok := ok and raisesOverflowError(num -:=         74709312968);
    num := -9223371289760066696; ok := ok and raisesOverflowError(num -:=        747094709113);
    num := -9223371102989282772; ok := ok and raisesOverflowError(num -:=        933865493037);
    num := -9223357724693674122; ok := ok and raisesOverflowError(num -:=      14312161101687);
    num := -9223131047853734481; ok := ok and raisesOverflowError(num -:=     240989001041328);
    num := -9221383812660584222; ok := ok and raisesOverflowError(num -:=    1988224194191587);
    num := -9212609642412704893; ok := ok and raisesOverflowError(num -:=   10762394442070916);
    num := -8384883669867978009; ok := ok and raisesOverflowError(num -:=  838488366986797800);
    num := -6148914691236517207; ok := ok and raisesOverflowError(num -:= 3074457345618258602);
    num := -3074457345618258602; ok := ok and raisesOverflowError(num -:= 6148914691236517207);
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num -:= 8384883669867978009);
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num -:= 9212609642412704893);
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num -:= 9221383812660584222);
    num :=     -240989001041328; ok := ok and raisesOverflowError(num -:= 9223131047853734481);
    num :=      -14312161101687; ok := ok and raisesOverflowError(num -:= 9223357724693674122);
    num :=        -933865493037; ok := ok and raisesOverflowError(num -:= 9223371102989282772);
    num :=        -747094709113; ok := ok and raisesOverflowError(num -:= 9223371289760066696);
    num :=         -74709312968; ok := ok and raisesOverflowError(num -:= 9223371962145462841);
    num :=          -3037000499; ok := ok and raisesOverflowError(num -:= 9223372033817775310);
    num :=           -123456791; ok := ok and raisesOverflowError(num -:= 9223372036731319018);
    num :=            -12345653; ok := ok and raisesOverflowError(num -:= 9223372036842430156);
    num :=             -9876553; ok := ok and raisesOverflowError(num -:= 9223372036844899256);
    num :=              -644443; ok := ok and raisesOverflowError(num -:= 9223372036854131366);
    num :=               -38273; ok := ok and raisesOverflowError(num -:= 9223372036854737536);
    num :=                -4639; ok := ok and raisesOverflowError(num -:= 9223372036854771170);
    num :=                 -857; ok := ok and raisesOverflowError(num -:= 9223372036854774952);
    num :=                  -11; ok := ok and raisesOverflowError(num -:= 9223372036854775798);
    num :=                   -3; ok := ok and raisesOverflowError(num -:= 9223372036854775806);
    num :=                   -2; ok := ok and raisesOverflowError(num -:= 9223372036854775807);
    if not ok then
      writeln(" ***** Subtraction assignment underflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num -:= intExpr(                  1));
    num := -9223372036854775807; ok := ok and raisesOverflowError(num -:= intExpr(                  2));
    num := -9223372036854775806; ok := ok and raisesOverflowError(num -:= intExpr(                  3));
    num := -9223372036854775798; ok := ok and raisesOverflowError(num -:= intExpr(                 11));
    num := -9223372036854774952; ok := ok and raisesOverflowError(num -:= intExpr(                857));
    num := -9223372036854771170; ok := ok and raisesOverflowError(num -:= intExpr(               4639));
    num := -9223372036854737536; ok := ok and raisesOverflowError(num -:= intExpr(              38273));
    num := -9223372036854131366; ok := ok and raisesOverflowError(num -:= intExpr(             644443));
    num := -9223372036844899256; ok := ok and raisesOverflowError(num -:= intExpr(            9876553));
    num := -9223372036842430156; ok := ok and raisesOverflowError(num -:= intExpr(           12345653));
    num := -9223372036731319018; ok := ok and raisesOverflowError(num -:= intExpr(          123456791));
    num := -9223372033817775310; ok := ok and raisesOverflowError(num -:= intExpr(         3037000499));
    num := -9223371962145462841; ok := ok and raisesOverflowError(num -:= intExpr(        74709312968));
    num := -9223371289760066696; ok := ok and raisesOverflowError(num -:= intExpr(       747094709113));
    num := -9223371102989282772; ok := ok and raisesOverflowError(num -:= intExpr(       933865493037));
    num := -9223357724693674122; ok := ok and raisesOverflowError(num -:= intExpr(     14312161101687));
    num := -9223131047853734481; ok := ok and raisesOverflowError(num -:= intExpr(    240989001041328));
    num := -9221383812660584222; ok := ok and raisesOverflowError(num -:= intExpr(   1988224194191587));
    num := -9212609642412704893; ok := ok and raisesOverflowError(num -:= intExpr(  10762394442070916));
    num := -8384883669867978009; ok := ok and raisesOverflowError(num -:= intExpr( 838488366986797800));
    num := -6148914691236517207; ok := ok and raisesOverflowError(num -:= intExpr(3074457345618258602));
    num := -3074457345618258602; ok := ok and raisesOverflowError(num -:= intExpr(6148914691236517207));
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num -:= intExpr(8384883669867978009));
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num -:= intExpr(9212609642412704893));
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num -:= intExpr(9221383812660584222));
    num :=     -240989001041328; ok := ok and raisesOverflowError(num -:= intExpr(9223131047853734481));
    num :=      -14312161101687; ok := ok and raisesOverflowError(num -:= intExpr(9223357724693674122));
    num :=        -933865493037; ok := ok and raisesOverflowError(num -:= intExpr(9223371102989282772));
    num :=        -747094709113; ok := ok and raisesOverflowError(num -:= intExpr(9223371289760066696));
    num :=         -74709312968; ok := ok and raisesOverflowError(num -:= intExpr(9223371962145462841));
    num :=          -3037000499; ok := ok and raisesOverflowError(num -:= intExpr(9223372033817775310));
    num :=           -123456791; ok := ok and raisesOverflowError(num -:= intExpr(9223372036731319018));
    num :=            -12345653; ok := ok and raisesOverflowError(num -:= intExpr(9223372036842430156));
    num :=             -9876553; ok := ok and raisesOverflowError(num -:= intExpr(9223372036844899256));
    num :=              -644443; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854131366));
    num :=               -38273; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854737536));
    num :=                -4639; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854771170));
    num :=                 -857; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854774952));
    num :=                  -11; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854775798));
    num :=                   -3; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854775806));
    num :=                   -2; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854775807));
    if not ok then
      writeln(" ***** Subtraction assignment underflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] -:=                   1);
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:=                   2);
    arr[1] := -9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:=                   3);
    arr[1] := -9223372036854775798; ok := ok and raisesOverflowError(arr[1] -:=                  11);
    arr[1] := -9223372036854774952; ok := ok and raisesOverflowError(arr[1] -:=                 857);
    arr[1] := -9223372036854771170; ok := ok and raisesOverflowError(arr[1] -:=                4639);
    arr[1] := -9223372036854737536; ok := ok and raisesOverflowError(arr[1] -:=               38273);
    arr[1] := -9223372036854131366; ok := ok and raisesOverflowError(arr[1] -:=              644443);
    arr[1] := -9223372036844899256; ok := ok and raisesOverflowError(arr[1] -:=             9876553);
    arr[1] := -9223372036842430156; ok := ok and raisesOverflowError(arr[1] -:=            12345653);
    arr[1] := -9223372036731319018; ok := ok and raisesOverflowError(arr[1] -:=           123456791);
    arr[1] := -9223372033817775310; ok := ok and raisesOverflowError(arr[1] -:=          3037000499);
    arr[1] := -9223371962145462841; ok := ok and raisesOverflowError(arr[1] -:=         74709312968);
    arr[1] := -9223371289760066696; ok := ok and raisesOverflowError(arr[1] -:=        747094709113);
    arr[1] := -9223371102989282772; ok := ok and raisesOverflowError(arr[1] -:=        933865493037);
    arr[1] := -9223357724693674122; ok := ok and raisesOverflowError(arr[1] -:=      14312161101687);
    arr[1] := -9223131047853734481; ok := ok and raisesOverflowError(arr[1] -:=     240989001041328);
    arr[1] := -9221383812660584222; ok := ok and raisesOverflowError(arr[1] -:=    1988224194191587);
    arr[1] := -9212609642412704893; ok := ok and raisesOverflowError(arr[1] -:=   10762394442070916);
    arr[1] := -8384883669867978009; ok := ok and raisesOverflowError(arr[1] -:=  838488366986797800);
    arr[1] := -6148914691236517207; ok := ok and raisesOverflowError(arr[1] -:= 3074457345618258602);
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] -:= 6148914691236517207);
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] -:= 8384883669867978009);
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] -:= 9212609642412704893);
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] -:= 9221383812660584222);
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] -:= 9223131047853734481);
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] -:= 9223357724693674122);
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] -:= 9223371102989282772);
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] -:= 9223371289760066696);
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] -:= 9223371962145462841);
    arr[1] :=          -3037000499; ok := ok and raisesOverflowError(arr[1] -:= 9223372033817775310);
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] -:= 9223372036731319018);
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] -:= 9223372036842430156);
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] -:= 9223372036844899256);
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854131366);
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854737536);
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854771170);
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854774952);
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854775798);
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854775806);
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854775807);
    if not ok then
      writeln(" ***** Subtraction assignment underflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                  1));
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                  2));
    arr[1] := -9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                  3));
    arr[1] := -9223372036854775798; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                 11));
    arr[1] := -9223372036854774952; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                857));
    arr[1] := -9223372036854771170; ok := ok and raisesOverflowError(arr[1] -:= intExpr(               4639));
    arr[1] := -9223372036854737536; ok := ok and raisesOverflowError(arr[1] -:= intExpr(              38273));
    arr[1] := -9223372036854131366; ok := ok and raisesOverflowError(arr[1] -:= intExpr(             644443));
    arr[1] := -9223372036844899256; ok := ok and raisesOverflowError(arr[1] -:= intExpr(            9876553));
    arr[1] := -9223372036842430156; ok := ok and raisesOverflowError(arr[1] -:= intExpr(           12345653));
    arr[1] := -9223372036731319018; ok := ok and raisesOverflowError(arr[1] -:= intExpr(          123456791));
    arr[1] := -9223372033817775310; ok := ok and raisesOverflowError(arr[1] -:= intExpr(         3037000499));
    arr[1] := -9223371962145462841; ok := ok and raisesOverflowError(arr[1] -:= intExpr(        74709312968));
    arr[1] := -9223371289760066696; ok := ok and raisesOverflowError(arr[1] -:= intExpr(       747094709113));
    arr[1] := -9223371102989282772; ok := ok and raisesOverflowError(arr[1] -:= intExpr(       933865493037));
    arr[1] := -9223357724693674122; ok := ok and raisesOverflowError(arr[1] -:= intExpr(     14312161101687));
    arr[1] := -9223131047853734481; ok := ok and raisesOverflowError(arr[1] -:= intExpr(    240989001041328));
    arr[1] := -9221383812660584222; ok := ok and raisesOverflowError(arr[1] -:= intExpr(   1988224194191587));
    arr[1] := -9212609642412704893; ok := ok and raisesOverflowError(arr[1] -:= intExpr(  10762394442070916));
    arr[1] := -8384883669867978009; ok := ok and raisesOverflowError(arr[1] -:= intExpr( 838488366986797800));
    arr[1] := -6148914691236517207; ok := ok and raisesOverflowError(arr[1] -:= intExpr(3074457345618258602));
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] -:= intExpr(6148914691236517207));
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] -:= intExpr(8384883669867978009));
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9212609642412704893));
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9221383812660584222));
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223131047853734481));
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223357724693674122));
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223371102989282772));
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223371289760066696));
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223371962145462841));
    arr[1] :=          -3037000499; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372033817775310));
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036731319018));
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036842430156));
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036844899256));
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854131366));
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854737536));
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854771170));
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854774952));
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854775798));
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854775806));
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854775807));
    if not ok then
      writeln(" ***** Subtraction assignment underflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num := 9223372036854775807; ok := ok and raisesOverflowError(num -:=                   -1);
    num := 9223372036854775806; ok := ok and raisesOverflowError(num -:=                   -2);
    num := 9223372036854775805; ok := ok and raisesOverflowError(num -:=                   -3);
    num := 9223372036854775797; ok := ok and raisesOverflowError(num -:=                  -11);
    num := 9223372036854774951; ok := ok and raisesOverflowError(num -:=                 -857);
    num := 9223372036854771169; ok := ok and raisesOverflowError(num -:=                -4639);
    num := 9223372036854737535; ok := ok and raisesOverflowError(num -:=               -38273);
    num := 9223372036854131365; ok := ok and raisesOverflowError(num -:=              -644443);
    num := 9223372036844899255; ok := ok and raisesOverflowError(num -:=             -9876553);
    num := 9223372036842430155; ok := ok and raisesOverflowError(num -:=            -12345653);
    num := 9223372036731319017; ok := ok and raisesOverflowError(num -:=           -123456791);
    num := 9223372033817775309; ok := ok and raisesOverflowError(num -:=          -3037000499);
    num := 9223371962145462840; ok := ok and raisesOverflowError(num -:=         -74709312968);
    num := 9223371289760066695; ok := ok and raisesOverflowError(num -:=        -747094709113);
    num := 9223371102989282771; ok := ok and raisesOverflowError(num -:=        -933865493037);
    num := 9223357724693674121; ok := ok and raisesOverflowError(num -:=      -14312161101687);
    num := 9223131047853734480; ok := ok and raisesOverflowError(num -:=     -240989001041328);
    num := 9221383812660584221; ok := ok and raisesOverflowError(num -:=    -1988224194191587);
    num := 9212609642412704892; ok := ok and raisesOverflowError(num -:=   -10762394442070916);
    num := 8384883669867978008; ok := ok and raisesOverflowError(num -:=  -838488366986797800);
    num := 6148914691236517206; ok := ok and raisesOverflowError(num -:= -3074457345618258602);
    num := 3074457345618258602; ok := ok and raisesOverflowError(num -:= -6148914691236517206);
    num :=  838488366986797800; ok := ok and raisesOverflowError(num -:= -8384883669867978008);
    num :=   10762394442070916; ok := ok and raisesOverflowError(num -:= -9212609642412704892);
    num :=    1988224194191587; ok := ok and raisesOverflowError(num -:= -9221383812660584221);
    num :=     240989001041328; ok := ok and raisesOverflowError(num -:= -9223131047853734480);
    num :=      14312161101687; ok := ok and raisesOverflowError(num -:= -9223357724693674121);
    num :=        933865493037; ok := ok and raisesOverflowError(num -:= -9223371102989282771);
    num :=        747094709113; ok := ok and raisesOverflowError(num -:= -9223371289760066695);
    num :=         74709312968; ok := ok and raisesOverflowError(num -:= -9223371962145462840);
    num :=          3037000499; ok := ok and raisesOverflowError(num -:= -9223372033817775309);
    num :=           123456791; ok := ok and raisesOverflowError(num -:= -9223372036731319017);
    num :=            12345653; ok := ok and raisesOverflowError(num -:= -9223372036842430155);
    num :=             9876553; ok := ok and raisesOverflowError(num -:= -9223372036844899255);
    num :=              644443; ok := ok and raisesOverflowError(num -:= -9223372036854131365);
    num :=               38273; ok := ok and raisesOverflowError(num -:= -9223372036854737535);
    num :=                4639; ok := ok and raisesOverflowError(num -:= -9223372036854771169);
    num :=                 857; ok := ok and raisesOverflowError(num -:= -9223372036854774951);
    num :=                  11; ok := ok and raisesOverflowError(num -:= -9223372036854775797);
    num :=                   3; ok := ok and raisesOverflowError(num -:= -9223372036854775805);
    num :=                   2; ok := ok and raisesOverflowError(num -:= -9223372036854775806);
    num :=                   1; ok := ok and raisesOverflowError(num -:= -9223372036854775807);
    num :=                   0; ok := ok and raisesOverflowError(num -:=            INT64_MIN);
    if not ok then
      writeln(" ***** Subtraction assignment overflow by one does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num := 9223372036854775807; ok := ok and raisesOverflowError(num -:= intExpr(                  -1));
    num := 9223372036854775806; ok := ok and raisesOverflowError(num -:= intExpr(                  -2));
    num := 9223372036854775805; ok := ok and raisesOverflowError(num -:= intExpr(                  -3));
    num := 9223372036854775797; ok := ok and raisesOverflowError(num -:= intExpr(                 -11));
    num := 9223372036854774951; ok := ok and raisesOverflowError(num -:= intExpr(                -857));
    num := 9223372036854771169; ok := ok and raisesOverflowError(num -:= intExpr(               -4639));
    num := 9223372036854737535; ok := ok and raisesOverflowError(num -:= intExpr(              -38273));
    num := 9223372036854131365; ok := ok and raisesOverflowError(num -:= intExpr(             -644443));
    num := 9223372036844899255; ok := ok and raisesOverflowError(num -:= intExpr(            -9876553));
    num := 9223372036842430155; ok := ok and raisesOverflowError(num -:= intExpr(           -12345653));
    num := 9223372036731319017; ok := ok and raisesOverflowError(num -:= intExpr(          -123456791));
    num := 9223372033817775309; ok := ok and raisesOverflowError(num -:= intExpr(         -3037000499));
    num := 9223371962145462840; ok := ok and raisesOverflowError(num -:= intExpr(        -74709312968));
    num := 9223371289760066695; ok := ok and raisesOverflowError(num -:= intExpr(       -747094709113));
    num := 9223371102989282771; ok := ok and raisesOverflowError(num -:= intExpr(       -933865493037));
    num := 9223357724693674121; ok := ok and raisesOverflowError(num -:= intExpr(     -14312161101687));
    num := 9223131047853734480; ok := ok and raisesOverflowError(num -:= intExpr(    -240989001041328));
    num := 9221383812660584221; ok := ok and raisesOverflowError(num -:= intExpr(   -1988224194191587));
    num := 9212609642412704892; ok := ok and raisesOverflowError(num -:= intExpr(  -10762394442070916));
    num := 8384883669867978008; ok := ok and raisesOverflowError(num -:= intExpr( -838488366986797800));
    num := 6148914691236517206; ok := ok and raisesOverflowError(num -:= intExpr(-3074457345618258602));
    num := 3074457345618258602; ok := ok and raisesOverflowError(num -:= intExpr(-6148914691236517206));
    num :=  838488366986797800; ok := ok and raisesOverflowError(num -:= intExpr(-8384883669867978008));
    num :=   10762394442070916; ok := ok and raisesOverflowError(num -:= intExpr(-9212609642412704892));
    num :=    1988224194191587; ok := ok and raisesOverflowError(num -:= intExpr(-9221383812660584221));
    num :=     240989001041328; ok := ok and raisesOverflowError(num -:= intExpr(-9223131047853734480));
    num :=      14312161101687; ok := ok and raisesOverflowError(num -:= intExpr(-9223357724693674121));
    num :=        933865493037; ok := ok and raisesOverflowError(num -:= intExpr(-9223371102989282771));
    num :=        747094709113; ok := ok and raisesOverflowError(num -:= intExpr(-9223371289760066695));
    num :=         74709312968; ok := ok and raisesOverflowError(num -:= intExpr(-9223371962145462840));
    num :=          3037000499; ok := ok and raisesOverflowError(num -:= intExpr(-9223372033817775309));
    num :=           123456791; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036731319017));
    num :=            12345653; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036842430155));
    num :=             9876553; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036844899255));
    num :=              644443; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854131365));
    num :=               38273; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854737535));
    num :=                4639; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854771169));
    num :=                 857; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854774951));
    num :=                  11; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854775797));
    num :=                   3; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854775805));
    num :=                   2; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854775806));
    num :=                   1; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854775807));
    num :=                   0; ok := ok and raisesOverflowError(num -:= intExpr(           INT64_MIN));
    if not ok then
      writeln(" ***** Subtraction assignment overflow by one does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:=                   -1);
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:=                   -2);
    arr[1] := 9223372036854775805; ok := ok and raisesOverflowError(arr[1] -:=                   -3);
    arr[1] := 9223372036854775797; ok := ok and raisesOverflowError(arr[1] -:=                  -11);
    arr[1] := 9223372036854774951; ok := ok and raisesOverflowError(arr[1] -:=                 -857);
    arr[1] := 9223372036854771169; ok := ok and raisesOverflowError(arr[1] -:=                -4639);
    arr[1] := 9223372036854737535; ok := ok and raisesOverflowError(arr[1] -:=               -38273);
    arr[1] := 9223372036854131365; ok := ok and raisesOverflowError(arr[1] -:=              -644443);
    arr[1] := 9223372036844899255; ok := ok and raisesOverflowError(arr[1] -:=             -9876553);
    arr[1] := 9223372036842430155; ok := ok and raisesOverflowError(arr[1] -:=            -12345653);
    arr[1] := 9223372036731319017; ok := ok and raisesOverflowError(arr[1] -:=           -123456791);
    arr[1] := 9223372033817775309; ok := ok and raisesOverflowError(arr[1] -:=          -3037000499);
    arr[1] := 9223371962145462840; ok := ok and raisesOverflowError(arr[1] -:=         -74709312968);
    arr[1] := 9223371289760066695; ok := ok and raisesOverflowError(arr[1] -:=        -747094709113);
    arr[1] := 9223371102989282771; ok := ok and raisesOverflowError(arr[1] -:=        -933865493037);
    arr[1] := 9223357724693674121; ok := ok and raisesOverflowError(arr[1] -:=      -14312161101687);
    arr[1] := 9223131047853734480; ok := ok and raisesOverflowError(arr[1] -:=     -240989001041328);
    arr[1] := 9221383812660584221; ok := ok and raisesOverflowError(arr[1] -:=    -1988224194191587);
    arr[1] := 9212609642412704892; ok := ok and raisesOverflowError(arr[1] -:=   -10762394442070916);
    arr[1] := 8384883669867978008; ok := ok and raisesOverflowError(arr[1] -:=  -838488366986797800);
    arr[1] := 6148914691236517206; ok := ok and raisesOverflowError(arr[1] -:= -3074457345618258602);
    arr[1] := 3074457345618258602; ok := ok and raisesOverflowError(arr[1] -:= -6148914691236517206);
    arr[1] :=  838488366986797800; ok := ok and raisesOverflowError(arr[1] -:= -8384883669867978008);
    arr[1] :=   10762394442070916; ok := ok and raisesOverflowError(arr[1] -:= -9212609642412704892);
    arr[1] :=    1988224194191587; ok := ok and raisesOverflowError(arr[1] -:= -9221383812660584221);
    arr[1] :=     240989001041328; ok := ok and raisesOverflowError(arr[1] -:= -9223131047853734480);
    arr[1] :=      14312161101687; ok := ok and raisesOverflowError(arr[1] -:= -9223357724693674121);
    arr[1] :=        933865493037; ok := ok and raisesOverflowError(arr[1] -:= -9223371102989282771);
    arr[1] :=        747094709113; ok := ok and raisesOverflowError(arr[1] -:= -9223371289760066695);
    arr[1] :=         74709312968; ok := ok and raisesOverflowError(arr[1] -:= -9223371962145462840);
    arr[1] :=          3037000499; ok := ok and raisesOverflowError(arr[1] -:= -9223372033817775309);
    arr[1] :=           123456791; ok := ok and raisesOverflowError(arr[1] -:= -9223372036731319017);
    arr[1] :=            12345653; ok := ok and raisesOverflowError(arr[1] -:= -9223372036842430155);
    arr[1] :=             9876553; ok := ok and raisesOverflowError(arr[1] -:= -9223372036844899255);
    arr[1] :=              644443; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854131365);
    arr[1] :=               38273; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854737535);
    arr[1] :=                4639; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854771169);
    arr[1] :=                 857; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854774951);
    arr[1] :=                  11; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854775797);
    arr[1] :=                   3; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854775805);
    arr[1] :=                   2; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854775806);
    arr[1] :=                   1; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854775807);
    arr[1] :=                   0; ok := ok and raisesOverflowError(arr[1] -:=            INT64_MIN);
    if not ok then
      writeln(" ***** Subtraction assignment overflow by one does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                  -1));
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                  -2));
    arr[1] := 9223372036854775805; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                  -3));
    arr[1] := 9223372036854775797; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                 -11));
    arr[1] := 9223372036854774951; ok := ok and raisesOverflowError(arr[1] -:= intExpr(                -857));
    arr[1] := 9223372036854771169; ok := ok and raisesOverflowError(arr[1] -:= intExpr(               -4639));
    arr[1] := 9223372036854737535; ok := ok and raisesOverflowError(arr[1] -:= intExpr(              -38273));
    arr[1] := 9223372036854131365; ok := ok and raisesOverflowError(arr[1] -:= intExpr(             -644443));
    arr[1] := 9223372036844899255; ok := ok and raisesOverflowError(arr[1] -:= intExpr(            -9876553));
    arr[1] := 9223372036842430155; ok := ok and raisesOverflowError(arr[1] -:= intExpr(           -12345653));
    arr[1] := 9223372036731319017; ok := ok and raisesOverflowError(arr[1] -:= intExpr(          -123456791));
    arr[1] := 9223372033817775309; ok := ok and raisesOverflowError(arr[1] -:= intExpr(         -3037000499));
    arr[1] := 9223371962145462840; ok := ok and raisesOverflowError(arr[1] -:= intExpr(        -74709312968));
    arr[1] := 9223371289760066695; ok := ok and raisesOverflowError(arr[1] -:= intExpr(       -747094709113));
    arr[1] := 9223371102989282771; ok := ok and raisesOverflowError(arr[1] -:= intExpr(       -933865493037));
    arr[1] := 9223357724693674121; ok := ok and raisesOverflowError(arr[1] -:= intExpr(     -14312161101687));
    arr[1] := 9223131047853734480; ok := ok and raisesOverflowError(arr[1] -:= intExpr(    -240989001041328));
    arr[1] := 9221383812660584221; ok := ok and raisesOverflowError(arr[1] -:= intExpr(   -1988224194191587));
    arr[1] := 9212609642412704892; ok := ok and raisesOverflowError(arr[1] -:= intExpr(  -10762394442070916));
    arr[1] := 8384883669867978008; ok := ok and raisesOverflowError(arr[1] -:= intExpr( -838488366986797800));
    arr[1] := 6148914691236517206; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-3074457345618258602));
    arr[1] := 3074457345618258602; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-6148914691236517206));
    arr[1] :=  838488366986797800; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-8384883669867978008));
    arr[1] :=   10762394442070916; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9212609642412704892));
    arr[1] :=    1988224194191587; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9221383812660584221));
    arr[1] :=     240989001041328; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223131047853734480));
    arr[1] :=      14312161101687; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223357724693674121));
    arr[1] :=        933865493037; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223371102989282771));
    arr[1] :=        747094709113; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223371289760066695));
    arr[1] :=         74709312968; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223371962145462840));
    arr[1] :=          3037000499; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372033817775309));
    arr[1] :=           123456791; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036731319017));
    arr[1] :=            12345653; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036842430155));
    arr[1] :=             9876553; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036844899255));
    arr[1] :=              644443; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854131365));
    arr[1] :=               38273; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854737535));
    arr[1] :=                4639; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854771169));
    arr[1] :=                 857; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854774951));
    arr[1] :=                  11; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854775797));
    arr[1] :=                   3; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854775805));
    arr[1] :=                   2; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854775806));
    arr[1] :=                   1; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854775807));
    arr[1] :=                   0; ok := ok and raisesOverflowError(arr[1] -:= intExpr(           INT64_MIN));
    if not ok then
      writeln(" ***** Subtraction assignment overflow by one does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num -:= 9223372036854775807);
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num -:= 9223372036854775806);
    num := -9223372036854775807; ok := ok and raisesOverflowError(num -:= 9223372036854775807);
    num := -9223372036854775807; ok := ok and raisesOverflowError(num -:= 9223372036854775806);
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854775807));
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854775806));
    num := -9223372036854775807; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854775807));
    num := -9223372036854775807; ok := ok and raisesOverflowError(num -:= intExpr(9223372036854775806));
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854775807);
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854775806);
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854775807);
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= 9223372036854775806);
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854775807));
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854775806));
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854775807));
    arr[1] := -9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= intExpr(9223372036854775806));
    if not ok then
      writeln(" ***** Subtraction assignment underflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    ok := TRUE;
    num := 9223372036854775807; ok := ok and raisesOverflowError(num -:=            INT64_MIN);
    num := 9223372036854775807; ok := ok and raisesOverflowError(num -:= -9223372036854775807);
    num := 9223372036854775806; ok := ok and raisesOverflowError(num -:=            INT64_MIN);
    num := 9223372036854775806; ok := ok and raisesOverflowError(num -:= -9223372036854775807);
    num := 9223372036854775807; ok := ok and raisesOverflowError(num -:= intExpr(           INT64_MIN));
    num := 9223372036854775807; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854775807));
    num := 9223372036854775806; ok := ok and raisesOverflowError(num -:= intExpr(           INT64_MIN));
    num := 9223372036854775806; ok := ok and raisesOverflowError(num -:= intExpr(-9223372036854775807));
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:=            INT64_MIN);
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854775807);
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:=            INT64_MIN);
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:= -9223372036854775807);
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= intExpr(           INT64_MIN));
    arr[1] := 9223372036854775807; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854775807));
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:= intExpr(           INT64_MIN));
    arr[1] := 9223372036854775806; ok := ok and raisesOverflowError(arr[1] -:= intExpr(-9223372036854775807));
    if not ok then
      writeln(" ***** Subtraction assignment overflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of subtraction assignment works correct.");
    else
      writeln(" ***** Overflow checking of subtraction assignment does not work correct.");
    end if;
  end func;


const proc: check_succ is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(succ(9223372036854775807)) or
        not raisesOverflowError(succ(intExpr(9223372036854775807))) then
      writeln(" ***** Succ overflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of succ works correct.");
    else
      writeln(" ***** Overflow checking of succ does not work correct.");
    end if;
  end func;


const proc: check_pred is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(pred(INT64_MIN)) or
        not raisesOverflowError(pred(intExpr(INT64_MIN))) then
      writeln(" ***** Pred overflow does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of pred works correct.");
    else
      writeln(" ***** Overflow checking of pred does not work correct.");
    end if;
  end func;


const proc: check_incr is func
  local
    var integer: num is 0;
    var array integer: arr is [] (0);
    var boolean: okay is TRUE;
  begin
    num := 9223372036854775807; okay := okay and raisesOverflowError(incr(num));
    arr[1] := 9223372036854775807; okay := okay and raisesOverflowError(incr(arr[1]));

    if okay then
      writeln("Overflow checking of incr works correct.");
    else
      writeln(" ***** Overflow checking of incr does not work correct.");
    end if;
  end func;


const proc: check_decr is func
  local
    var integer: num is 0;
    var array integer: arr is [] (0);
    var boolean: okay is TRUE;
  begin
    num := INT64_MIN; okay := okay and raisesOverflowError(decr(num));
    arr[1] := INT64_MIN; okay := okay and raisesOverflowError(decr(arr[1]));

    if okay then
      writeln("Overflow checking of decr works correct.");
    else
      writeln(" ***** Overflow checking of decr does not work correct.");
    end if;
  end func;


(**
 *  Tests for the compiler optimization to reduce overflow checking
 *  for multiplication.
 *)
const func boolean: check_reduced_overflow_checking_for_mult is func
  result
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(intExpr( integer.last) div        -integer.last *        integer.first) or
        not raisesOverflowError(intExpr( integer.last) div -4611686018427387905 *        integer.first) or
        not raisesOverflowError(intExpr( integer.last) div -3074457345618258602 * -3074457345618258603) or
        not raisesOverflowError(intExpr( integer.last) div -1317624576693539401 * -1317624576693539402) or
        not raisesOverflowError(intExpr( integer.last) div         -60247241209 *         -60247241210) or
        not raisesOverflowError(intExpr( integer.last) div         -34359738369 *         -34359738497) or
        not raisesOverflowError(intExpr( integer.last) div          -1234567890 *          -1234567891) or
        not raisesOverflowError(intExpr( integer.last) div                   -7 *                   -8) or
        not raisesOverflowError(intExpr( integer.last) div                   -3 *                   -4) or
        not raisesOverflowError(intExpr(integer.first) div                    2 *                   -2) or
        not raisesOverflowError(intExpr(integer.first) div                    3 *                   -4) or
        not raisesOverflowError(intExpr(integer.first) div                    7 *                   -8) or
        not raisesOverflowError(intExpr(integer.first) div           1234567890 *          -1234567891) or
        not raisesOverflowError(intExpr(integer.first) div          34359738368 *         -34359738368) or
        not raisesOverflowError(intExpr(integer.first) div          34359738369 *         -34359738497) or
        not raisesOverflowError(intExpr(integer.first) div          60247241209 *         -60247241210) or
        not raisesOverflowError(intExpr(integer.first) div  1317624576693539401 * -1317624576693539402) or
        not raisesOverflowError(intExpr(integer.first) div  4611686018427387904 * -4611686018427387904) or
        not raisesOverflowError(intExpr(integer.first) div  9223372036854775806 *        integer.first) or
        not raisesOverflowError(intExpr(integer.first) div         integer.last *        integer.first) then
      writeln(" ***** Reduced overflow check for mult failed: Minimum division result if the divisor is known. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr( integer.last) div -3074457345618258602 *  3074457345618258603) or
        not raisesOverflowError(intExpr( integer.last) div -1317624576693539401 *  1317624576693539402) or
        not raisesOverflowError(intExpr( integer.last) div         -60247241209 *          60247241210) or
        not raisesOverflowError(intExpr( integer.last) div         -34359738369 *          34359738497) or
        not raisesOverflowError(intExpr( integer.last) div          -1234567890 *           1234567891) or
        not raisesOverflowError(intExpr( integer.last) div                   -7 *                    8) or
        not raisesOverflowError(intExpr( integer.last) div                   -3 *                    4) or
        not raisesOverflowError(intExpr(integer.first) div                    2 *                    3) or
        not raisesOverflowError(intExpr(integer.first) div                    3 *                    4) or
        not raisesOverflowError(intExpr(integer.first) div                    7 *                    8) or
        not raisesOverflowError(intExpr(integer.first) div           1234567890 *           1234567891) or
        not raisesOverflowError(intExpr(integer.first) div          34359738368 *          34359738369) or
        not raisesOverflowError(intExpr(integer.first) div          34359738369 *          34359738497) or
        not raisesOverflowError(intExpr(integer.first) div          60247241209 *          60247241210) or
        not raisesOverflowError(intExpr(integer.first) div  1317624576693539401 *  1317624576693539402) or
        not raisesOverflowError(intExpr(integer.first) div  4611686018427387904 *  4611686018427387905) then
      writeln(" ***** Reduced overflow check for mult failed: Minimum division result if the divisor is known. (2)");
      okay := FALSE;
    end if;

    if      raisesOverflowError(intExpr(integer.first) div -4611686018427387904 * -4611686018427387904) or
        not raisesOverflowError(intExpr(integer.first) div -4611686018427387904 * -4611686018427387905) or
        not raisesOverflowError(intExpr(integer.first) div -1317624576693539401 * -1317624576693539402) or
        not raisesOverflowError(intExpr(integer.first) div         -60247241209 *         -60247241210) or
        not raisesOverflowError(intExpr(integer.first) div         -34359738369 *         -34359738497) or
            raisesOverflowError(intExpr(integer.first) div         -34359738368 *         -34359738368) or
        not raisesOverflowError(intExpr(integer.first) div         -34359738368 *         -34359738369) or
        not raisesOverflowError(intExpr(integer.first) div          -1234567890 *          -1234567891) or
        not raisesOverflowError(intExpr(integer.first) div                   -7 *                   -8) or
            raisesOverflowError(intExpr(integer.first) div                   -3 *                   -3) or
        not raisesOverflowError(intExpr(integer.first) div                   -3 *                   -4) or
            raisesOverflowError(intExpr(integer.first) div                   -2 *                   -2) or
        not raisesOverflowError(intExpr(integer.first) div                   -2 *                   -3) or
        not raisesOverflowError(intExpr( integer.last) div                    3 *                   -4) or
        not raisesOverflowError(intExpr( integer.last) div                    7 *                   -8) or
        not raisesOverflowError(intExpr( integer.last) div           1234567890 *          -1234567891) or
            raisesOverflowError(intExpr( integer.last) div          34359738367 *         -34359738368) or
        not raisesOverflowError(intExpr( integer.last) div          34359738367 *         -34359738369) or
        not raisesOverflowError(intExpr( integer.last) div          60247241209 *         -60247241210) or
        not raisesOverflowError(intExpr( integer.last) div  1317624576693539401 * -1317624576693539402) or
            raisesOverflowError(intExpr( integer.last) div  4611686018427387903 * -4611686018427387904) or
        not raisesOverflowError(intExpr( integer.last) div  4611686018427387903 * -4611686018427387905) then
      writeln(" ***** Reduced overflow check for mult failed: Maximum division result if the divisor is known. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(integer.first) div -4611686018427387904 *  4611686018427387904) or
        not raisesOverflowError(intExpr(integer.first) div -1317624576693539401 *  1317624576693539402) or
        not raisesOverflowError(intExpr(integer.first) div         -60247241209 *          60247241210) or
        not raisesOverflowError(intExpr(integer.first) div         -34359738369 *          34359738497) or
        not raisesOverflowError(intExpr(integer.first) div         -34359738368 *          34359738368) or
        not raisesOverflowError(intExpr(integer.first) div          -1234567890 *           1234567891) or
        not raisesOverflowError(intExpr(integer.first) div                   -7 *                    8) or
            raisesOverflowError(intExpr(integer.first) div                   -3 *                    3) or
        not raisesOverflowError(intExpr(integer.first) div                   -3 *                    4) or
        not raisesOverflowError(intExpr(integer.first) div                   -2 *                    2) or
        not raisesOverflowError(intExpr( integer.last) div                    1 *                    2) or
        not raisesOverflowError(intExpr( integer.last) div                    2 *                    3) or
        not raisesOverflowError(intExpr( integer.last) div                    3 *                    4) or
        not raisesOverflowError(intExpr( integer.last) div                    7 *                    8) or
        not raisesOverflowError(intExpr( integer.last) div           1234567890 *           1234567891) or
        not raisesOverflowError(intExpr( integer.last) div          34359738367 *          34359738368) or
        not raisesOverflowError(intExpr( integer.last) div          34359738368 *          34359738497) or
        not raisesOverflowError(intExpr( integer.last) div          60247241209 *          60247241210) or
        not raisesOverflowError(intExpr( integer.last) div  1317624576693539401 *  1317624576693539402) or
            raisesOverflowError(intExpr( integer.last) div  4611686018427387903 *  4611686018427387903) or
        not raisesOverflowError(intExpr( integer.last) div  4611686018427387903 *  4611686018427387904) then
      writeln(" ***** Reduced overflow check for mult failed: Maximum division result if the divisor is known. (2)");
      okay := FALSE;
    end if;
  end func;


const proc: check_mult is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(-4611686018427387905 *                    2) or
        not raisesOverflowError(-4611686018427387904 *                    3) or
        not raisesOverflowError(-3074457345618258603 *                    3) or
        not raisesOverflowError(-3074457345618258602 *                    4) or
        not raisesOverflowError( -838488366986797801 *                   11) or
        not raisesOverflowError( -838488366986797800 *                   12) or
        not raisesOverflowError(  -10762394442070917 *                  857) or
        not raisesOverflowError(  -10762394442070916 *                  858) or
        not raisesOverflowError(   -1988224194191588 *                 4639) or
        not raisesOverflowError(   -1988224194191587 *                 4640) or
        not raisesOverflowError(    -240989001041329 *                38273) or
        not raisesOverflowError(    -240989001041328 *                38274) or
        not raisesOverflowError(     -14312161101688 *               644443) or
        not raisesOverflowError(     -14312161101687 *               644444) or
        not raisesOverflowError(       -933865493038 *              9876553) or
        not raisesOverflowError(       -933865493037 *              9876554) or
        not raisesOverflowError(       -747094709114 *             12345653) or
        not raisesOverflowError(       -747094709113 *             12345654) or
        not raisesOverflowError(        -74709312969 *            123456791) or
        not raisesOverflowError(        -74709312968 *            123456792) or
        not raisesOverflowError(         -3037000500 *           3037000500) or
        not raisesOverflowError(          -123456792 *          74709312968) or
        not raisesOverflowError(          -123456791 *          74709312969) or
        not raisesOverflowError(           -12345654 *         747094709113) or
        not raisesOverflowError(           -12345653 *         747094709114) or
        not raisesOverflowError(            -9876554 *         933865493037) or
        not raisesOverflowError(            -9876553 *         933865493038) or
        not raisesOverflowError(             -644444 *       14312161101687) or
        not raisesOverflowError(             -644443 *       14312161101688) or
        not raisesOverflowError(              -38274 *      240989001041328) or
        not raisesOverflowError(              -38273 *      240989001041329) or
        not raisesOverflowError(               -4640 *     1988224194191587) or
        not raisesOverflowError(               -4639 *     1988224194191588) or
        not raisesOverflowError(                -858 *    10762394442070916) or
        not raisesOverflowError(                -857 *    10762394442070917) or
        not raisesOverflowError(                 -12 *   838488366986797800) or
        not raisesOverflowError(                 -11 *   838488366986797801) or
        not raisesOverflowError(                  -4 *  3074457345618258602) or
        not raisesOverflowError(                  -3 *  3074457345618258603) or
        not raisesOverflowError(                  -3 *  4611686018427387904) or
        not raisesOverflowError(                  -2 *  4611686018427387905) or
        not raisesOverflowError( 4611686018427387905 *                   -2) or
        not raisesOverflowError( 4611686018427387904 *                   -3) or
        not raisesOverflowError( 3074457345618258603 *                   -3) or
        not raisesOverflowError( 3074457345618258602 *                   -4) or
        not raisesOverflowError(  838488366986797801 *                  -11) or
        not raisesOverflowError(  838488366986797800 *                  -12) or
        not raisesOverflowError(   10762394442070917 *                 -857) or
        not raisesOverflowError(   10762394442070916 *                 -858) or
        not raisesOverflowError(    1988224194191588 *                -4639) or
        not raisesOverflowError(    1988224194191587 *                -4640) or
        not raisesOverflowError(     240989001041329 *               -38273) or
        not raisesOverflowError(     240989001041328 *               -38274) or
        not raisesOverflowError(      14312161101688 *              -644443) or
        not raisesOverflowError(      14312161101687 *              -644444) or
        not raisesOverflowError(        933865493038 *             -9876553) or
        not raisesOverflowError(        933865493037 *             -9876554) or
        not raisesOverflowError(        747094709114 *            -12345653) or
        not raisesOverflowError(        747094709113 *            -12345654) or
        not raisesOverflowError(         74709312969 *           -123456791) or
        not raisesOverflowError(         74709312968 *           -123456792) or
        not raisesOverflowError(          3037000500 *          -3037000500) or
        not raisesOverflowError(           123456792 *         -74709312968) or
        not raisesOverflowError(           123456791 *         -74709312969) or
        not raisesOverflowError(            12345654 *        -747094709113) or
        not raisesOverflowError(            12345653 *        -747094709114) or
        not raisesOverflowError(             9876554 *        -933865493037) or
        not raisesOverflowError(             9876553 *        -933865493038) or
        not raisesOverflowError(              644444 *      -14312161101687) or
        not raisesOverflowError(              644443 *      -14312161101688) or
        not raisesOverflowError(               38274 *     -240989001041328) or
        not raisesOverflowError(               38273 *     -240989001041329) or
        not raisesOverflowError(                4640 *    -1988224194191587) or
        not raisesOverflowError(                4639 *    -1988224194191588) or
        not raisesOverflowError(                 858 *   -10762394442070916) or
        not raisesOverflowError(                 857 *   -10762394442070917) or
        not raisesOverflowError(                  12 *  -838488366986797800) or
        not raisesOverflowError(                  11 *  -838488366986797801) or
        not raisesOverflowError(                   4 * -3074457345618258602) or
        not raisesOverflowError(                   3 * -3074457345618258603) or
        not raisesOverflowError(                   3 * -4611686018427387904) or
        not raisesOverflowError(                   2 * -4611686018427387905) then
      writeln(" ***** Underflow when computing multiplication does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(-4611686018427387905) *                    2) or
        not raisesOverflowError(intExpr(-4611686018427387904) *                    3) or
        not raisesOverflowError(intExpr(-3074457345618258603) *                    3) or
        not raisesOverflowError(intExpr(-3074457345618258602) *                    4) or
        not raisesOverflowError(intExpr( -838488366986797801) *                   11) or
        not raisesOverflowError(intExpr( -838488366986797800) *                   12) or
        not raisesOverflowError(intExpr(  -10762394442070917) *                  857) or
        not raisesOverflowError(intExpr(  -10762394442070916) *                  858) or
        not raisesOverflowError(intExpr(   -1988224194191588) *                 4639) or
        not raisesOverflowError(intExpr(   -1988224194191587) *                 4640) or
        not raisesOverflowError(intExpr(    -240989001041329) *                38273) or
        not raisesOverflowError(intExpr(    -240989001041328) *                38274) or
        not raisesOverflowError(intExpr(     -14312161101688) *               644443) or
        not raisesOverflowError(intExpr(     -14312161101687) *               644444) or
        not raisesOverflowError(intExpr(       -933865493038) *              9876553) or
        not raisesOverflowError(intExpr(       -933865493037) *              9876554) or
        not raisesOverflowError(intExpr(       -747094709114) *             12345653) or
        not raisesOverflowError(intExpr(       -747094709113) *             12345654) or
        not raisesOverflowError(intExpr(        -74709312969) *            123456791) or
        not raisesOverflowError(intExpr(        -74709312968) *            123456792) or
        not raisesOverflowError(intExpr(         -3037000500) *           3037000500) or
        not raisesOverflowError(intExpr(          -123456792) *          74709312968) or
        not raisesOverflowError(intExpr(          -123456791) *          74709312969) or
        not raisesOverflowError(intExpr(           -12345654) *         747094709113) or
        not raisesOverflowError(intExpr(           -12345653) *         747094709114) or
        not raisesOverflowError(intExpr(            -9876554) *         933865493037) or
        not raisesOverflowError(intExpr(            -9876553) *         933865493038) or
        not raisesOverflowError(intExpr(             -644444) *       14312161101687) or
        not raisesOverflowError(intExpr(             -644443) *       14312161101688) or
        not raisesOverflowError(intExpr(              -38274) *      240989001041328) or
        not raisesOverflowError(intExpr(              -38273) *      240989001041329) or
        not raisesOverflowError(intExpr(               -4640) *     1988224194191587) or
        not raisesOverflowError(intExpr(               -4639) *     1988224194191588) or
        not raisesOverflowError(intExpr(                -858) *    10762394442070916) or
        not raisesOverflowError(intExpr(                -857) *    10762394442070917) or
        not raisesOverflowError(intExpr(                 -12) *   838488366986797800) or
        not raisesOverflowError(intExpr(                 -11) *   838488366986797801) or
        not raisesOverflowError(intExpr(                  -4) *  3074457345618258602) or
        not raisesOverflowError(intExpr(                  -3) *  3074457345618258603) or
        not raisesOverflowError(intExpr(                  -3) *  4611686018427387904) or
        not raisesOverflowError(intExpr(                  -2) *  4611686018427387905) or
        not raisesOverflowError(intExpr( 4611686018427387905) *                   -2) or
        not raisesOverflowError(intExpr( 4611686018427387904) *                   -3) or
        not raisesOverflowError(intExpr( 3074457345618258603) *                   -3) or
        not raisesOverflowError(intExpr( 3074457345618258602) *                   -4) or
        not raisesOverflowError(intExpr(  838488366986797801) *                  -11) or
        not raisesOverflowError(intExpr(  838488366986797800) *                  -12) or
        not raisesOverflowError(intExpr(   10762394442070917) *                 -857) or
        not raisesOverflowError(intExpr(   10762394442070916) *                 -858) or
        not raisesOverflowError(intExpr(    1988224194191588) *                -4639) or
        not raisesOverflowError(intExpr(    1988224194191587) *                -4640) or
        not raisesOverflowError(intExpr(     240989001041329) *               -38273) or
        not raisesOverflowError(intExpr(     240989001041328) *               -38274) or
        not raisesOverflowError(intExpr(      14312161101688) *              -644443) or
        not raisesOverflowError(intExpr(      14312161101687) *              -644444) or
        not raisesOverflowError(intExpr(        933865493038) *             -9876553) or
        not raisesOverflowError(intExpr(        933865493037) *             -9876554) or
        not raisesOverflowError(intExpr(        747094709114) *            -12345653) or
        not raisesOverflowError(intExpr(        747094709113) *            -12345654) or
        not raisesOverflowError(intExpr(         74709312969) *           -123456791) or
        not raisesOverflowError(intExpr(         74709312968) *           -123456792) or
        not raisesOverflowError(intExpr(          3037000500) *          -3037000500) or
        not raisesOverflowError(intExpr(           123456792) *         -74709312968) or
        not raisesOverflowError(intExpr(           123456791) *         -74709312969) or
        not raisesOverflowError(intExpr(            12345654) *        -747094709113) or
        not raisesOverflowError(intExpr(            12345653) *        -747094709114) or
        not raisesOverflowError(intExpr(             9876554) *        -933865493037) or
        not raisesOverflowError(intExpr(             9876553) *        -933865493038) or
        not raisesOverflowError(intExpr(              644444) *      -14312161101687) or
        not raisesOverflowError(intExpr(              644443) *      -14312161101688) or
        not raisesOverflowError(intExpr(               38274) *     -240989001041328) or
        not raisesOverflowError(intExpr(               38273) *     -240989001041329) or
        not raisesOverflowError(intExpr(                4640) *    -1988224194191587) or
        not raisesOverflowError(intExpr(                4639) *    -1988224194191588) or
        not raisesOverflowError(intExpr(                 858) *   -10762394442070916) or
        not raisesOverflowError(intExpr(                 857) *   -10762394442070917) or
        not raisesOverflowError(intExpr(                  12) *  -838488366986797800) or
        not raisesOverflowError(intExpr(                  11) *  -838488366986797801) or
        not raisesOverflowError(intExpr(                   4) * -3074457345618258602) or
        not raisesOverflowError(intExpr(                   3) * -3074457345618258603) or
        not raisesOverflowError(intExpr(                   3) * -4611686018427387904) or
        not raisesOverflowError(intExpr(                   2) * -4611686018427387905) then
      writeln(" ***** Underflow when computing multiplication does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(-4611686018427387905 * intExpr(                   2)) or
        not raisesOverflowError(-4611686018427387904 * intExpr(                   3)) or
        not raisesOverflowError(-3074457345618258603 * intExpr(                   3)) or
        not raisesOverflowError(-3074457345618258602 * intExpr(                   4)) or
        not raisesOverflowError( -838488366986797801 * intExpr(                  11)) or
        not raisesOverflowError( -838488366986797800 * intExpr(                  12)) or
        not raisesOverflowError(  -10762394442070917 * intExpr(                 857)) or
        not raisesOverflowError(  -10762394442070916 * intExpr(                 858)) or
        not raisesOverflowError(   -1988224194191588 * intExpr(                4639)) or
        not raisesOverflowError(   -1988224194191587 * intExpr(                4640)) or
        not raisesOverflowError(    -240989001041329 * intExpr(               38273)) or
        not raisesOverflowError(    -240989001041328 * intExpr(               38274)) or
        not raisesOverflowError(     -14312161101688 * intExpr(              644443)) or
        not raisesOverflowError(     -14312161101687 * intExpr(              644444)) or
        not raisesOverflowError(       -933865493038 * intExpr(             9876553)) or
        not raisesOverflowError(       -933865493037 * intExpr(             9876554)) or
        not raisesOverflowError(       -747094709114 * intExpr(            12345653)) or
        not raisesOverflowError(       -747094709113 * intExpr(            12345654)) or
        not raisesOverflowError(        -74709312969 * intExpr(           123456791)) or
        not raisesOverflowError(        -74709312968 * intExpr(           123456792)) or
        not raisesOverflowError(         -3037000500 * intExpr(          3037000500)) or
        not raisesOverflowError(          -123456792 * intExpr(         74709312968)) or
        not raisesOverflowError(          -123456791 * intExpr(         74709312969)) or
        not raisesOverflowError(           -12345654 * intExpr(        747094709113)) or
        not raisesOverflowError(           -12345653 * intExpr(        747094709114)) or
        not raisesOverflowError(            -9876554 * intExpr(        933865493037)) or
        not raisesOverflowError(            -9876553 * intExpr(        933865493038)) or
        not raisesOverflowError(             -644444 * intExpr(      14312161101687)) or
        not raisesOverflowError(             -644443 * intExpr(      14312161101688)) or
        not raisesOverflowError(              -38274 * intExpr(     240989001041328)) or
        not raisesOverflowError(              -38273 * intExpr(     240989001041329)) or
        not raisesOverflowError(               -4640 * intExpr(    1988224194191587)) or
        not raisesOverflowError(               -4639 * intExpr(    1988224194191588)) or
        not raisesOverflowError(                -858 * intExpr(   10762394442070916)) or
        not raisesOverflowError(                -857 * intExpr(   10762394442070917)) or
        not raisesOverflowError(                 -12 * intExpr(  838488366986797800)) or
        not raisesOverflowError(                 -11 * intExpr(  838488366986797801)) or
        not raisesOverflowError(                  -4 * intExpr( 3074457345618258602)) or
        not raisesOverflowError(                  -3 * intExpr( 3074457345618258603)) or
        not raisesOverflowError(                  -3 * intExpr( 4611686018427387904)) or
        not raisesOverflowError(                  -2 * intExpr( 4611686018427387905)) or
        not raisesOverflowError( 4611686018427387905 * intExpr(                  -2)) or
        not raisesOverflowError( 4611686018427387904 * intExpr(                  -3)) or
        not raisesOverflowError( 3074457345618258603 * intExpr(                  -3)) or
        not raisesOverflowError( 3074457345618258602 * intExpr(                  -4)) or
        not raisesOverflowError(  838488366986797801 * intExpr(                 -11)) or
        not raisesOverflowError(  838488366986797800 * intExpr(                 -12)) or
        not raisesOverflowError(   10762394442070917 * intExpr(                -857)) or
        not raisesOverflowError(   10762394442070916 * intExpr(                -858)) or
        not raisesOverflowError(    1988224194191588 * intExpr(               -4639)) or
        not raisesOverflowError(    1988224194191587 * intExpr(               -4640)) or
        not raisesOverflowError(     240989001041329 * intExpr(              -38273)) or
        not raisesOverflowError(     240989001041328 * intExpr(              -38274)) or
        not raisesOverflowError(      14312161101688 * intExpr(             -644443)) or
        not raisesOverflowError(      14312161101687 * intExpr(             -644444)) or
        not raisesOverflowError(        933865493038 * intExpr(            -9876553)) or
        not raisesOverflowError(        933865493037 * intExpr(            -9876554)) or
        not raisesOverflowError(        747094709114 * intExpr(           -12345653)) or
        not raisesOverflowError(        747094709113 * intExpr(           -12345654)) or
        not raisesOverflowError(         74709312969 * intExpr(          -123456791)) or
        not raisesOverflowError(         74709312968 * intExpr(          -123456792)) or
        not raisesOverflowError(          3037000500 * intExpr(         -3037000500)) or
        not raisesOverflowError(           123456792 * intExpr(        -74709312968)) or
        not raisesOverflowError(           123456791 * intExpr(        -74709312969)) or
        not raisesOverflowError(            12345654 * intExpr(       -747094709113)) or
        not raisesOverflowError(            12345653 * intExpr(       -747094709114)) or
        not raisesOverflowError(             9876554 * intExpr(       -933865493037)) or
        not raisesOverflowError(             9876553 * intExpr(       -933865493038)) or
        not raisesOverflowError(              644444 * intExpr(     -14312161101687)) or
        not raisesOverflowError(              644443 * intExpr(     -14312161101688)) or
        not raisesOverflowError(               38274 * intExpr(    -240989001041328)) or
        not raisesOverflowError(               38273 * intExpr(    -240989001041329)) or
        not raisesOverflowError(                4640 * intExpr(   -1988224194191587)) or
        not raisesOverflowError(                4639 * intExpr(   -1988224194191588)) or
        not raisesOverflowError(                 858 * intExpr(  -10762394442070916)) or
        not raisesOverflowError(                 857 * intExpr(  -10762394442070917)) or
        not raisesOverflowError(                  12 * intExpr( -838488366986797800)) or
        not raisesOverflowError(                  11 * intExpr( -838488366986797801)) or
        not raisesOverflowError(                   4 * intExpr(-3074457345618258602)) or
        not raisesOverflowError(                   3 * intExpr(-3074457345618258603)) or
        not raisesOverflowError(                   3 * intExpr(-4611686018427387904)) or
        not raisesOverflowError(                   2 * intExpr(-4611686018427387905)) then
      writeln(" ***** Underflow when computing multiplication does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(-4611686018427387905) * intExpr(                   2)) or
        not raisesOverflowError(intExpr(-4611686018427387904) * intExpr(                   3)) or
        not raisesOverflowError(intExpr(-3074457345618258603) * intExpr(                   3)) or
        not raisesOverflowError(intExpr(-3074457345618258602) * intExpr(                   4)) or
        not raisesOverflowError(intExpr( -838488366986797801) * intExpr(                  11)) or
        not raisesOverflowError(intExpr( -838488366986797800) * intExpr(                  12)) or
        not raisesOverflowError(intExpr(  -10762394442070917) * intExpr(                 857)) or
        not raisesOverflowError(intExpr(  -10762394442070916) * intExpr(                 858)) or
        not raisesOverflowError(intExpr(   -1988224194191588) * intExpr(                4639)) or
        not raisesOverflowError(intExpr(   -1988224194191587) * intExpr(                4640)) or
        not raisesOverflowError(intExpr(    -240989001041329) * intExpr(               38273)) or
        not raisesOverflowError(intExpr(    -240989001041328) * intExpr(               38274)) or
        not raisesOverflowError(intExpr(     -14312161101688) * intExpr(              644443)) or
        not raisesOverflowError(intExpr(     -14312161101687) * intExpr(              644444)) or
        not raisesOverflowError(intExpr(       -933865493038) * intExpr(             9876553)) or
        not raisesOverflowError(intExpr(       -933865493037) * intExpr(             9876554)) or
        not raisesOverflowError(intExpr(       -747094709114) * intExpr(            12345653)) or
        not raisesOverflowError(intExpr(       -747094709113) * intExpr(            12345654)) or
        not raisesOverflowError(intExpr(        -74709312969) * intExpr(           123456791)) or
        not raisesOverflowError(intExpr(        -74709312968) * intExpr(           123456792)) or
        not raisesOverflowError(intExpr(         -3037000500) * intExpr(          3037000500)) or
        not raisesOverflowError(intExpr(          -123456792) * intExpr(         74709312968)) or
        not raisesOverflowError(intExpr(          -123456791) * intExpr(         74709312969)) or
        not raisesOverflowError(intExpr(           -12345654) * intExpr(        747094709113)) or
        not raisesOverflowError(intExpr(           -12345653) * intExpr(        747094709114)) or
        not raisesOverflowError(intExpr(            -9876554) * intExpr(        933865493037)) or
        not raisesOverflowError(intExpr(            -9876553) * intExpr(        933865493038)) or
        not raisesOverflowError(intExpr(             -644444) * intExpr(      14312161101687)) or
        not raisesOverflowError(intExpr(             -644443) * intExpr(      14312161101688)) or
        not raisesOverflowError(intExpr(              -38274) * intExpr(     240989001041328)) or
        not raisesOverflowError(intExpr(              -38273) * intExpr(     240989001041329)) or
        not raisesOverflowError(intExpr(               -4640) * intExpr(    1988224194191587)) or
        not raisesOverflowError(intExpr(               -4639) * intExpr(    1988224194191588)) or
        not raisesOverflowError(intExpr(                -858) * intExpr(   10762394442070916)) or
        not raisesOverflowError(intExpr(                -857) * intExpr(   10762394442070917)) or
        not raisesOverflowError(intExpr(                 -12) * intExpr(  838488366986797800)) or
        not raisesOverflowError(intExpr(                 -11) * intExpr(  838488366986797801)) or
        not raisesOverflowError(intExpr(                  -4) * intExpr( 3074457345618258602)) or
        not raisesOverflowError(intExpr(                  -3) * intExpr( 3074457345618258603)) or
        not raisesOverflowError(intExpr(                  -3) * intExpr( 4611686018427387904)) or
        not raisesOverflowError(intExpr(                  -2) * intExpr( 4611686018427387905)) or
        not raisesOverflowError(intExpr( 4611686018427387905) * intExpr(                  -2)) or
        not raisesOverflowError(intExpr( 4611686018427387904) * intExpr(                  -3)) or
        not raisesOverflowError(intExpr( 3074457345618258603) * intExpr(                  -3)) or
        not raisesOverflowError(intExpr( 3074457345618258602) * intExpr(                  -4)) or
        not raisesOverflowError(intExpr(  838488366986797801) * intExpr(                 -11)) or
        not raisesOverflowError(intExpr(  838488366986797800) * intExpr(                 -12)) or
        not raisesOverflowError(intExpr(   10762394442070917) * intExpr(                -857)) or
        not raisesOverflowError(intExpr(   10762394442070916) * intExpr(                -858)) or
        not raisesOverflowError(intExpr(    1988224194191588) * intExpr(               -4639)) or
        not raisesOverflowError(intExpr(    1988224194191587) * intExpr(               -4640)) or
        not raisesOverflowError(intExpr(     240989001041329) * intExpr(              -38273)) or
        not raisesOverflowError(intExpr(     240989001041328) * intExpr(              -38274)) or
        not raisesOverflowError(intExpr(      14312161101688) * intExpr(             -644443)) or
        not raisesOverflowError(intExpr(      14312161101687) * intExpr(             -644444)) or
        not raisesOverflowError(intExpr(        933865493038) * intExpr(            -9876553)) or
        not raisesOverflowError(intExpr(        933865493037) * intExpr(            -9876554)) or
        not raisesOverflowError(intExpr(        747094709114) * intExpr(           -12345653)) or
        not raisesOverflowError(intExpr(        747094709113) * intExpr(           -12345654)) or
        not raisesOverflowError(intExpr(         74709312969) * intExpr(          -123456791)) or
        not raisesOverflowError(intExpr(         74709312968) * intExpr(          -123456792)) or
        not raisesOverflowError(intExpr(          3037000500) * intExpr(         -3037000500)) or
        not raisesOverflowError(intExpr(           123456792) * intExpr(        -74709312968)) or
        not raisesOverflowError(intExpr(           123456791) * intExpr(        -74709312969)) or
        not raisesOverflowError(intExpr(            12345654) * intExpr(       -747094709113)) or
        not raisesOverflowError(intExpr(            12345653) * intExpr(       -747094709114)) or
        not raisesOverflowError(intExpr(             9876554) * intExpr(       -933865493037)) or
        not raisesOverflowError(intExpr(             9876553) * intExpr(       -933865493038)) or
        not raisesOverflowError(intExpr(              644444) * intExpr(     -14312161101687)) or
        not raisesOverflowError(intExpr(              644443) * intExpr(     -14312161101688)) or
        not raisesOverflowError(intExpr(               38274) * intExpr(    -240989001041328)) or
        not raisesOverflowError(intExpr(               38273) * intExpr(    -240989001041329)) or
        not raisesOverflowError(intExpr(                4640) * intExpr(   -1988224194191587)) or
        not raisesOverflowError(intExpr(                4639) * intExpr(   -1988224194191588)) or
        not raisesOverflowError(intExpr(                 858) * intExpr(  -10762394442070916)) or
        not raisesOverflowError(intExpr(                 857) * intExpr(  -10762394442070917)) or
        not raisesOverflowError(intExpr(                  12) * intExpr( -838488366986797800)) or
        not raisesOverflowError(intExpr(                  11) * intExpr( -838488366986797801)) or
        not raisesOverflowError(intExpr(                   4) * intExpr(-3074457345618258602)) or
        not raisesOverflowError(intExpr(                   3) * intExpr(-3074457345618258603)) or
        not raisesOverflowError(intExpr(                   3) * intExpr(-4611686018427387904)) or
        not raisesOverflowError(intExpr(                   2) * intExpr(-4611686018427387905)) then
      writeln(" ***** Underflow when computing multiplication does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(           INT64_MIN *                   -1) or
        not raisesOverflowError(-4611686018427387904 *                   -2) or
        not raisesOverflowError(-4611686018427387903 *                   -3) or
        not raisesOverflowError(-3074457345618258603 *                   -3) or
        not raisesOverflowError(-3074457345618258602 *                   -4) or
        not raisesOverflowError( -838488366986797801 *                  -11) or
        not raisesOverflowError( -838488366986797800 *                  -12) or
        not raisesOverflowError(  -10762394442070917 *                 -857) or
        not raisesOverflowError(  -10762394442070916 *                 -858) or
        not raisesOverflowError(   -1988224194191588 *                -4639) or
        not raisesOverflowError(   -1988224194191587 *                -4640) or
        not raisesOverflowError(    -240989001041329 *               -38273) or
        not raisesOverflowError(    -240989001041328 *               -38274) or
        not raisesOverflowError(     -14312161101688 *              -644443) or
        not raisesOverflowError(     -14312161101687 *              -644444) or
        not raisesOverflowError(       -933865493038 *             -9876553) or
        not raisesOverflowError(       -933865493037 *             -9876554) or
        not raisesOverflowError(       -747094709114 *            -12345653) or
        not raisesOverflowError(       -747094709113 *            -12345654) or
        not raisesOverflowError(        -74709312969 *           -123456791) or
        not raisesOverflowError(        -74709312968 *           -123456792) or
        not raisesOverflowError(         -3037000500 *          -3037000500) or
        not raisesOverflowError(          -123456792 *         -74709312968) or
        not raisesOverflowError(          -123456791 *         -74709312969) or
        not raisesOverflowError(           -12345654 *        -747094709113) or
        not raisesOverflowError(           -12345653 *        -747094709114) or
        not raisesOverflowError(            -9876554 *        -933865493037) or
        not raisesOverflowError(            -9876553 *        -933865493038) or
        not raisesOverflowError(             -644444 *      -14312161101687) or
        not raisesOverflowError(             -644443 *      -14312161101688) or
        not raisesOverflowError(              -38274 *     -240989001041328) or
        not raisesOverflowError(              -38273 *     -240989001041329) or
        not raisesOverflowError(               -4640 *    -1988224194191587) or
        not raisesOverflowError(               -4639 *    -1988224194191588) or
        not raisesOverflowError(                -858 *   -10762394442070916) or
        not raisesOverflowError(                -857 *   -10762394442070917) or
        not raisesOverflowError(                 -12 *  -838488366986797800) or
        not raisesOverflowError(                 -11 *  -838488366986797801) or
        not raisesOverflowError(                  -4 * -3074457345618258602) or
        not raisesOverflowError(                  -3 * -3074457345618258603) or
        not raisesOverflowError(                  -3 * -4611686018427387903) or
        not raisesOverflowError(                  -2 * -4611686018427387904) or
        not raisesOverflowError( 4611686018427387904 *                    2) or
        not raisesOverflowError( 4611686018427387903 *                    3) or
        not raisesOverflowError( 3074457345618258603 *                    3) or
        not raisesOverflowError( 3074457345618258602 *                    4) or
        not raisesOverflowError(  838488366986797801 *                   11) or
        not raisesOverflowError(  838488366986797800 *                   12) or
        not raisesOverflowError(   10762394442070917 *                  857) or
        not raisesOverflowError(   10762394442070916 *                  858) or
        not raisesOverflowError(    1988224194191588 *                 4639) or
        not raisesOverflowError(    1988224194191587 *                 4640) or
        not raisesOverflowError(     240989001041329 *                38273) or
        not raisesOverflowError(     240989001041328 *                38274) or
        not raisesOverflowError(      14312161101688 *               644443) or
        not raisesOverflowError(      14312161101687 *               644444) or
        not raisesOverflowError(        933865493038 *              9876553) or
        not raisesOverflowError(        933865493037 *              9876554) or
        not raisesOverflowError(        747094709114 *             12345653) or
        not raisesOverflowError(        747094709113 *             12345654) or
        not raisesOverflowError(         74709312969 *            123456791) or
        not raisesOverflowError(         74709312968 *            123456792) or
        not raisesOverflowError(          3037000500 *           3037000500) or
        not raisesOverflowError(           123456792 *          74709312968) or
        not raisesOverflowError(           123456791 *          74709312969) or
        not raisesOverflowError(            12345654 *         747094709113) or
        not raisesOverflowError(            12345653 *         747094709114) or
        not raisesOverflowError(             9876554 *         933865493037) or
        not raisesOverflowError(             9876553 *         933865493038) or
        not raisesOverflowError(              644444 *       14312161101687) or
        not raisesOverflowError(              644443 *       14312161101688) or
        not raisesOverflowError(               38274 *      240989001041328) or
        not raisesOverflowError(               38273 *      240989001041329) or
        not raisesOverflowError(                4640 *     1988224194191587) or
        not raisesOverflowError(                4639 *     1988224194191588) or
        not raisesOverflowError(                 858 *    10762394442070916) or
        not raisesOverflowError(                 857 *    10762394442070917) or
        not raisesOverflowError(                  12 *   838488366986797800) or
        not raisesOverflowError(                  11 *   838488366986797801) or
        not raisesOverflowError(                   4 *  3074457345618258602) or
        not raisesOverflowError(                   3 *  3074457345618258603) or
        not raisesOverflowError(                   3 *  4611686018427387903) or
        not raisesOverflowError(                   2 *  4611686018427387904) then
      writeln(" ***** Overflow when computing multiplication does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) *                   -1) or
        not raisesOverflowError(intExpr(-4611686018427387904) *                   -2) or
        not raisesOverflowError(intExpr(-4611686018427387903) *                   -3) or
        not raisesOverflowError(intExpr(-3074457345618258603) *                   -3) or
        not raisesOverflowError(intExpr(-3074457345618258602) *                   -4) or
        not raisesOverflowError(intExpr( -838488366986797801) *                  -11) or
        not raisesOverflowError(intExpr( -838488366986797800) *                  -12) or
        not raisesOverflowError(intExpr(  -10762394442070917) *                 -857) or
        not raisesOverflowError(intExpr(  -10762394442070916) *                 -858) or
        not raisesOverflowError(intExpr(   -1988224194191588) *                -4639) or
        not raisesOverflowError(intExpr(   -1988224194191587) *                -4640) or
        not raisesOverflowError(intExpr(    -240989001041329) *               -38273) or
        not raisesOverflowError(intExpr(    -240989001041328) *               -38274) or
        not raisesOverflowError(intExpr(     -14312161101688) *              -644443) or
        not raisesOverflowError(intExpr(     -14312161101687) *              -644444) or
        not raisesOverflowError(intExpr(       -933865493038) *             -9876553) or
        not raisesOverflowError(intExpr(       -933865493037) *             -9876554) or
        not raisesOverflowError(intExpr(       -747094709114) *            -12345653) or
        not raisesOverflowError(intExpr(       -747094709113) *            -12345654) or
        not raisesOverflowError(intExpr(        -74709312969) *           -123456791) or
        not raisesOverflowError(intExpr(        -74709312968) *           -123456792) or
        not raisesOverflowError(intExpr(         -3037000500) *          -3037000500) or
        not raisesOverflowError(intExpr(          -123456792) *         -74709312968) or
        not raisesOverflowError(intExpr(          -123456791) *         -74709312969) or
        not raisesOverflowError(intExpr(           -12345654) *        -747094709113) or
        not raisesOverflowError(intExpr(           -12345653) *        -747094709114) or
        not raisesOverflowError(intExpr(            -9876554) *        -933865493037) or
        not raisesOverflowError(intExpr(            -9876553) *        -933865493038) or
        not raisesOverflowError(intExpr(             -644444) *      -14312161101687) or
        not raisesOverflowError(intExpr(             -644443) *      -14312161101688) or
        not raisesOverflowError(intExpr(              -38274) *     -240989001041328) or
        not raisesOverflowError(intExpr(              -38273) *     -240989001041329) or
        not raisesOverflowError(intExpr(               -4640) *    -1988224194191587) or
        not raisesOverflowError(intExpr(               -4639) *    -1988224194191588) or
        not raisesOverflowError(intExpr(                -858) *   -10762394442070916) or
        not raisesOverflowError(intExpr(                -857) *   -10762394442070917) or
        not raisesOverflowError(intExpr(                 -12) *  -838488366986797800) or
        not raisesOverflowError(intExpr(                 -11) *  -838488366986797801) or
        not raisesOverflowError(intExpr(                  -4) * -3074457345618258602) or
        not raisesOverflowError(intExpr(                  -3) * -3074457345618258603) or
        not raisesOverflowError(intExpr(                  -3) * -4611686018427387903) or
        not raisesOverflowError(intExpr(                  -2) * -4611686018427387904) or
        not raisesOverflowError(intExpr( 4611686018427387904) *                    2) or
        not raisesOverflowError(intExpr( 4611686018427387903) *                    3) or
        not raisesOverflowError(intExpr( 3074457345618258603) *                    3) or
        not raisesOverflowError(intExpr( 3074457345618258602) *                    4) or
        not raisesOverflowError(intExpr(  838488366986797801) *                   11) or
        not raisesOverflowError(intExpr(  838488366986797800) *                   12) or
        not raisesOverflowError(intExpr(   10762394442070917) *                  857) or
        not raisesOverflowError(intExpr(   10762394442070916) *                  858) or
        not raisesOverflowError(intExpr(    1988224194191588) *                 4639) or
        not raisesOverflowError(intExpr(    1988224194191587) *                 4640) or
        not raisesOverflowError(intExpr(     240989001041329) *                38273) or
        not raisesOverflowError(intExpr(     240989001041328) *                38274) or
        not raisesOverflowError(intExpr(      14312161101688) *               644443) or
        not raisesOverflowError(intExpr(      14312161101687) *               644444) or
        not raisesOverflowError(intExpr(        933865493038) *              9876553) or
        not raisesOverflowError(intExpr(        933865493037) *              9876554) or
        not raisesOverflowError(intExpr(        747094709114) *             12345653) or
        not raisesOverflowError(intExpr(        747094709113) *             12345654) or
        not raisesOverflowError(intExpr(         74709312969) *            123456791) or
        not raisesOverflowError(intExpr(         74709312968) *            123456792) or
        not raisesOverflowError(intExpr(          3037000500) *           3037000500) or
        not raisesOverflowError(intExpr(           123456792) *          74709312968) or
        not raisesOverflowError(intExpr(           123456791) *          74709312969) or
        not raisesOverflowError(intExpr(            12345654) *         747094709113) or
        not raisesOverflowError(intExpr(            12345653) *         747094709114) or
        not raisesOverflowError(intExpr(             9876554) *         933865493037) or
        not raisesOverflowError(intExpr(             9876553) *         933865493038) or
        not raisesOverflowError(intExpr(              644444) *       14312161101687) or
        not raisesOverflowError(intExpr(              644443) *       14312161101688) or
        not raisesOverflowError(intExpr(               38274) *      240989001041328) or
        not raisesOverflowError(intExpr(               38273) *      240989001041329) or
        not raisesOverflowError(intExpr(                4640) *     1988224194191587) or
        not raisesOverflowError(intExpr(                4639) *     1988224194191588) or
        not raisesOverflowError(intExpr(                 858) *    10762394442070916) or
        not raisesOverflowError(intExpr(                 857) *    10762394442070917) or
        not raisesOverflowError(intExpr(                  12) *   838488366986797800) or
        not raisesOverflowError(intExpr(                  11) *   838488366986797801) or
        not raisesOverflowError(intExpr(                   4) *  3074457345618258602) or
        not raisesOverflowError(intExpr(                   3) *  3074457345618258603) or
        not raisesOverflowError(intExpr(                   3) *  4611686018427387903) or
        not raisesOverflowError(intExpr(                   2) *  4611686018427387904) then
      writeln(" ***** Overflow when computing multiplication does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(           INT64_MIN * intExpr(                  -1)) or
        not raisesOverflowError(-4611686018427387904 * intExpr(                  -2)) or
        not raisesOverflowError(-4611686018427387903 * intExpr(                  -3)) or
        not raisesOverflowError(-3074457345618258603 * intExpr(                  -3)) or
        not raisesOverflowError(-3074457345618258602 * intExpr(                  -4)) or
        not raisesOverflowError( -838488366986797801 * intExpr(                 -11)) or
        not raisesOverflowError( -838488366986797800 * intExpr(                 -12)) or
        not raisesOverflowError(  -10762394442070917 * intExpr(                -857)) or
        not raisesOverflowError(  -10762394442070916 * intExpr(                -858)) or
        not raisesOverflowError(   -1988224194191588 * intExpr(               -4639)) or
        not raisesOverflowError(   -1988224194191587 * intExpr(               -4640)) or
        not raisesOverflowError(    -240989001041329 * intExpr(              -38273)) or
        not raisesOverflowError(    -240989001041328 * intExpr(              -38274)) or
        not raisesOverflowError(     -14312161101688 * intExpr(             -644443)) or
        not raisesOverflowError(     -14312161101687 * intExpr(             -644444)) or
        not raisesOverflowError(       -933865493038 * intExpr(            -9876553)) or
        not raisesOverflowError(       -933865493037 * intExpr(            -9876554)) or
        not raisesOverflowError(       -747094709114 * intExpr(           -12345653)) or
        not raisesOverflowError(       -747094709113 * intExpr(           -12345654)) or
        not raisesOverflowError(        -74709312969 * intExpr(          -123456791)) or
        not raisesOverflowError(        -74709312968 * intExpr(          -123456792)) or
        not raisesOverflowError(         -3037000500 * intExpr(         -3037000500)) or
        not raisesOverflowError(          -123456792 * intExpr(        -74709312968)) or
        not raisesOverflowError(          -123456791 * intExpr(        -74709312969)) or
        not raisesOverflowError(           -12345654 * intExpr(       -747094709113)) or
        not raisesOverflowError(           -12345653 * intExpr(       -747094709114)) or
        not raisesOverflowError(            -9876554 * intExpr(       -933865493037)) or
        not raisesOverflowError(            -9876553 * intExpr(       -933865493038)) or
        not raisesOverflowError(             -644444 * intExpr(     -14312161101687)) or
        not raisesOverflowError(             -644443 * intExpr(     -14312161101688)) or
        not raisesOverflowError(              -38274 * intExpr(    -240989001041328)) or
        not raisesOverflowError(              -38273 * intExpr(    -240989001041329)) or
        not raisesOverflowError(               -4640 * intExpr(   -1988224194191587)) or
        not raisesOverflowError(               -4639 * intExpr(   -1988224194191588)) or
        not raisesOverflowError(                -858 * intExpr(  -10762394442070916)) or
        not raisesOverflowError(                -857 * intExpr(  -10762394442070917)) or
        not raisesOverflowError(                 -12 * intExpr( -838488366986797800)) or
        not raisesOverflowError(                 -11 * intExpr( -838488366986797801)) or
        not raisesOverflowError(                  -4 * intExpr(-3074457345618258602)) or
        not raisesOverflowError(                  -3 * intExpr(-3074457345618258603)) or
        not raisesOverflowError(                  -3 * intExpr(-4611686018427387903)) or
        not raisesOverflowError(                  -2 * intExpr(-4611686018427387904)) or
        not raisesOverflowError( 4611686018427387904 * intExpr(                   2)) or
        not raisesOverflowError( 4611686018427387903 * intExpr(                   3)) or
        not raisesOverflowError( 3074457345618258603 * intExpr(                   3)) or
        not raisesOverflowError( 3074457345618258602 * intExpr(                   4)) or
        not raisesOverflowError(  838488366986797801 * intExpr(                  11)) or
        not raisesOverflowError(  838488366986797800 * intExpr(                  12)) or
        not raisesOverflowError(   10762394442070917 * intExpr(                 857)) or
        not raisesOverflowError(   10762394442070916 * intExpr(                 858)) or
        not raisesOverflowError(    1988224194191588 * intExpr(                4639)) or
        not raisesOverflowError(    1988224194191587 * intExpr(                4640)) or
        not raisesOverflowError(     240989001041329 * intExpr(               38273)) or
        not raisesOverflowError(     240989001041328 * intExpr(               38274)) or
        not raisesOverflowError(      14312161101688 * intExpr(              644443)) or
        not raisesOverflowError(      14312161101687 * intExpr(              644444)) or
        not raisesOverflowError(        933865493038 * intExpr(             9876553)) or
        not raisesOverflowError(        933865493037 * intExpr(             9876554)) or
        not raisesOverflowError(        747094709114 * intExpr(            12345653)) or
        not raisesOverflowError(        747094709113 * intExpr(            12345654)) or
        not raisesOverflowError(         74709312969 * intExpr(           123456791)) or
        not raisesOverflowError(         74709312968 * intExpr(           123456792)) or
        not raisesOverflowError(          3037000500 * intExpr(          3037000500)) or
        not raisesOverflowError(           123456792 * intExpr(         74709312968)) or
        not raisesOverflowError(           123456791 * intExpr(         74709312969)) or
        not raisesOverflowError(            12345654 * intExpr(        747094709113)) or
        not raisesOverflowError(            12345653 * intExpr(        747094709114)) or
        not raisesOverflowError(             9876554 * intExpr(        933865493037)) or
        not raisesOverflowError(             9876553 * intExpr(        933865493038)) or
        not raisesOverflowError(              644444 * intExpr(      14312161101687)) or
        not raisesOverflowError(              644443 * intExpr(      14312161101688)) or
        not raisesOverflowError(               38274 * intExpr(     240989001041328)) or
        not raisesOverflowError(               38273 * intExpr(     240989001041329)) or
        not raisesOverflowError(                4640 * intExpr(    1988224194191587)) or
        not raisesOverflowError(                4639 * intExpr(    1988224194191588)) or
        not raisesOverflowError(                 858 * intExpr(   10762394442070916)) or
        not raisesOverflowError(                 857 * intExpr(   10762394442070917)) or
        not raisesOverflowError(                  12 * intExpr(  838488366986797800)) or
        not raisesOverflowError(                  11 * intExpr(  838488366986797801)) or
        not raisesOverflowError(                   4 * intExpr( 3074457345618258602)) or
        not raisesOverflowError(                   3 * intExpr( 3074457345618258603)) or
        not raisesOverflowError(                   3 * intExpr( 4611686018427387903)) or
        not raisesOverflowError(                   2 * intExpr( 4611686018427387904)) then
      writeln(" ***** Overflow when computing multiplication does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) * intExpr(                  -1)) or
        not raisesOverflowError(intExpr(-4611686018427387904) * intExpr(                  -2)) or
        not raisesOverflowError(intExpr(-4611686018427387903) * intExpr(                  -3)) or
        not raisesOverflowError(intExpr(-3074457345618258603) * intExpr(                  -3)) or
        not raisesOverflowError(intExpr(-3074457345618258602) * intExpr(                  -4)) or
        not raisesOverflowError(intExpr( -838488366986797801) * intExpr(                 -11)) or
        not raisesOverflowError(intExpr( -838488366986797800) * intExpr(                 -12)) or
        not raisesOverflowError(intExpr(  -10762394442070917) * intExpr(                -857)) or
        not raisesOverflowError(intExpr(  -10762394442070916) * intExpr(                -858)) or
        not raisesOverflowError(intExpr(   -1988224194191588) * intExpr(               -4639)) or
        not raisesOverflowError(intExpr(   -1988224194191587) * intExpr(               -4640)) or
        not raisesOverflowError(intExpr(    -240989001041329) * intExpr(              -38273)) or
        not raisesOverflowError(intExpr(    -240989001041328) * intExpr(              -38274)) or
        not raisesOverflowError(intExpr(     -14312161101688) * intExpr(             -644443)) or
        not raisesOverflowError(intExpr(     -14312161101687) * intExpr(             -644444)) or
        not raisesOverflowError(intExpr(       -933865493038) * intExpr(            -9876553)) or
        not raisesOverflowError(intExpr(       -933865493037) * intExpr(            -9876554)) or
        not raisesOverflowError(intExpr(       -747094709114) * intExpr(           -12345653)) or
        not raisesOverflowError(intExpr(       -747094709113) * intExpr(           -12345654)) or
        not raisesOverflowError(intExpr(        -74709312969) * intExpr(          -123456791)) or
        not raisesOverflowError(intExpr(        -74709312968) * intExpr(          -123456792)) or
        not raisesOverflowError(intExpr(         -3037000500) * intExpr(         -3037000500)) or
        not raisesOverflowError(intExpr(          -123456792) * intExpr(        -74709312968)) or
        not raisesOverflowError(intExpr(          -123456791) * intExpr(        -74709312969)) or
        not raisesOverflowError(intExpr(           -12345654) * intExpr(       -747094709113)) or
        not raisesOverflowError(intExpr(           -12345653) * intExpr(       -747094709114)) or
        not raisesOverflowError(intExpr(            -9876554) * intExpr(       -933865493037)) or
        not raisesOverflowError(intExpr(            -9876553) * intExpr(       -933865493038)) or
        not raisesOverflowError(intExpr(             -644444) * intExpr(     -14312161101687)) or
        not raisesOverflowError(intExpr(             -644443) * intExpr(     -14312161101688)) or
        not raisesOverflowError(intExpr(              -38274) * intExpr(    -240989001041328)) or
        not raisesOverflowError(intExpr(              -38273) * intExpr(    -240989001041329)) or
        not raisesOverflowError(intExpr(               -4640) * intExpr(   -1988224194191587)) or
        not raisesOverflowError(intExpr(               -4639) * intExpr(   -1988224194191588)) or
        not raisesOverflowError(intExpr(                -858) * intExpr(  -10762394442070916)) or
        not raisesOverflowError(intExpr(                -857) * intExpr(  -10762394442070917)) or
        not raisesOverflowError(intExpr(                 -12) * intExpr( -838488366986797800)) or
        not raisesOverflowError(intExpr(                 -11) * intExpr( -838488366986797801)) or
        not raisesOverflowError(intExpr(                  -4) * intExpr(-3074457345618258602)) or
        not raisesOverflowError(intExpr(                  -3) * intExpr(-3074457345618258603)) or
        not raisesOverflowError(intExpr(                  -3) * intExpr(-4611686018427387903)) or
        not raisesOverflowError(intExpr(                  -2) * intExpr(-4611686018427387904)) or
        not raisesOverflowError(intExpr( 4611686018427387904) * intExpr(                   2)) or
        not raisesOverflowError(intExpr( 4611686018427387903) * intExpr(                   3)) or
        not raisesOverflowError(intExpr( 3074457345618258603) * intExpr(                   3)) or
        not raisesOverflowError(intExpr( 3074457345618258602) * intExpr(                   4)) or
        not raisesOverflowError(intExpr(  838488366986797801) * intExpr(                  11)) or
        not raisesOverflowError(intExpr(  838488366986797800) * intExpr(                  12)) or
        not raisesOverflowError(intExpr(   10762394442070917) * intExpr(                 857)) or
        not raisesOverflowError(intExpr(   10762394442070916) * intExpr(                 858)) or
        not raisesOverflowError(intExpr(    1988224194191588) * intExpr(                4639)) or
        not raisesOverflowError(intExpr(    1988224194191587) * intExpr(                4640)) or
        not raisesOverflowError(intExpr(     240989001041329) * intExpr(               38273)) or
        not raisesOverflowError(intExpr(     240989001041328) * intExpr(               38274)) or
        not raisesOverflowError(intExpr(      14312161101688) * intExpr(              644443)) or
        not raisesOverflowError(intExpr(      14312161101687) * intExpr(              644444)) or
        not raisesOverflowError(intExpr(        933865493038) * intExpr(             9876553)) or
        not raisesOverflowError(intExpr(        933865493037) * intExpr(             9876554)) or
        not raisesOverflowError(intExpr(        747094709114) * intExpr(            12345653)) or
        not raisesOverflowError(intExpr(        747094709113) * intExpr(            12345654)) or
        not raisesOverflowError(intExpr(         74709312969) * intExpr(           123456791)) or
        not raisesOverflowError(intExpr(         74709312968) * intExpr(           123456792)) or
        not raisesOverflowError(intExpr(          3037000500) * intExpr(          3037000500)) or
        not raisesOverflowError(intExpr(           123456792) * intExpr(         74709312968)) or
        not raisesOverflowError(intExpr(           123456791) * intExpr(         74709312969)) or
        not raisesOverflowError(intExpr(            12345654) * intExpr(        747094709113)) or
        not raisesOverflowError(intExpr(            12345653) * intExpr(        747094709114)) or
        not raisesOverflowError(intExpr(             9876554) * intExpr(        933865493037)) or
        not raisesOverflowError(intExpr(             9876553) * intExpr(        933865493038)) or
        not raisesOverflowError(intExpr(              644444) * intExpr(      14312161101687)) or
        not raisesOverflowError(intExpr(              644443) * intExpr(      14312161101688)) or
        not raisesOverflowError(intExpr(               38274) * intExpr(     240989001041328)) or
        not raisesOverflowError(intExpr(               38273) * intExpr(     240989001041329)) or
        not raisesOverflowError(intExpr(                4640) * intExpr(    1988224194191587)) or
        not raisesOverflowError(intExpr(                4639) * intExpr(    1988224194191588)) or
        not raisesOverflowError(intExpr(                 858) * intExpr(   10762394442070916)) or
        not raisesOverflowError(intExpr(                 857) * intExpr(   10762394442070917)) or
        not raisesOverflowError(intExpr(                  12) * intExpr(  838488366986797800)) or
        not raisesOverflowError(intExpr(                  11) * intExpr(  838488366986797801)) or
        not raisesOverflowError(intExpr(                   4) * intExpr( 3074457345618258602)) or
        not raisesOverflowError(intExpr(                   3) * intExpr( 3074457345618258603)) or
        not raisesOverflowError(intExpr(                   3) * intExpr( 4611686018427387903)) or
        not raisesOverflowError(intExpr(                   2) * intExpr( 4611686018427387904)) then
      writeln(" ***** Overflow when computing multiplication does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    if not check_reduced_overflow_checking_for_mult then
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of multiplication works correct.");
    else
      writeln(" ***** Overflow checking of multiplication does not work correct.");
    end if;
  end func;


const func boolean: check_mult_assign_1 is func
  result
    var boolean: okay is TRUE;
  local
    var boolean: ok is TRUE;
    var integer: num is 0;
  begin
    num := -4611686018427387905; ok := ok and raisesOverflowError(num *:=                    2);
    num := -4611686018427387904; ok := ok and raisesOverflowError(num *:=                    3);
    num := -3074457345618258603; ok := ok and raisesOverflowError(num *:=                    3);
    num := -3074457345618258602; ok := ok and raisesOverflowError(num *:=                    4);
    num :=  -838488366986797801; ok := ok and raisesOverflowError(num *:=                   11);
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num *:=                   12);
    num :=   -10762394442070917; ok := ok and raisesOverflowError(num *:=                  857);
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num *:=                  858);
    num :=    -1988224194191588; ok := ok and raisesOverflowError(num *:=                 4639);
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num *:=                 4640);
    num :=     -240989001041329; ok := ok and raisesOverflowError(num *:=                38273);
    num :=     -240989001041328; ok := ok and raisesOverflowError(num *:=                38274);
    num :=      -14312161101688; ok := ok and raisesOverflowError(num *:=               644443);
    num :=      -14312161101687; ok := ok and raisesOverflowError(num *:=               644444);
    num :=        -933865493038; ok := ok and raisesOverflowError(num *:=              9876553);
    num :=        -933865493037; ok := ok and raisesOverflowError(num *:=              9876554);
    num :=        -747094709114; ok := ok and raisesOverflowError(num *:=             12345653);
    num :=        -747094709113; ok := ok and raisesOverflowError(num *:=             12345654);
    num :=         -74709312969; ok := ok and raisesOverflowError(num *:=            123456791);
    num :=         -74709312968; ok := ok and raisesOverflowError(num *:=            123456792);
    num :=          -3037000500; ok := ok and raisesOverflowError(num *:=           3037000500);
    num :=           -123456792; ok := ok and raisesOverflowError(num *:=          74709312968);
    num :=           -123456791; ok := ok and raisesOverflowError(num *:=          74709312969);
    num :=            -12345654; ok := ok and raisesOverflowError(num *:=         747094709113);
    num :=            -12345653; ok := ok and raisesOverflowError(num *:=         747094709114);
    num :=             -9876554; ok := ok and raisesOverflowError(num *:=         933865493037);
    num :=             -9876553; ok := ok and raisesOverflowError(num *:=         933865493038);
    num :=              -644444; ok := ok and raisesOverflowError(num *:=       14312161101687);
    num :=              -644443; ok := ok and raisesOverflowError(num *:=       14312161101688);
    num :=               -38274; ok := ok and raisesOverflowError(num *:=      240989001041328);
    num :=               -38273; ok := ok and raisesOverflowError(num *:=      240989001041329);
    num :=                -4640; ok := ok and raisesOverflowError(num *:=     1988224194191587);
    num :=                -4639; ok := ok and raisesOverflowError(num *:=     1988224194191588);
    num :=                 -858; ok := ok and raisesOverflowError(num *:=    10762394442070916);
    num :=                 -857; ok := ok and raisesOverflowError(num *:=    10762394442070917);
    num :=                  -12; ok := ok and raisesOverflowError(num *:=   838488366986797800);
    num :=                  -11; ok := ok and raisesOverflowError(num *:=   838488366986797801);
    num :=                   -4; ok := ok and raisesOverflowError(num *:=  3074457345618258602);
    num :=                   -3; ok := ok and raisesOverflowError(num *:=  3074457345618258603);
    num :=                   -3; ok := ok and raisesOverflowError(num *:=  4611686018427387904);
    num :=                   -2; ok := ok and raisesOverflowError(num *:=  4611686018427387905);
    num :=  4611686018427387905; ok := ok and raisesOverflowError(num *:=                   -2);
    num :=  4611686018427387904; ok := ok and raisesOverflowError(num *:=                   -3);
    num :=  3074457345618258603; ok := ok and raisesOverflowError(num *:=                   -3);
    num :=  3074457345618258602; ok := ok and raisesOverflowError(num *:=                   -4);
    num :=   838488366986797801; ok := ok and raisesOverflowError(num *:=                  -11);
    num :=   838488366986797800; ok := ok and raisesOverflowError(num *:=                  -12);
    num :=    10762394442070917; ok := ok and raisesOverflowError(num *:=                 -857);
    num :=    10762394442070916; ok := ok and raisesOverflowError(num *:=                 -858);
    num :=     1988224194191588; ok := ok and raisesOverflowError(num *:=                -4639);
    num :=     1988224194191587; ok := ok and raisesOverflowError(num *:=                -4640);
    num :=      240989001041329; ok := ok and raisesOverflowError(num *:=               -38273);
    num :=      240989001041328; ok := ok and raisesOverflowError(num *:=               -38274);
    num :=       14312161101688; ok := ok and raisesOverflowError(num *:=              -644443);
    num :=       14312161101687; ok := ok and raisesOverflowError(num *:=              -644444);
    num :=         933865493038; ok := ok and raisesOverflowError(num *:=             -9876553);
    num :=         933865493037; ok := ok and raisesOverflowError(num *:=             -9876554);
    num :=         747094709114; ok := ok and raisesOverflowError(num *:=            -12345653);
    num :=         747094709113; ok := ok and raisesOverflowError(num *:=            -12345654);
    num :=          74709312969; ok := ok and raisesOverflowError(num *:=           -123456791);
    num :=          74709312968; ok := ok and raisesOverflowError(num *:=           -123456792);
    num :=           3037000500; ok := ok and raisesOverflowError(num *:=          -3037000500);
    num :=            123456792; ok := ok and raisesOverflowError(num *:=         -74709312968);
    num :=            123456791; ok := ok and raisesOverflowError(num *:=         -74709312969);
    num :=             12345654; ok := ok and raisesOverflowError(num *:=        -747094709113);
    num :=             12345653; ok := ok and raisesOverflowError(num *:=        -747094709114);
    num :=              9876554; ok := ok and raisesOverflowError(num *:=        -933865493037);
    num :=              9876553; ok := ok and raisesOverflowError(num *:=        -933865493038);
    num :=               644444; ok := ok and raisesOverflowError(num *:=      -14312161101687);
    num :=               644443; ok := ok and raisesOverflowError(num *:=      -14312161101688);
    num :=                38274; ok := ok and raisesOverflowError(num *:=     -240989001041328);
    num :=                38273; ok := ok and raisesOverflowError(num *:=     -240989001041329);
    num :=                 4640; ok := ok and raisesOverflowError(num *:=    -1988224194191587);
    num :=                 4639; ok := ok and raisesOverflowError(num *:=    -1988224194191588);
    num :=                  858; ok := ok and raisesOverflowError(num *:=   -10762394442070916);
    num :=                  857; ok := ok and raisesOverflowError(num *:=   -10762394442070917);
    num :=                   12; ok := ok and raisesOverflowError(num *:=  -838488366986797800);
    num :=                   11; ok := ok and raisesOverflowError(num *:=  -838488366986797801);
    num :=                    4; ok := ok and raisesOverflowError(num *:= -3074457345618258602);
    num :=                    3; ok := ok and raisesOverflowError(num *:= -3074457345618258603);
    num :=                    3; ok := ok and raisesOverflowError(num *:= -4611686018427387904);
    num :=                    2; ok := ok and raisesOverflowError(num *:= -4611686018427387905);
    if not ok then
      writeln(" ***** Underflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num *:=                   -1);
    num := -4611686018427387904; ok := ok and raisesOverflowError(num *:=                   -2);
    num := -4611686018427387903; ok := ok and raisesOverflowError(num *:=                   -3);
    num := -3074457345618258603; ok := ok and raisesOverflowError(num *:=                   -3);
    num := -3074457345618258602; ok := ok and raisesOverflowError(num *:=                   -4);
    num :=  -838488366986797801; ok := ok and raisesOverflowError(num *:=                  -11);
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num *:=                  -12);
    num :=   -10762394442070917; ok := ok and raisesOverflowError(num *:=                 -857);
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num *:=                 -858);
    num :=    -1988224194191588; ok := ok and raisesOverflowError(num *:=                -4639);
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num *:=                -4640);
    num :=     -240989001041329; ok := ok and raisesOverflowError(num *:=               -38273);
    num :=     -240989001041328; ok := ok and raisesOverflowError(num *:=               -38274);
    num :=      -14312161101688; ok := ok and raisesOverflowError(num *:=              -644443);
    num :=      -14312161101687; ok := ok and raisesOverflowError(num *:=              -644444);
    num :=        -933865493038; ok := ok and raisesOverflowError(num *:=             -9876553);
    num :=        -933865493037; ok := ok and raisesOverflowError(num *:=             -9876554);
    num :=        -747094709114; ok := ok and raisesOverflowError(num *:=            -12345653);
    num :=        -747094709113; ok := ok and raisesOverflowError(num *:=            -12345654);
    num :=         -74709312969; ok := ok and raisesOverflowError(num *:=           -123456791);
    num :=         -74709312968; ok := ok and raisesOverflowError(num *:=           -123456792);
    num :=          -3037000500; ok := ok and raisesOverflowError(num *:=          -3037000500);
    num :=           -123456792; ok := ok and raisesOverflowError(num *:=         -74709312968);
    num :=           -123456791; ok := ok and raisesOverflowError(num *:=         -74709312969);
    num :=            -12345654; ok := ok and raisesOverflowError(num *:=        -747094709113);
    num :=            -12345653; ok := ok and raisesOverflowError(num *:=        -747094709114);
    num :=             -9876554; ok := ok and raisesOverflowError(num *:=        -933865493037);
    num :=             -9876553; ok := ok and raisesOverflowError(num *:=        -933865493038);
    num :=              -644444; ok := ok and raisesOverflowError(num *:=      -14312161101687);
    num :=              -644443; ok := ok and raisesOverflowError(num *:=      -14312161101688);
    num :=               -38274; ok := ok and raisesOverflowError(num *:=     -240989001041328);
    num :=               -38273; ok := ok and raisesOverflowError(num *:=     -240989001041329);
    num :=                -4640; ok := ok and raisesOverflowError(num *:=    -1988224194191587);
    num :=                -4639; ok := ok and raisesOverflowError(num *:=    -1988224194191588);
    num :=                 -858; ok := ok and raisesOverflowError(num *:=   -10762394442070916);
    num :=                 -857; ok := ok and raisesOverflowError(num *:=   -10762394442070917);
    num :=                  -12; ok := ok and raisesOverflowError(num *:=  -838488366986797800);
    num :=                  -11; ok := ok and raisesOverflowError(num *:=  -838488366986797801);
    num :=                   -4; ok := ok and raisesOverflowError(num *:= -3074457345618258602);
    num :=                   -3; ok := ok and raisesOverflowError(num *:= -3074457345618258603);
    num :=                   -3; ok := ok and raisesOverflowError(num *:= -4611686018427387903);
    num :=                   -2; ok := ok and raisesOverflowError(num *:= -4611686018427387904);
    num :=  4611686018427387904; ok := ok and raisesOverflowError(num *:=                    2);
    num :=  4611686018427387903; ok := ok and raisesOverflowError(num *:=                    3);
    num :=  3074457345618258603; ok := ok and raisesOverflowError(num *:=                    3);
    num :=  3074457345618258602; ok := ok and raisesOverflowError(num *:=                    4);
    num :=   838488366986797801; ok := ok and raisesOverflowError(num *:=                   11);
    num :=   838488366986797800; ok := ok and raisesOverflowError(num *:=                   12);
    num :=    10762394442070917; ok := ok and raisesOverflowError(num *:=                  857);
    num :=    10762394442070916; ok := ok and raisesOverflowError(num *:=                  858);
    num :=     1988224194191588; ok := ok and raisesOverflowError(num *:=                 4639);
    num :=     1988224194191587; ok := ok and raisesOverflowError(num *:=                 4640);
    num :=      240989001041329; ok := ok and raisesOverflowError(num *:=                38273);
    num :=      240989001041328; ok := ok and raisesOverflowError(num *:=                38274);
    num :=       14312161101688; ok := ok and raisesOverflowError(num *:=               644443);
    num :=       14312161101687; ok := ok and raisesOverflowError(num *:=               644444);
    num :=         933865493038; ok := ok and raisesOverflowError(num *:=              9876553);
    num :=         933865493037; ok := ok and raisesOverflowError(num *:=              9876554);
    num :=         747094709114; ok := ok and raisesOverflowError(num *:=             12345653);
    num :=         747094709113; ok := ok and raisesOverflowError(num *:=             12345654);
    num :=          74709312969; ok := ok and raisesOverflowError(num *:=            123456791);
    num :=          74709312968; ok := ok and raisesOverflowError(num *:=            123456792);
    num :=           3037000500; ok := ok and raisesOverflowError(num *:=           3037000500);
    num :=            123456792; ok := ok and raisesOverflowError(num *:=          74709312968);
    num :=            123456791; ok := ok and raisesOverflowError(num *:=          74709312969);
    num :=             12345654; ok := ok and raisesOverflowError(num *:=         747094709113);
    num :=             12345653; ok := ok and raisesOverflowError(num *:=         747094709114);
    num :=              9876554; ok := ok and raisesOverflowError(num *:=         933865493037);
    num :=              9876553; ok := ok and raisesOverflowError(num *:=         933865493038);
    num :=               644444; ok := ok and raisesOverflowError(num *:=       14312161101687);
    num :=               644443; ok := ok and raisesOverflowError(num *:=       14312161101688);
    num :=                38274; ok := ok and raisesOverflowError(num *:=      240989001041328);
    num :=                38273; ok := ok and raisesOverflowError(num *:=      240989001041329);
    num :=                 4640; ok := ok and raisesOverflowError(num *:=     1988224194191587);
    num :=                 4639; ok := ok and raisesOverflowError(num *:=     1988224194191588);
    num :=                  858; ok := ok and raisesOverflowError(num *:=    10762394442070916);
    num :=                  857; ok := ok and raisesOverflowError(num *:=    10762394442070917);
    num :=                   12; ok := ok and raisesOverflowError(num *:=   838488366986797800);
    num :=                   11; ok := ok and raisesOverflowError(num *:=   838488366986797801);
    num :=                    4; ok := ok and raisesOverflowError(num *:=  3074457345618258602);
    num :=                    3; ok := ok and raisesOverflowError(num *:=  3074457345618258603);
    num :=                    3; ok := ok and raisesOverflowError(num *:=  4611686018427387903);
    num :=                    2; ok := ok and raisesOverflowError(num *:=  4611686018427387904);
    if not ok then
      writeln(" ***** Overflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;
  end func;


const func boolean: check_mult_assign_2 is func
  result
    var boolean: okay is TRUE;
  local
    var boolean: ok is TRUE;
    var integer: num is 0;
  begin
    num := -4611686018427387905; ok := ok and raisesOverflowError(num *:= intExpr(                   2));
    num := -4611686018427387904; ok := ok and raisesOverflowError(num *:= intExpr(                   3));
    num := -3074457345618258603; ok := ok and raisesOverflowError(num *:= intExpr(                   3));
    num := -3074457345618258602; ok := ok and raisesOverflowError(num *:= intExpr(                   4));
    num :=  -838488366986797801; ok := ok and raisesOverflowError(num *:= intExpr(                  11));
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num *:= intExpr(                  12));
    num :=   -10762394442070917; ok := ok and raisesOverflowError(num *:= intExpr(                 857));
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num *:= intExpr(                 858));
    num :=    -1988224194191588; ok := ok and raisesOverflowError(num *:= intExpr(                4639));
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num *:= intExpr(                4640));
    num :=     -240989001041329; ok := ok and raisesOverflowError(num *:= intExpr(               38273));
    num :=     -240989001041328; ok := ok and raisesOverflowError(num *:= intExpr(               38274));
    num :=      -14312161101688; ok := ok and raisesOverflowError(num *:= intExpr(              644443));
    num :=      -14312161101687; ok := ok and raisesOverflowError(num *:= intExpr(              644444));
    num :=        -933865493038; ok := ok and raisesOverflowError(num *:= intExpr(             9876553));
    num :=        -933865493037; ok := ok and raisesOverflowError(num *:= intExpr(             9876554));
    num :=        -747094709114; ok := ok and raisesOverflowError(num *:= intExpr(            12345653));
    num :=        -747094709113; ok := ok and raisesOverflowError(num *:= intExpr(            12345654));
    num :=         -74709312969; ok := ok and raisesOverflowError(num *:= intExpr(           123456791));
    num :=         -74709312968; ok := ok and raisesOverflowError(num *:= intExpr(           123456792));
    num :=          -3037000500; ok := ok and raisesOverflowError(num *:= intExpr(          3037000500));
    num :=           -123456792; ok := ok and raisesOverflowError(num *:= intExpr(         74709312968));
    num :=           -123456791; ok := ok and raisesOverflowError(num *:= intExpr(         74709312969));
    num :=            -12345654; ok := ok and raisesOverflowError(num *:= intExpr(        747094709113));
    num :=            -12345653; ok := ok and raisesOverflowError(num *:= intExpr(        747094709114));
    num :=             -9876554; ok := ok and raisesOverflowError(num *:= intExpr(        933865493037));
    num :=             -9876553; ok := ok and raisesOverflowError(num *:= intExpr(        933865493038));
    num :=              -644444; ok := ok and raisesOverflowError(num *:= intExpr(      14312161101687));
    num :=              -644443; ok := ok and raisesOverflowError(num *:= intExpr(      14312161101688));
    num :=               -38274; ok := ok and raisesOverflowError(num *:= intExpr(     240989001041328));
    num :=               -38273; ok := ok and raisesOverflowError(num *:= intExpr(     240989001041329));
    num :=                -4640; ok := ok and raisesOverflowError(num *:= intExpr(    1988224194191587));
    num :=                -4639; ok := ok and raisesOverflowError(num *:= intExpr(    1988224194191588));
    num :=                 -858; ok := ok and raisesOverflowError(num *:= intExpr(   10762394442070916));
    num :=                 -857; ok := ok and raisesOverflowError(num *:= intExpr(   10762394442070917));
    num :=                  -12; ok := ok and raisesOverflowError(num *:= intExpr(  838488366986797800));
    num :=                  -11; ok := ok and raisesOverflowError(num *:= intExpr(  838488366986797801));
    num :=                   -4; ok := ok and raisesOverflowError(num *:= intExpr( 3074457345618258602));
    num :=                   -3; ok := ok and raisesOverflowError(num *:= intExpr( 3074457345618258603));
    num :=                   -3; ok := ok and raisesOverflowError(num *:= intExpr( 4611686018427387904));
    num :=                   -2; ok := ok and raisesOverflowError(num *:= intExpr( 4611686018427387905));
    num :=  4611686018427387905; ok := ok and raisesOverflowError(num *:= intExpr(                  -2));
    num :=  4611686018427387904; ok := ok and raisesOverflowError(num *:= intExpr(                  -3));
    num :=  3074457345618258603; ok := ok and raisesOverflowError(num *:= intExpr(                  -3));
    num :=  3074457345618258602; ok := ok and raisesOverflowError(num *:= intExpr(                  -4));
    num :=   838488366986797801; ok := ok and raisesOverflowError(num *:= intExpr(                 -11));
    num :=   838488366986797800; ok := ok and raisesOverflowError(num *:= intExpr(                 -12));
    num :=    10762394442070917; ok := ok and raisesOverflowError(num *:= intExpr(                -857));
    num :=    10762394442070916; ok := ok and raisesOverflowError(num *:= intExpr(                -858));
    num :=     1988224194191588; ok := ok and raisesOverflowError(num *:= intExpr(               -4639));
    num :=     1988224194191587; ok := ok and raisesOverflowError(num *:= intExpr(               -4640));
    num :=      240989001041329; ok := ok and raisesOverflowError(num *:= intExpr(              -38273));
    num :=      240989001041328; ok := ok and raisesOverflowError(num *:= intExpr(              -38274));
    num :=       14312161101688; ok := ok and raisesOverflowError(num *:= intExpr(             -644443));
    num :=       14312161101687; ok := ok and raisesOverflowError(num *:= intExpr(             -644444));
    num :=         933865493038; ok := ok and raisesOverflowError(num *:= intExpr(            -9876553));
    num :=         933865493037; ok := ok and raisesOverflowError(num *:= intExpr(            -9876554));
    num :=         747094709114; ok := ok and raisesOverflowError(num *:= intExpr(           -12345653));
    num :=         747094709113; ok := ok and raisesOverflowError(num *:= intExpr(           -12345654));
    num :=          74709312969; ok := ok and raisesOverflowError(num *:= intExpr(          -123456791));
    num :=          74709312968; ok := ok and raisesOverflowError(num *:= intExpr(          -123456792));
    num :=           3037000500; ok := ok and raisesOverflowError(num *:= intExpr(         -3037000500));
    num :=            123456792; ok := ok and raisesOverflowError(num *:= intExpr(        -74709312968));
    num :=            123456791; ok := ok and raisesOverflowError(num *:= intExpr(        -74709312969));
    num :=             12345654; ok := ok and raisesOverflowError(num *:= intExpr(       -747094709113));
    num :=             12345653; ok := ok and raisesOverflowError(num *:= intExpr(       -747094709114));
    num :=              9876554; ok := ok and raisesOverflowError(num *:= intExpr(       -933865493037));
    num :=              9876553; ok := ok and raisesOverflowError(num *:= intExpr(       -933865493038));
    num :=               644444; ok := ok and raisesOverflowError(num *:= intExpr(     -14312161101687));
    num :=               644443; ok := ok and raisesOverflowError(num *:= intExpr(     -14312161101688));
    num :=                38274; ok := ok and raisesOverflowError(num *:= intExpr(    -240989001041328));
    num :=                38273; ok := ok and raisesOverflowError(num *:= intExpr(    -240989001041329));
    num :=                 4640; ok := ok and raisesOverflowError(num *:= intExpr(   -1988224194191587));
    num :=                 4639; ok := ok and raisesOverflowError(num *:= intExpr(   -1988224194191588));
    num :=                  858; ok := ok and raisesOverflowError(num *:= intExpr(  -10762394442070916));
    num :=                  857; ok := ok and raisesOverflowError(num *:= intExpr(  -10762394442070917));
    num :=                   12; ok := ok and raisesOverflowError(num *:= intExpr( -838488366986797800));
    num :=                   11; ok := ok and raisesOverflowError(num *:= intExpr( -838488366986797801));
    num :=                    4; ok := ok and raisesOverflowError(num *:= intExpr(-3074457345618258602));
    num :=                    3; ok := ok and raisesOverflowError(num *:= intExpr(-3074457345618258603));
    num :=                    3; ok := ok and raisesOverflowError(num *:= intExpr(-4611686018427387904));
    num :=                    2; ok := ok and raisesOverflowError(num *:= intExpr(-4611686018427387905));
    if not ok then
      writeln(" ***** Underflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    ok := TRUE;
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num *:= intExpr(                  -1));
    num := -4611686018427387904; ok := ok and raisesOverflowError(num *:= intExpr(                  -2));
    num := -4611686018427387903; ok := ok and raisesOverflowError(num *:= intExpr(                  -3));
    num := -3074457345618258603; ok := ok and raisesOverflowError(num *:= intExpr(                  -3));
    num := -3074457345618258602; ok := ok and raisesOverflowError(num *:= intExpr(                  -4));
    num :=  -838488366986797801; ok := ok and raisesOverflowError(num *:= intExpr(                 -11));
    num :=  -838488366986797800; ok := ok and raisesOverflowError(num *:= intExpr(                 -12));
    num :=   -10762394442070917; ok := ok and raisesOverflowError(num *:= intExpr(                -857));
    num :=   -10762394442070916; ok := ok and raisesOverflowError(num *:= intExpr(                -858));
    num :=    -1988224194191588; ok := ok and raisesOverflowError(num *:= intExpr(               -4639));
    num :=    -1988224194191587; ok := ok and raisesOverflowError(num *:= intExpr(               -4640));
    num :=     -240989001041329; ok := ok and raisesOverflowError(num *:= intExpr(              -38273));
    num :=     -240989001041328; ok := ok and raisesOverflowError(num *:= intExpr(              -38274));
    num :=      -14312161101688; ok := ok and raisesOverflowError(num *:= intExpr(             -644443));
    num :=      -14312161101687; ok := ok and raisesOverflowError(num *:= intExpr(             -644444));
    num :=        -933865493038; ok := ok and raisesOverflowError(num *:= intExpr(            -9876553));
    num :=        -933865493037; ok := ok and raisesOverflowError(num *:= intExpr(            -9876554));
    num :=        -747094709114; ok := ok and raisesOverflowError(num *:= intExpr(           -12345653));
    num :=        -747094709113; ok := ok and raisesOverflowError(num *:= intExpr(           -12345654));
    num :=         -74709312969; ok := ok and raisesOverflowError(num *:= intExpr(          -123456791));
    num :=         -74709312968; ok := ok and raisesOverflowError(num *:= intExpr(          -123456792));
    num :=          -3037000500; ok := ok and raisesOverflowError(num *:= intExpr(         -3037000500));
    num :=           -123456792; ok := ok and raisesOverflowError(num *:= intExpr(        -74709312968));
    num :=           -123456791; ok := ok and raisesOverflowError(num *:= intExpr(        -74709312969));
    num :=            -12345654; ok := ok and raisesOverflowError(num *:= intExpr(       -747094709113));
    num :=            -12345653; ok := ok and raisesOverflowError(num *:= intExpr(       -747094709114));
    num :=             -9876554; ok := ok and raisesOverflowError(num *:= intExpr(       -933865493037));
    num :=             -9876553; ok := ok and raisesOverflowError(num *:= intExpr(       -933865493038));
    num :=              -644444; ok := ok and raisesOverflowError(num *:= intExpr(     -14312161101687));
    num :=              -644443; ok := ok and raisesOverflowError(num *:= intExpr(     -14312161101688));
    num :=               -38274; ok := ok and raisesOverflowError(num *:= intExpr(    -240989001041328));
    num :=               -38273; ok := ok and raisesOverflowError(num *:= intExpr(    -240989001041329));
    num :=                -4640; ok := ok and raisesOverflowError(num *:= intExpr(   -1988224194191587));
    num :=                -4639; ok := ok and raisesOverflowError(num *:= intExpr(   -1988224194191588));
    num :=                 -858; ok := ok and raisesOverflowError(num *:= intExpr(  -10762394442070916));
    num :=                 -857; ok := ok and raisesOverflowError(num *:= intExpr(  -10762394442070917));
    num :=                  -12; ok := ok and raisesOverflowError(num *:= intExpr( -838488366986797800));
    num :=                  -11; ok := ok and raisesOverflowError(num *:= intExpr( -838488366986797801));
    num :=                   -4; ok := ok and raisesOverflowError(num *:= intExpr(-3074457345618258602));
    num :=                   -3; ok := ok and raisesOverflowError(num *:= intExpr(-3074457345618258603));
    num :=                   -3; ok := ok and raisesOverflowError(num *:= intExpr(-4611686018427387903));
    num :=                   -2; ok := ok and raisesOverflowError(num *:= intExpr(-4611686018427387904));
    num :=  4611686018427387904; ok := ok and raisesOverflowError(num *:= intExpr(                   2));
    num :=  4611686018427387903; ok := ok and raisesOverflowError(num *:= intExpr(                   3));
    num :=  3074457345618258603; ok := ok and raisesOverflowError(num *:= intExpr(                   3));
    num :=  3074457345618258602; ok := ok and raisesOverflowError(num *:= intExpr(                   4));
    num :=   838488366986797801; ok := ok and raisesOverflowError(num *:= intExpr(                  11));
    num :=   838488366986797800; ok := ok and raisesOverflowError(num *:= intExpr(                  12));
    num :=    10762394442070917; ok := ok and raisesOverflowError(num *:= intExpr(                 857));
    num :=    10762394442070916; ok := ok and raisesOverflowError(num *:= intExpr(                 858));
    num :=     1988224194191588; ok := ok and raisesOverflowError(num *:= intExpr(                4639));
    num :=     1988224194191587; ok := ok and raisesOverflowError(num *:= intExpr(                4640));
    num :=      240989001041329; ok := ok and raisesOverflowError(num *:= intExpr(               38273));
    num :=      240989001041328; ok := ok and raisesOverflowError(num *:= intExpr(               38274));
    num :=       14312161101688; ok := ok and raisesOverflowError(num *:= intExpr(              644443));
    num :=       14312161101687; ok := ok and raisesOverflowError(num *:= intExpr(              644444));
    num :=         933865493038; ok := ok and raisesOverflowError(num *:= intExpr(             9876553));
    num :=         933865493037; ok := ok and raisesOverflowError(num *:= intExpr(             9876554));
    num :=         747094709114; ok := ok and raisesOverflowError(num *:= intExpr(            12345653));
    num :=         747094709113; ok := ok and raisesOverflowError(num *:= intExpr(            12345654));
    num :=          74709312969; ok := ok and raisesOverflowError(num *:= intExpr(           123456791));
    num :=          74709312968; ok := ok and raisesOverflowError(num *:= intExpr(           123456792));
    num :=           3037000500; ok := ok and raisesOverflowError(num *:= intExpr(          3037000500));
    num :=            123456792; ok := ok and raisesOverflowError(num *:= intExpr(         74709312968));
    num :=            123456791; ok := ok and raisesOverflowError(num *:= intExpr(         74709312969));
    num :=             12345654; ok := ok and raisesOverflowError(num *:= intExpr(        747094709113));
    num :=             12345653; ok := ok and raisesOverflowError(num *:= intExpr(        747094709114));
    num :=              9876554; ok := ok and raisesOverflowError(num *:= intExpr(        933865493037));
    num :=              9876553; ok := ok and raisesOverflowError(num *:= intExpr(        933865493038));
    num :=               644444; ok := ok and raisesOverflowError(num *:= intExpr(      14312161101687));
    num :=               644443; ok := ok and raisesOverflowError(num *:= intExpr(      14312161101688));
    num :=                38274; ok := ok and raisesOverflowError(num *:= intExpr(     240989001041328));
    num :=                38273; ok := ok and raisesOverflowError(num *:= intExpr(     240989001041329));
    num :=                 4640; ok := ok and raisesOverflowError(num *:= intExpr(    1988224194191587));
    num :=                 4639; ok := ok and raisesOverflowError(num *:= intExpr(    1988224194191588));
    num :=                  858; ok := ok and raisesOverflowError(num *:= intExpr(   10762394442070916));
    num :=                  857; ok := ok and raisesOverflowError(num *:= intExpr(   10762394442070917));
    num :=                   12; ok := ok and raisesOverflowError(num *:= intExpr(  838488366986797800));
    num :=                   11; ok := ok and raisesOverflowError(num *:= intExpr(  838488366986797801));
    num :=                    4; ok := ok and raisesOverflowError(num *:= intExpr( 3074457345618258602));
    num :=                    3; ok := ok and raisesOverflowError(num *:= intExpr( 3074457345618258603));
    num :=                    3; ok := ok and raisesOverflowError(num *:= intExpr( 4611686018427387903));
    num :=                    2; ok := ok and raisesOverflowError(num *:= intExpr( 4611686018427387904));
    if not ok then
      writeln(" ***** Overflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;
  end func;


const func boolean: check_mult_assign_3 is func
  result
    var boolean: okay is TRUE;
  local
    var boolean: ok is TRUE;
    var array integer: arr is [] (0);
  begin
    arr[1] := -4611686018427387905; ok := ok and raisesOverflowError(arr[1] *:=                    2);
    arr[1] := -4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:=                    3);
    arr[1] := -3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:=                    3);
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:=                    4);
    arr[1] :=  -838488366986797801; ok := ok and raisesOverflowError(arr[1] *:=                   11);
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] *:=                   12);
    arr[1] :=   -10762394442070917; ok := ok and raisesOverflowError(arr[1] *:=                  857);
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] *:=                  858);
    arr[1] :=    -1988224194191588; ok := ok and raisesOverflowError(arr[1] *:=                 4639);
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] *:=                 4640);
    arr[1] :=     -240989001041329; ok := ok and raisesOverflowError(arr[1] *:=                38273);
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] *:=                38274);
    arr[1] :=      -14312161101688; ok := ok and raisesOverflowError(arr[1] *:=               644443);
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] *:=               644444);
    arr[1] :=        -933865493038; ok := ok and raisesOverflowError(arr[1] *:=              9876553);
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] *:=              9876554);
    arr[1] :=        -747094709114; ok := ok and raisesOverflowError(arr[1] *:=             12345653);
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] *:=             12345654);
    arr[1] :=         -74709312969; ok := ok and raisesOverflowError(arr[1] *:=            123456791);
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] *:=            123456792);
    arr[1] :=          -3037000500; ok := ok and raisesOverflowError(arr[1] *:=           3037000500);
    arr[1] :=           -123456792; ok := ok and raisesOverflowError(arr[1] *:=          74709312968);
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] *:=          74709312969);
    arr[1] :=            -12345654; ok := ok and raisesOverflowError(arr[1] *:=         747094709113);
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] *:=         747094709114);
    arr[1] :=             -9876554; ok := ok and raisesOverflowError(arr[1] *:=         933865493037);
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] *:=         933865493038);
    arr[1] :=              -644444; ok := ok and raisesOverflowError(arr[1] *:=       14312161101687);
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] *:=       14312161101688);
    arr[1] :=               -38274; ok := ok and raisesOverflowError(arr[1] *:=      240989001041328);
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] *:=      240989001041329);
    arr[1] :=                -4640; ok := ok and raisesOverflowError(arr[1] *:=     1988224194191587);
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] *:=     1988224194191588);
    arr[1] :=                 -858; ok := ok and raisesOverflowError(arr[1] *:=    10762394442070916);
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] *:=    10762394442070917);
    arr[1] :=                  -12; ok := ok and raisesOverflowError(arr[1] *:=   838488366986797800);
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] *:=   838488366986797801);
    arr[1] :=                   -4; ok := ok and raisesOverflowError(arr[1] *:=  3074457345618258602);
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:=  3074457345618258603);
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:=  4611686018427387904);
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] *:=  4611686018427387905);
    arr[1] :=  4611686018427387905; ok := ok and raisesOverflowError(arr[1] *:=                   -2);
    arr[1] :=  4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:=                   -3);
    arr[1] :=  3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:=                   -3);
    arr[1] :=  3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:=                   -4);
    arr[1] :=   838488366986797801; ok := ok and raisesOverflowError(arr[1] *:=                  -11);
    arr[1] :=   838488366986797800; ok := ok and raisesOverflowError(arr[1] *:=                  -12);
    arr[1] :=    10762394442070917; ok := ok and raisesOverflowError(arr[1] *:=                 -857);
    arr[1] :=    10762394442070916; ok := ok and raisesOverflowError(arr[1] *:=                 -858);
    arr[1] :=     1988224194191588; ok := ok and raisesOverflowError(arr[1] *:=                -4639);
    arr[1] :=     1988224194191587; ok := ok and raisesOverflowError(arr[1] *:=                -4640);
    arr[1] :=      240989001041329; ok := ok and raisesOverflowError(arr[1] *:=               -38273);
    arr[1] :=      240989001041328; ok := ok and raisesOverflowError(arr[1] *:=               -38274);
    arr[1] :=       14312161101688; ok := ok and raisesOverflowError(arr[1] *:=              -644443);
    arr[1] :=       14312161101687; ok := ok and raisesOverflowError(arr[1] *:=              -644444);
    arr[1] :=         933865493038; ok := ok and raisesOverflowError(arr[1] *:=             -9876553);
    arr[1] :=         933865493037; ok := ok and raisesOverflowError(arr[1] *:=             -9876554);
    arr[1] :=         747094709114; ok := ok and raisesOverflowError(arr[1] *:=            -12345653);
    arr[1] :=         747094709113; ok := ok and raisesOverflowError(arr[1] *:=            -12345654);
    arr[1] :=          74709312969; ok := ok and raisesOverflowError(arr[1] *:=           -123456791);
    arr[1] :=          74709312968; ok := ok and raisesOverflowError(arr[1] *:=           -123456792);
    arr[1] :=           3037000500; ok := ok and raisesOverflowError(arr[1] *:=          -3037000500);
    arr[1] :=            123456792; ok := ok and raisesOverflowError(arr[1] *:=         -74709312968);
    arr[1] :=            123456791; ok := ok and raisesOverflowError(arr[1] *:=         -74709312969);
    arr[1] :=             12345654; ok := ok and raisesOverflowError(arr[1] *:=        -747094709113);
    arr[1] :=             12345653; ok := ok and raisesOverflowError(arr[1] *:=        -747094709114);
    arr[1] :=              9876554; ok := ok and raisesOverflowError(arr[1] *:=        -933865493037);
    arr[1] :=              9876553; ok := ok and raisesOverflowError(arr[1] *:=        -933865493038);
    arr[1] :=               644444; ok := ok and raisesOverflowError(arr[1] *:=      -14312161101687);
    arr[1] :=               644443; ok := ok and raisesOverflowError(arr[1] *:=      -14312161101688);
    arr[1] :=                38274; ok := ok and raisesOverflowError(arr[1] *:=     -240989001041328);
    arr[1] :=                38273; ok := ok and raisesOverflowError(arr[1] *:=     -240989001041329);
    arr[1] :=                 4640; ok := ok and raisesOverflowError(arr[1] *:=    -1988224194191587);
    arr[1] :=                 4639; ok := ok and raisesOverflowError(arr[1] *:=    -1988224194191588);
    arr[1] :=                  858; ok := ok and raisesOverflowError(arr[1] *:=   -10762394442070916);
    arr[1] :=                  857; ok := ok and raisesOverflowError(arr[1] *:=   -10762394442070917);
    arr[1] :=                   12; ok := ok and raisesOverflowError(arr[1] *:=  -838488366986797800);
    arr[1] :=                   11; ok := ok and raisesOverflowError(arr[1] *:=  -838488366986797801);
    arr[1] :=                    4; ok := ok and raisesOverflowError(arr[1] *:= -3074457345618258602);
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:= -3074457345618258603);
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:= -4611686018427387904);
    arr[1] :=                    2; ok := ok and raisesOverflowError(arr[1] *:= -4611686018427387905);
    if not ok then
      writeln(" ***** Underflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] *:=                   -1);
    arr[1] := -4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:=                   -2);
    arr[1] := -4611686018427387903; ok := ok and raisesOverflowError(arr[1] *:=                   -3);
    arr[1] := -3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:=                   -3);
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:=                   -4);
    arr[1] :=  -838488366986797801; ok := ok and raisesOverflowError(arr[1] *:=                  -11);
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] *:=                  -12);
    arr[1] :=   -10762394442070917; ok := ok and raisesOverflowError(arr[1] *:=                 -857);
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] *:=                 -858);
    arr[1] :=    -1988224194191588; ok := ok and raisesOverflowError(arr[1] *:=                -4639);
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] *:=                -4640);
    arr[1] :=     -240989001041329; ok := ok and raisesOverflowError(arr[1] *:=               -38273);
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] *:=               -38274);
    arr[1] :=      -14312161101688; ok := ok and raisesOverflowError(arr[1] *:=              -644443);
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] *:=              -644444);
    arr[1] :=        -933865493038; ok := ok and raisesOverflowError(arr[1] *:=             -9876553);
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] *:=             -9876554);
    arr[1] :=        -747094709114; ok := ok and raisesOverflowError(arr[1] *:=            -12345653);
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] *:=            -12345654);
    arr[1] :=         -74709312969; ok := ok and raisesOverflowError(arr[1] *:=           -123456791);
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] *:=           -123456792);
    arr[1] :=          -3037000500; ok := ok and raisesOverflowError(arr[1] *:=          -3037000500);
    arr[1] :=           -123456792; ok := ok and raisesOverflowError(arr[1] *:=         -74709312968);
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] *:=         -74709312969);
    arr[1] :=            -12345654; ok := ok and raisesOverflowError(arr[1] *:=        -747094709113);
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] *:=        -747094709114);
    arr[1] :=             -9876554; ok := ok and raisesOverflowError(arr[1] *:=        -933865493037);
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] *:=        -933865493038);
    arr[1] :=              -644444; ok := ok and raisesOverflowError(arr[1] *:=      -14312161101687);
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] *:=      -14312161101688);
    arr[1] :=               -38274; ok := ok and raisesOverflowError(arr[1] *:=     -240989001041328);
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] *:=     -240989001041329);
    arr[1] :=                -4640; ok := ok and raisesOverflowError(arr[1] *:=    -1988224194191587);
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] *:=    -1988224194191588);
    arr[1] :=                 -858; ok := ok and raisesOverflowError(arr[1] *:=   -10762394442070916);
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] *:=   -10762394442070917);
    arr[1] :=                  -12; ok := ok and raisesOverflowError(arr[1] *:=  -838488366986797800);
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] *:=  -838488366986797801);
    arr[1] :=                   -4; ok := ok and raisesOverflowError(arr[1] *:= -3074457345618258602);
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:= -3074457345618258603);
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:= -4611686018427387903);
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] *:= -4611686018427387904);
    arr[1] :=  4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:=                    2);
    arr[1] :=  4611686018427387903; ok := ok and raisesOverflowError(arr[1] *:=                    3);
    arr[1] :=  3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:=                    3);
    arr[1] :=  3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:=                    4);
    arr[1] :=   838488366986797801; ok := ok and raisesOverflowError(arr[1] *:=                   11);
    arr[1] :=   838488366986797800; ok := ok and raisesOverflowError(arr[1] *:=                   12);
    arr[1] :=    10762394442070917; ok := ok and raisesOverflowError(arr[1] *:=                  857);
    arr[1] :=    10762394442070916; ok := ok and raisesOverflowError(arr[1] *:=                  858);
    arr[1] :=     1988224194191588; ok := ok and raisesOverflowError(arr[1] *:=                 4639);
    arr[1] :=     1988224194191587; ok := ok and raisesOverflowError(arr[1] *:=                 4640);
    arr[1] :=      240989001041329; ok := ok and raisesOverflowError(arr[1] *:=                38273);
    arr[1] :=      240989001041328; ok := ok and raisesOverflowError(arr[1] *:=                38274);
    arr[1] :=       14312161101688; ok := ok and raisesOverflowError(arr[1] *:=               644443);
    arr[1] :=       14312161101687; ok := ok and raisesOverflowError(arr[1] *:=               644444);
    arr[1] :=         933865493038; ok := ok and raisesOverflowError(arr[1] *:=              9876553);
    arr[1] :=         933865493037; ok := ok and raisesOverflowError(arr[1] *:=              9876554);
    arr[1] :=         747094709114; ok := ok and raisesOverflowError(arr[1] *:=             12345653);
    arr[1] :=         747094709113; ok := ok and raisesOverflowError(arr[1] *:=             12345654);
    arr[1] :=          74709312969; ok := ok and raisesOverflowError(arr[1] *:=            123456791);
    arr[1] :=          74709312968; ok := ok and raisesOverflowError(arr[1] *:=            123456792);
    arr[1] :=           3037000500; ok := ok and raisesOverflowError(arr[1] *:=           3037000500);
    arr[1] :=            123456792; ok := ok and raisesOverflowError(arr[1] *:=          74709312968);
    arr[1] :=            123456791; ok := ok and raisesOverflowError(arr[1] *:=          74709312969);
    arr[1] :=             12345654; ok := ok and raisesOverflowError(arr[1] *:=         747094709113);
    arr[1] :=             12345653; ok := ok and raisesOverflowError(arr[1] *:=         747094709114);
    arr[1] :=              9876554; ok := ok and raisesOverflowError(arr[1] *:=         933865493037);
    arr[1] :=              9876553; ok := ok and raisesOverflowError(arr[1] *:=         933865493038);
    arr[1] :=               644444; ok := ok and raisesOverflowError(arr[1] *:=       14312161101687);
    arr[1] :=               644443; ok := ok and raisesOverflowError(arr[1] *:=       14312161101688);
    arr[1] :=                38274; ok := ok and raisesOverflowError(arr[1] *:=      240989001041328);
    arr[1] :=                38273; ok := ok and raisesOverflowError(arr[1] *:=      240989001041329);
    arr[1] :=                 4640; ok := ok and raisesOverflowError(arr[1] *:=     1988224194191587);
    arr[1] :=                 4639; ok := ok and raisesOverflowError(arr[1] *:=     1988224194191588);
    arr[1] :=                  858; ok := ok and raisesOverflowError(arr[1] *:=    10762394442070916);
    arr[1] :=                  857; ok := ok and raisesOverflowError(arr[1] *:=    10762394442070917);
    arr[1] :=                   12; ok := ok and raisesOverflowError(arr[1] *:=   838488366986797800);
    arr[1] :=                   11; ok := ok and raisesOverflowError(arr[1] *:=   838488366986797801);
    arr[1] :=                    4; ok := ok and raisesOverflowError(arr[1] *:=  3074457345618258602);
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:=  3074457345618258603);
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:=  4611686018427387903);
    arr[1] :=                    2; ok := ok and raisesOverflowError(arr[1] *:=  4611686018427387904);
    if not ok then
      writeln(" ***** Overflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;
  end func;


const func boolean: check_mult_assign_4 is func
  result
    var boolean: okay is TRUE;
  local
    var boolean: ok is TRUE;
    var array integer: arr is [] (0);
  begin
    arr[1] := -4611686018427387905; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   2));
    arr[1] := -4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   3));
    arr[1] := -3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   3));
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   4));
    arr[1] :=  -838488366986797801; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  11));
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  12));
    arr[1] :=   -10762394442070917; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 857));
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 858));
    arr[1] :=    -1988224194191588; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                4639));
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                4640));
    arr[1] :=     -240989001041329; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               38273));
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               38274));
    arr[1] :=      -14312161101688; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              644443));
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              644444));
    arr[1] :=        -933865493038; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             9876553));
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             9876554));
    arr[1] :=        -747094709114; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            12345653));
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            12345654));
    arr[1] :=         -74709312969; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           123456791));
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           123456792));
    arr[1] :=          -3037000500; ok := ok and raisesOverflowError(arr[1] *:= intExpr(          3037000500));
    arr[1] :=           -123456792; ok := ok and raisesOverflowError(arr[1] *:= intExpr(         74709312968));
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] *:= intExpr(         74709312969));
    arr[1] :=            -12345654; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        747094709113));
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        747094709114));
    arr[1] :=             -9876554; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        933865493037));
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        933865493038));
    arr[1] :=              -644444; ok := ok and raisesOverflowError(arr[1] *:= intExpr(      14312161101687));
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] *:= intExpr(      14312161101688));
    arr[1] :=               -38274; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     240989001041328));
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     240989001041329));
    arr[1] :=                -4640; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    1988224194191587));
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    1988224194191588));
    arr[1] :=                 -858; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   10762394442070916));
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   10762394442070917));
    arr[1] :=                  -12; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  838488366986797800));
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  838488366986797801));
    arr[1] :=                   -4; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 3074457345618258602));
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 3074457345618258603));
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 4611686018427387904));
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 4611686018427387905));
    arr[1] :=  4611686018427387905; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -2));
    arr[1] :=  4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -3));
    arr[1] :=  3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -3));
    arr[1] :=  3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -4));
    arr[1] :=   838488366986797801; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 -11));
    arr[1] :=   838488366986797800; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 -12));
    arr[1] :=    10762394442070917; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                -857));
    arr[1] :=    10762394442070916; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                -858));
    arr[1] :=     1988224194191588; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               -4639));
    arr[1] :=     1988224194191587; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               -4640));
    arr[1] :=      240989001041329; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              -38273));
    arr[1] :=      240989001041328; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              -38274));
    arr[1] :=       14312161101688; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             -644443));
    arr[1] :=       14312161101687; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             -644444));
    arr[1] :=         933865493038; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            -9876553));
    arr[1] :=         933865493037; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            -9876554));
    arr[1] :=         747094709114; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           -12345653));
    arr[1] :=         747094709113; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           -12345654));
    arr[1] :=          74709312969; ok := ok and raisesOverflowError(arr[1] *:= intExpr(          -123456791));
    arr[1] :=          74709312968; ok := ok and raisesOverflowError(arr[1] *:= intExpr(          -123456792));
    arr[1] :=           3037000500; ok := ok and raisesOverflowError(arr[1] *:= intExpr(         -3037000500));
    arr[1] :=            123456792; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        -74709312968));
    arr[1] :=            123456791; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        -74709312969));
    arr[1] :=             12345654; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -747094709113));
    arr[1] :=             12345653; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -747094709114));
    arr[1] :=              9876554; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -933865493037));
    arr[1] :=              9876553; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -933865493038));
    arr[1] :=               644444; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     -14312161101687));
    arr[1] :=               644443; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     -14312161101688));
    arr[1] :=                38274; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    -240989001041328));
    arr[1] :=                38273; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    -240989001041329));
    arr[1] :=                 4640; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   -1988224194191587));
    arr[1] :=                 4639; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   -1988224194191588));
    arr[1] :=                  858; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  -10762394442070916));
    arr[1] :=                  857; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  -10762394442070917));
    arr[1] :=                   12; ok := ok and raisesOverflowError(arr[1] *:= intExpr( -838488366986797800));
    arr[1] :=                   11; ok := ok and raisesOverflowError(arr[1] *:= intExpr( -838488366986797801));
    arr[1] :=                    4; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-3074457345618258602));
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-3074457345618258603));
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-4611686018427387904));
    arr[1] :=                    2; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-4611686018427387905));
    if not ok then
      writeln(" ***** Underflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    ok := TRUE;
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -1));
    arr[1] := -4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -2));
    arr[1] := -4611686018427387903; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -3));
    arr[1] := -3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -3));
    arr[1] := -3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  -4));
    arr[1] :=  -838488366986797801; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 -11));
    arr[1] :=  -838488366986797800; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 -12));
    arr[1] :=   -10762394442070917; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                -857));
    arr[1] :=   -10762394442070916; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                -858));
    arr[1] :=    -1988224194191588; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               -4639));
    arr[1] :=    -1988224194191587; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               -4640));
    arr[1] :=     -240989001041329; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              -38273));
    arr[1] :=     -240989001041328; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              -38274));
    arr[1] :=      -14312161101688; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             -644443));
    arr[1] :=      -14312161101687; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             -644444));
    arr[1] :=        -933865493038; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            -9876553));
    arr[1] :=        -933865493037; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            -9876554));
    arr[1] :=        -747094709114; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           -12345653));
    arr[1] :=        -747094709113; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           -12345654));
    arr[1] :=         -74709312969; ok := ok and raisesOverflowError(arr[1] *:= intExpr(          -123456791));
    arr[1] :=         -74709312968; ok := ok and raisesOverflowError(arr[1] *:= intExpr(          -123456792));
    arr[1] :=          -3037000500; ok := ok and raisesOverflowError(arr[1] *:= intExpr(         -3037000500));
    arr[1] :=           -123456792; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        -74709312968));
    arr[1] :=           -123456791; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        -74709312969));
    arr[1] :=            -12345654; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -747094709113));
    arr[1] :=            -12345653; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -747094709114));
    arr[1] :=             -9876554; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -933865493037));
    arr[1] :=             -9876553; ok := ok and raisesOverflowError(arr[1] *:= intExpr(       -933865493038));
    arr[1] :=              -644444; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     -14312161101687));
    arr[1] :=              -644443; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     -14312161101688));
    arr[1] :=               -38274; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    -240989001041328));
    arr[1] :=               -38273; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    -240989001041329));
    arr[1] :=                -4640; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   -1988224194191587));
    arr[1] :=                -4639; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   -1988224194191588));
    arr[1] :=                 -858; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  -10762394442070916));
    arr[1] :=                 -857; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  -10762394442070917));
    arr[1] :=                  -12; ok := ok and raisesOverflowError(arr[1] *:= intExpr( -838488366986797800));
    arr[1] :=                  -11; ok := ok and raisesOverflowError(arr[1] *:= intExpr( -838488366986797801));
    arr[1] :=                   -4; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-3074457345618258602));
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-3074457345618258603));
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-4611686018427387903));
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] *:= intExpr(-4611686018427387904));
    arr[1] :=  4611686018427387904; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   2));
    arr[1] :=  4611686018427387903; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   3));
    arr[1] :=  3074457345618258603; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   3));
    arr[1] :=  3074457345618258602; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                   4));
    arr[1] :=   838488366986797801; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  11));
    arr[1] :=   838488366986797800; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                  12));
    arr[1] :=    10762394442070917; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 857));
    arr[1] :=    10762394442070916; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                 858));
    arr[1] :=     1988224194191588; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                4639));
    arr[1] :=     1988224194191587; ok := ok and raisesOverflowError(arr[1] *:= intExpr(                4640));
    arr[1] :=      240989001041329; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               38273));
    arr[1] :=      240989001041328; ok := ok and raisesOverflowError(arr[1] *:= intExpr(               38274));
    arr[1] :=       14312161101688; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              644443));
    arr[1] :=       14312161101687; ok := ok and raisesOverflowError(arr[1] *:= intExpr(              644444));
    arr[1] :=         933865493038; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             9876553));
    arr[1] :=         933865493037; ok := ok and raisesOverflowError(arr[1] *:= intExpr(             9876554));
    arr[1] :=         747094709114; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            12345653));
    arr[1] :=         747094709113; ok := ok and raisesOverflowError(arr[1] *:= intExpr(            12345654));
    arr[1] :=          74709312969; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           123456791));
    arr[1] :=          74709312968; ok := ok and raisesOverflowError(arr[1] *:= intExpr(           123456792));
    arr[1] :=           3037000500; ok := ok and raisesOverflowError(arr[1] *:= intExpr(          3037000500));
    arr[1] :=            123456792; ok := ok and raisesOverflowError(arr[1] *:= intExpr(         74709312968));
    arr[1] :=            123456791; ok := ok and raisesOverflowError(arr[1] *:= intExpr(         74709312969));
    arr[1] :=             12345654; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        747094709113));
    arr[1] :=             12345653; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        747094709114));
    arr[1] :=              9876554; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        933865493037));
    arr[1] :=              9876553; ok := ok and raisesOverflowError(arr[1] *:= intExpr(        933865493038));
    arr[1] :=               644444; ok := ok and raisesOverflowError(arr[1] *:= intExpr(      14312161101687));
    arr[1] :=               644443; ok := ok and raisesOverflowError(arr[1] *:= intExpr(      14312161101688));
    arr[1] :=                38274; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     240989001041328));
    arr[1] :=                38273; ok := ok and raisesOverflowError(arr[1] *:= intExpr(     240989001041329));
    arr[1] :=                 4640; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    1988224194191587));
    arr[1] :=                 4639; ok := ok and raisesOverflowError(arr[1] *:= intExpr(    1988224194191588));
    arr[1] :=                  858; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   10762394442070916));
    arr[1] :=                  857; ok := ok and raisesOverflowError(arr[1] *:= intExpr(   10762394442070917));
    arr[1] :=                   12; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  838488366986797800));
    arr[1] :=                   11; ok := ok and raisesOverflowError(arr[1] *:= intExpr(  838488366986797801));
    arr[1] :=                    4; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 3074457345618258602));
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 3074457345618258603));
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 4611686018427387903));
    arr[1] :=                    2; ok := ok and raisesOverflowError(arr[1] *:= intExpr( 4611686018427387904));
    if not ok then
      writeln(" ***** Overflow when computing multiplication assignment does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;
  end func;


const proc: check_mult_assign is func
  begin
    if  check_mult_assign_1 and
        check_mult_assign_2 and
        check_mult_assign_3 and
        check_mult_assign_4 then
      writeln("Overflow checking of multiplication assignment works correct.");
    else
      writeln(" ***** Overflow checking of multiplication assignment does not work correct.");
    end if;
  end func;


const proc: check_div is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(                      INT64_MIN   div         -1 ) or
        not raisesOverflowError(intExpr(              INT64_MIN)  div         -1 ) or
        not raisesOverflowError(                      INT64_MIN   div intExpr(-1)) or
        not raisesOverflowError(intExpr(              INT64_MIN)  div intExpr(-1)) or
        not raisesOverflowError(        (-9223372036854775807-1)  div         -1 ) or
        not raisesOverflowError(intExpr((-9223372036854775807-1)) div         -1 ) or
        not raisesOverflowError(        (-9223372036854775807-1)  div intExpr(-1)) or
        not raisesOverflowError(intExpr((-9223372036854775807-1)) div intExpr(-1)) then
      writeln(" ***** Computing -9223372036854775808 div -1 does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of div operator works correct.");
    else
      writeln(" ***** Overflow checking of div operator does not work correct.");
    end if;
  end func;


const proc: check_rem is func
  local
    var boolean: okay is TRUE;
  begin
    # An integer expression must either raise OVERFLOW_ERROR or return the correct result.
    if  not (raisesOverflowError(                     INT64_MIN  rem         -1 )      or
                                                      INT64_MIN  rem         -1   = 0) or
        not (raisesOverflowError(intExpr(             INT64_MIN) rem         -1 )      or
                                 intExpr(             INT64_MIN) rem         -1   = 0) or
        not (raisesOverflowError(                     INT64_MIN  rem intExpr(-1))      or
                                                      INT64_MIN  rem intExpr(-1)  = 0) or
        not (raisesOverflowError(intExpr(             INT64_MIN) rem intExpr(-1))      or
                                 intExpr(             INT64_MIN) rem intExpr(-1)  = 0) or
        not (raisesOverflowError(       (-9223372036854775807-1) rem         -1 )      or
                                        (-9223372036854775807-1) rem         -1   = 0) or
        not (raisesOverflowError(intExpr(-9223372036854775807-1) rem         -1 )      or
                                 intExpr(-9223372036854775807-1) rem         -1   = 0) or
        not (raisesOverflowError(       (-9223372036854775807-1) rem intExpr(-1))      or
                                        (-9223372036854775807-1) rem intExpr(-1)  = 0) or
        not (raisesOverflowError(intExpr(-9223372036854775807-1) rem intExpr(-1))      or
                                 intExpr(-9223372036854775807-1) rem intExpr(-1)  = 0) then
      writeln(" ***** Computing -9223372036854775808 rem -1 does neither raise OVERFLOW_ERROR nor return 0.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of rem operator works correct.");
    else
      writeln(" ***** Overflow checking of rem operator does not work correct.");
    end if;
  end func;


const proc: check_mdiv is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(                      INT64_MIN   mdiv         -1 ) or
        not raisesOverflowError(intExpr(              INT64_MIN)  mdiv         -1 ) or
        not raisesOverflowError(                      INT64_MIN   mdiv intExpr(-1)) or
        not raisesOverflowError(intExpr(              INT64_MIN)  mdiv intExpr(-1)) or
        not raisesOverflowError(        (-9223372036854775807-1)  mdiv         -1 ) or
        not raisesOverflowError(intExpr((-9223372036854775807-1)) mdiv         -1 ) or
        not raisesOverflowError(        (-9223372036854775807-1)  mdiv intExpr(-1)) or
        not raisesOverflowError(intExpr((-9223372036854775807-1)) mdiv intExpr(-1)) then
      writeln(" ***** Computing -9223372036854775808 mdiv -1 does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of mdiv operator works correct.");
    else
      writeln(" ***** Overflow checking of mdiv operator does not work correct.");
    end if;
  end func;


const proc: check_mod is func
  local
    var boolean: okay is TRUE;
  begin
    # An integer expression must either raise OVERFLOW_ERROR or return the correct result.
    if  not (raisesOverflowError(                     INT64_MIN  mod         -1 )      or
                                                      INT64_MIN  mod         -1   = 0) or
        not (raisesOverflowError(intExpr(             INT64_MIN) mod         -1 )      or
                                 intExpr(             INT64_MIN) mod         -1   = 0) or
        not (raisesOverflowError(                     INT64_MIN  mod intExpr(-1))      or
                                                      INT64_MIN  mod intExpr(-1)  = 0) or
        not (raisesOverflowError(intExpr(             INT64_MIN) mod intExpr(-1))      or
                                 intExpr(             INT64_MIN) mod intExpr(-1)  = 0) or
        not (raisesOverflowError(       (-9223372036854775807-1) mod         -1 )      or
                                        (-9223372036854775807-1) mod         -1   = 0) or
        not (raisesOverflowError(intExpr(-9223372036854775807-1) mod         -1 )      or
                                 intExpr(-9223372036854775807-1) mod         -1   = 0) or
        not (raisesOverflowError(       (-9223372036854775807-1) mod intExpr(-1))      or
                                        (-9223372036854775807-1) mod intExpr(-1)  = 0) or
        not (raisesOverflowError(intExpr(-9223372036854775807-1) mod intExpr(-1))      or
                                 intExpr(-9223372036854775807-1) mod intExpr(-1)  = 0) then
      writeln(" ***** Computing -9223372036854775808 mod -1 does neither raise OVERFLOW_ERROR nor return 0.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((1          <<         -1 ) mod 32) or
        not raisesOverflowError((1          << intExpr(-1)) mod 32) or
        not raisesOverflowError((intExpr(1) <<         -1 ) mod 32) or
        not raisesOverflowError((intExpr(1) << intExpr(-1)) mod 32) or
        not raisesOverflowError((intExpr(1  <<         -1)) mod 32) then
      writeln(" ***** Computing (1 << -1) mod 32 does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(succ(1          <<         -1 ) mod 32) or
        not raisesOverflowError(succ(1          << intExpr(-1)) mod 32) or
        not raisesOverflowError(succ(intExpr(1) <<         -1 ) mod 32) or
        not raisesOverflowError(succ(intExpr(1) << intExpr(-1)) mod 32) or
        not raisesOverflowError(succ(intExpr(1  <<         -1)) mod 32) then
      writeln(" ***** Computing succ(1 << -1) mod 32 does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(        5678901234567890123  mod (1 <<         -1 )) or
        not raisesOverflowError(        5678901234567890123  mod (1 << intExpr(-1))) or
        not raisesOverflowError(intExpr(5678901234567890123) mod (1 <<         -1 )) or
        not raisesOverflowError(intExpr(5678901234567890123) mod (1 << intExpr(-1))) then
      writeln(" ***** mod by computed power of two does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of mod operator works correct.");
    else
      writeln(" ***** Overflow checking of mod operator does not work correct.");
    end if;
  end func;


(**
 *  Tests for the compiler optimization to reduce overflow checking
 *  for lshift.
 *)
const func boolean: check_reduced_overflow_checking_for_lshift is func
  result
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError((intExpr(integer.first) >>  0) <<  1) or
        not raisesOverflowError((intExpr(integer.first) >>  1) <<  2) or
        not raisesOverflowError((intExpr(integer.first) >> 30) << 31) or
        not raisesOverflowError((intExpr(integer.first) >> 62) << 63) then
      writeln(" ***** Reduced overflow check for lshift failed: Minimum rshift result if the shift amount is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((intExpr( integer.last) >>  0) <<  1) or
        not raisesOverflowError((intExpr( integer.last) >>  1) <<  2) or
        not raisesOverflowError((intExpr( integer.last) >> 30) << 31) or
        not raisesOverflowError((intExpr( integer.last) >> 62) << 63) then
      writeln(" ***** Reduced overflow check for lshift failed: Maximum rshift result if the shift amount is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((       integer.first >> intExpr( 0)) <<  1) or
        not raisesOverflowError((       -integer.last >> intExpr( 0)) <<  1) or
        not raisesOverflowError((-4611686018427387905 >> intExpr( 0)) <<  1) or
        not raisesOverflowError((-4611686018427387904 >> intExpr( 0)) <<  2) or
        not raisesOverflowError((         -8589934593 >> intExpr( 0)) << 30) or
        not raisesOverflowError((         -8589934592 >> intExpr( 0)) << 31) or
        not raisesOverflowError((         -1234567890 >> intExpr( 0)) << 33) or
        not raisesOverflowError((                  -2 >> intExpr( 0)) << 63) then
      writeln(" ***** Reduced overflow check for lshift failed: Minimum rshift result if the shifted value is known.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((                   1 >> intExpr( 0)) << 63) or
        not raisesOverflowError((                   2 >> intExpr( 0)) << 62) or
        not raisesOverflowError((          1234567890 >> intExpr( 0)) << 33) or
        not raisesOverflowError((          8589934591 >> intExpr( 0)) << 31) or
        not raisesOverflowError((          8589934592 >> intExpr( 0)) << 30) or
        not raisesOverflowError(( 4611686018427387903 >> intExpr( 0)) <<  2) or
        not raisesOverflowError(( 4611686018427387904 >> intExpr( 0)) <<  1) or
        not raisesOverflowError((        integer.last >> intExpr( 0)) <<  1)  then
      writeln(" ***** Reduced overflow check for lshift failed: Maximum rshift result if the shifted value is known.");
      okay := FALSE;
    end if;
  end func;


const proc: check_lShift is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(           INT64_MIN <<  1) or
        not raisesOverflowError(-4611686018427387905 <<  1) or
        not raisesOverflowError(-4611686018427387904 <<  2) or
        not raisesOverflowError(-2305843009213693953 <<  2) or
        not raisesOverflowError(-2305843009213693952 <<  3) or
        not raisesOverflowError(-1152921504606846977 <<  3) or
        not raisesOverflowError( -576460752303423489 <<  4) or
        not raisesOverflowError( -576460752303423488 <<  5) or
        not raisesOverflowError( -288230376151711745 <<  5) or
        not raisesOverflowError( -288230376151711744 <<  6) or
        not raisesOverflowError(   -9007199254740993 << 10) or
        not raisesOverflowError(   -9007199254740992 << 11) or
        not raisesOverflowError(    -281474976710657 << 15) or
        not raisesOverflowError(    -281474976710656 << 16) or
        not raisesOverflowError(      -8796093022209 << 20) or
        not raisesOverflowError(      -8796093022208 << 21) or
        not raisesOverflowError(       -274877906945 << 25) or
        not raisesOverflowError(       -274877906944 << 26) or
        not raisesOverflowError(         -8589934593 << 30) or
        not raisesOverflowError(         -8589934592 << 31) or
        not raisesOverflowError(          -268435457 << 35) or
        not raisesOverflowError(          -268435456 << 36) or
        not raisesOverflowError(            -8388609 << 40) or
        not raisesOverflowError(            -8388608 << 41) or
        not raisesOverflowError(             -262145 << 45) or
        not raisesOverflowError(             -262144 << 46) or
        not raisesOverflowError(               -8193 << 50) or
        not raisesOverflowError(               -8192 << 51) or
        not raisesOverflowError(                -257 << 55) or
        not raisesOverflowError(                -256 << 56) or
        not raisesOverflowError(                  -9 << 60) or
        not raisesOverflowError(                  -8 << 61) or
        not raisesOverflowError(                  -5 << 61) or
        not raisesOverflowError(                  -4 << 62) or
        not raisesOverflowError(                  -3 << 62) or
        not raisesOverflowError(                  -2 << 63) or
        not raisesOverflowError(                  -1 << 64) or
        not raisesOverflowError(                   0 << 64) or
        not raisesOverflowError(                   1 << 63) or
        not raisesOverflowError(                   2 << 62) or
        not raisesOverflowError(                   3 << 62) or
        not raisesOverflowError(                   4 << 61) or
        not raisesOverflowError(                   7 << 61) or
        not raisesOverflowError(                   8 << 60) or
        not raisesOverflowError(                 255 << 56) or
        not raisesOverflowError(                 256 << 55) or
        not raisesOverflowError(                8191 << 51) or
        not raisesOverflowError(                8192 << 50) or
        not raisesOverflowError(              262143 << 46) or
        not raisesOverflowError(              262144 << 45) or
        not raisesOverflowError(             8388607 << 41) or
        not raisesOverflowError(             8388608 << 40) or
        not raisesOverflowError(           268435455 << 36) or
        not raisesOverflowError(           268435456 << 35) or
        not raisesOverflowError(          8589934591 << 31) or
        not raisesOverflowError(          8589934592 << 30) or
        not raisesOverflowError(        274877906943 << 26) or
        not raisesOverflowError(        274877906944 << 25) or
        not raisesOverflowError(       8796093022207 << 21) or
        not raisesOverflowError(       8796093022208 << 20) or
        not raisesOverflowError(     281474976710655 << 16) or
        not raisesOverflowError(     281474976710656 << 15) or
        not raisesOverflowError(    9007199254740991 << 11) or
        not raisesOverflowError(    9007199254740992 << 10) or
        not raisesOverflowError(  288230376151711743 <<  6) or
        not raisesOverflowError(  288230376151711744 <<  5) or
        not raisesOverflowError(  576460752303423487 <<  5) or
        not raisesOverflowError(  576460752303423488 <<  4) or
        not raisesOverflowError( 1152921504606846975 <<  4) or
        not raisesOverflowError( 1152921504606846976 <<  3) or
        not raisesOverflowError( 2305843009213693951 <<  3) or
        not raisesOverflowError( 2305843009213693952 <<  2) or
        not raisesOverflowError( 4611686018427387903 <<  2) or
        not raisesOverflowError( 4611686018427387904 <<  1) or
        not raisesOverflowError(intExpr(           INT64_MIN) <<  1) or
        not raisesOverflowError(intExpr(-4611686018427387905) <<  1) or
        not raisesOverflowError(intExpr(-4611686018427387904) <<  2) or
        not raisesOverflowError(intExpr(-2305843009213693953) <<  2) or
        not raisesOverflowError(intExpr(-2305843009213693952) <<  3) or
        not raisesOverflowError(intExpr(-1152921504606846977) <<  3) or
        not raisesOverflowError(intExpr( -576460752303423489) <<  4) or
        not raisesOverflowError(intExpr( -576460752303423488) <<  5) or
        not raisesOverflowError(intExpr( -288230376151711745) <<  5) or
        not raisesOverflowError(intExpr( -288230376151711744) <<  6) or
        not raisesOverflowError(intExpr(   -9007199254740993) << 10) or
        not raisesOverflowError(intExpr(   -9007199254740992) << 11) or
        not raisesOverflowError(intExpr(    -281474976710657) << 15) or
        not raisesOverflowError(intExpr(    -281474976710656) << 16) or
        not raisesOverflowError(intExpr(      -8796093022209) << 20) or
        not raisesOverflowError(intExpr(      -8796093022208) << 21) or
        not raisesOverflowError(intExpr(       -274877906945) << 25) or
        not raisesOverflowError(intExpr(       -274877906944) << 26) or
        not raisesOverflowError(intExpr(         -8589934593) << 30) or
        not raisesOverflowError(intExpr(         -8589934592) << 31) or
        not raisesOverflowError(intExpr(          -268435457) << 35) or
        not raisesOverflowError(intExpr(          -268435456) << 36) or
        not raisesOverflowError(intExpr(            -8388609) << 40) or
        not raisesOverflowError(intExpr(            -8388608) << 41) or
        not raisesOverflowError(intExpr(             -262145) << 45) or
        not raisesOverflowError(intExpr(             -262144) << 46) or
        not raisesOverflowError(intExpr(               -8193) << 50) or
        not raisesOverflowError(intExpr(               -8192) << 51) or
        not raisesOverflowError(intExpr(                -257) << 55) or
        not raisesOverflowError(intExpr(                -256) << 56) or
        not raisesOverflowError(intExpr(                  -9) << 60) or
        not raisesOverflowError(intExpr(                  -8) << 61) or
        not raisesOverflowError(intExpr(                  -5) << 61) or
        not raisesOverflowError(intExpr(                  -4) << 62) or
        not raisesOverflowError(intExpr(                  -3) << 62) or
        not raisesOverflowError(intExpr(                  -2) << 63) or
        not raisesOverflowError(intExpr(                  -1) << 64) or
        not raisesOverflowError(intExpr(                   0) << 64) or
        not raisesOverflowError(intExpr(                   1) << 63) or
        not raisesOverflowError(intExpr(                   2) << 62) or
        not raisesOverflowError(intExpr(                   3) << 62) or
        not raisesOverflowError(intExpr(                   4) << 61) or
        not raisesOverflowError(intExpr(                   7) << 61) or
        not raisesOverflowError(intExpr(                   8) << 60) or
        not raisesOverflowError(intExpr(                 255) << 56) or
        not raisesOverflowError(intExpr(                 256) << 55) or
        not raisesOverflowError(intExpr(                8191) << 51) or
        not raisesOverflowError(intExpr(                8192) << 50) or
        not raisesOverflowError(intExpr(              262143) << 46) or
        not raisesOverflowError(intExpr(              262144) << 45) or
        not raisesOverflowError(intExpr(             8388607) << 41) or
        not raisesOverflowError(intExpr(             8388608) << 40) or
        not raisesOverflowError(intExpr(           268435455) << 36) or
        not raisesOverflowError(intExpr(           268435456) << 35) or
        not raisesOverflowError(intExpr(          8589934591) << 31) or
        not raisesOverflowError(intExpr(          8589934592) << 30) or
        not raisesOverflowError(intExpr(        274877906943) << 26) or
        not raisesOverflowError(intExpr(        274877906944) << 25) or
        not raisesOverflowError(intExpr(       8796093022207) << 21) or
        not raisesOverflowError(intExpr(       8796093022208) << 20) or
        not raisesOverflowError(intExpr(     281474976710655) << 16) or
        not raisesOverflowError(intExpr(     281474976710656) << 15) or
        not raisesOverflowError(intExpr(    9007199254740991) << 11) or
        not raisesOverflowError(intExpr(    9007199254740992) << 10) or
        not raisesOverflowError(intExpr(  288230376151711743) <<  6) or
        not raisesOverflowError(intExpr(  288230376151711744) <<  5) or
        not raisesOverflowError(intExpr(  576460752303423487) <<  5) or
        not raisesOverflowError(intExpr(  576460752303423488) <<  4) or
        not raisesOverflowError(intExpr( 1152921504606846975) <<  4) or
        not raisesOverflowError(intExpr( 1152921504606846976) <<  3) or
        not raisesOverflowError(intExpr( 2305843009213693951) <<  3) or
        not raisesOverflowError(intExpr( 2305843009213693952) <<  2) or
        not raisesOverflowError(intExpr( 4611686018427387903) <<  2) or
        not raisesOverflowError(intExpr( 4611686018427387904) <<  1) or
        not raisesOverflowError(           INT64_MIN << intExpr( 1)) or
        not raisesOverflowError(-4611686018427387905 << intExpr( 1)) or
        not raisesOverflowError(-4611686018427387904 << intExpr( 2)) or
        not raisesOverflowError(-2305843009213693953 << intExpr( 2)) or
        not raisesOverflowError(-2305843009213693952 << intExpr( 3)) or
        not raisesOverflowError(-1152921504606846977 << intExpr( 3)) or
        not raisesOverflowError( -576460752303423489 << intExpr( 4)) or
        not raisesOverflowError( -576460752303423488 << intExpr( 5)) or
        not raisesOverflowError( -288230376151711745 << intExpr( 5)) or
        not raisesOverflowError( -288230376151711744 << intExpr( 6)) or
        not raisesOverflowError(   -9007199254740993 << intExpr(10)) or
        not raisesOverflowError(   -9007199254740992 << intExpr(11)) or
        not raisesOverflowError(    -281474976710657 << intExpr(15)) or
        not raisesOverflowError(    -281474976710656 << intExpr(16)) or
        not raisesOverflowError(      -8796093022209 << intExpr(20)) or
        not raisesOverflowError(      -8796093022208 << intExpr(21)) or
        not raisesOverflowError(       -274877906945 << intExpr(25)) or
        not raisesOverflowError(       -274877906944 << intExpr(26)) or
        not raisesOverflowError(         -8589934593 << intExpr(30)) or
        not raisesOverflowError(         -8589934592 << intExpr(31)) or
        not raisesOverflowError(          -268435457 << intExpr(35)) or
        not raisesOverflowError(          -268435456 << intExpr(36)) or
        not raisesOverflowError(            -8388609 << intExpr(40)) or
        not raisesOverflowError(            -8388608 << intExpr(41)) or
        not raisesOverflowError(             -262145 << intExpr(45)) or
        not raisesOverflowError(             -262144 << intExpr(46)) or
        not raisesOverflowError(               -8193 << intExpr(50)) or
        not raisesOverflowError(               -8192 << intExpr(51)) or
        not raisesOverflowError(                -257 << intExpr(55)) or
        not raisesOverflowError(                -256 << intExpr(56)) or
        not raisesOverflowError(                  -9 << intExpr(60)) or
        not raisesOverflowError(                  -8 << intExpr(61)) or
        not raisesOverflowError(                  -5 << intExpr(61)) or
        not raisesOverflowError(                  -4 << intExpr(62)) or
        not raisesOverflowError(                  -3 << intExpr(62)) or
        not raisesOverflowError(                  -2 << intExpr(63)) or
        not raisesOverflowError(                  -1 << intExpr(64)) or
        not raisesOverflowError(                   0 << intExpr(64)) or
        not raisesOverflowError(                   1 << intExpr(63)) or
        not raisesOverflowError(                   2 << intExpr(62)) or
        not raisesOverflowError(                   3 << intExpr(62)) or
        not raisesOverflowError(                   4 << intExpr(61)) or
        not raisesOverflowError(                   7 << intExpr(61)) or
        not raisesOverflowError(                   8 << intExpr(60)) or
        not raisesOverflowError(                 255 << intExpr(56)) or
        not raisesOverflowError(                 256 << intExpr(55)) or
        not raisesOverflowError(                8191 << intExpr(51)) or
        not raisesOverflowError(                8192 << intExpr(50)) or
        not raisesOverflowError(              262143 << intExpr(46)) or
        not raisesOverflowError(              262144 << intExpr(45)) or
        not raisesOverflowError(             8388607 << intExpr(41)) or
        not raisesOverflowError(             8388608 << intExpr(40)) or
        not raisesOverflowError(           268435455 << intExpr(36)) or
        not raisesOverflowError(           268435456 << intExpr(35)) or
        not raisesOverflowError(          8589934591 << intExpr(31)) or
        not raisesOverflowError(          8589934592 << intExpr(30)) or
        not raisesOverflowError(        274877906943 << intExpr(26)) or
        not raisesOverflowError(        274877906944 << intExpr(25)) or
        not raisesOverflowError(       8796093022207 << intExpr(21)) or
        not raisesOverflowError(       8796093022208 << intExpr(20)) or
        not raisesOverflowError(     281474976710655 << intExpr(16)) or
        not raisesOverflowError(     281474976710656 << intExpr(15)) or
        not raisesOverflowError(    9007199254740991 << intExpr(11)) or
        not raisesOverflowError(    9007199254740992 << intExpr(10)) or
        not raisesOverflowError(  288230376151711743 << intExpr( 6)) or
        not raisesOverflowError(  288230376151711744 << intExpr( 5)) or
        not raisesOverflowError(  576460752303423487 << intExpr( 5)) or
        not raisesOverflowError(  576460752303423488 << intExpr( 4)) or
        not raisesOverflowError( 1152921504606846975 << intExpr( 4)) or
        not raisesOverflowError( 1152921504606846976 << intExpr( 3)) or
        not raisesOverflowError( 2305843009213693951 << intExpr( 3)) or
        not raisesOverflowError( 2305843009213693952 << intExpr( 2)) or
        not raisesOverflowError( 4611686018427387903 << intExpr( 2)) or
        not raisesOverflowError( 4611686018427387904 << intExpr( 1)) or
        not raisesOverflowError(intExpr(           INT64_MIN) << intExpr( 1)) or
        not raisesOverflowError(intExpr(-4611686018427387905) << intExpr( 1)) or
        not raisesOverflowError(intExpr(-4611686018427387904) << intExpr( 2)) or
        not raisesOverflowError(intExpr(-2305843009213693953) << intExpr( 2)) or
        not raisesOverflowError(intExpr(-2305843009213693952) << intExpr( 3)) or
        not raisesOverflowError(intExpr(-1152921504606846977) << intExpr( 3)) or
        not raisesOverflowError(intExpr( -576460752303423489) << intExpr( 4)) or
        not raisesOverflowError(intExpr( -576460752303423488) << intExpr( 5)) or
        not raisesOverflowError(intExpr( -288230376151711745) << intExpr( 5)) or
        not raisesOverflowError(intExpr( -288230376151711744) << intExpr( 6)) or
        not raisesOverflowError(intExpr(   -9007199254740993) << intExpr(10)) or
        not raisesOverflowError(intExpr(   -9007199254740992) << intExpr(11)) or
        not raisesOverflowError(intExpr(    -281474976710657) << intExpr(15)) or
        not raisesOverflowError(intExpr(    -281474976710656) << intExpr(16)) or
        not raisesOverflowError(intExpr(      -8796093022209) << intExpr(20)) or
        not raisesOverflowError(intExpr(      -8796093022208) << intExpr(21)) or
        not raisesOverflowError(intExpr(       -274877906945) << intExpr(25)) or
        not raisesOverflowError(intExpr(       -274877906944) << intExpr(26)) or
        not raisesOverflowError(intExpr(         -8589934593) << intExpr(30)) or
        not raisesOverflowError(intExpr(         -8589934592) << intExpr(31)) or
        not raisesOverflowError(intExpr(          -268435457) << intExpr(35)) or
        not raisesOverflowError(intExpr(          -268435456) << intExpr(36)) or
        not raisesOverflowError(intExpr(            -8388609) << intExpr(40)) or
        not raisesOverflowError(intExpr(            -8388608) << intExpr(41)) or
        not raisesOverflowError(intExpr(             -262145) << intExpr(45)) or
        not raisesOverflowError(intExpr(             -262144) << intExpr(46)) or
        not raisesOverflowError(intExpr(               -8193) << intExpr(50)) or
        not raisesOverflowError(intExpr(               -8192) << intExpr(51)) or
        not raisesOverflowError(intExpr(                -257) << intExpr(55)) or
        not raisesOverflowError(intExpr(                -256) << intExpr(56)) or
        not raisesOverflowError(intExpr(                  -9) << intExpr(60)) or
        not raisesOverflowError(intExpr(                  -8) << intExpr(61)) or
        not raisesOverflowError(intExpr(                  -5) << intExpr(61)) or
        not raisesOverflowError(intExpr(                  -4) << intExpr(62)) or
        not raisesOverflowError(intExpr(                  -3) << intExpr(62)) or
        not raisesOverflowError(intExpr(                  -2) << intExpr(63)) or
        not raisesOverflowError(intExpr(                  -1) << intExpr(64)) or
        not raisesOverflowError(intExpr(                   0) << intExpr(64)) or
        not raisesOverflowError(intExpr(                   1) << intExpr(63)) or
        not raisesOverflowError(intExpr(                   2) << intExpr(62)) or
        not raisesOverflowError(intExpr(                   3) << intExpr(62)) or
        not raisesOverflowError(intExpr(                   4) << intExpr(61)) or
        not raisesOverflowError(intExpr(                   7) << intExpr(61)) or
        not raisesOverflowError(intExpr(                   8) << intExpr(60)) or
        not raisesOverflowError(intExpr(                 255) << intExpr(56)) or
        not raisesOverflowError(intExpr(                 256) << intExpr(55)) or
        not raisesOverflowError(intExpr(                8191) << intExpr(51)) or
        not raisesOverflowError(intExpr(                8192) << intExpr(50)) or
        not raisesOverflowError(intExpr(              262143) << intExpr(46)) or
        not raisesOverflowError(intExpr(              262144) << intExpr(45)) or
        not raisesOverflowError(intExpr(             8388607) << intExpr(41)) or
        not raisesOverflowError(intExpr(             8388608) << intExpr(40)) or
        not raisesOverflowError(intExpr(           268435455) << intExpr(36)) or
        not raisesOverflowError(intExpr(           268435456) << intExpr(35)) or
        not raisesOverflowError(intExpr(          8589934591) << intExpr(31)) or
        not raisesOverflowError(intExpr(          8589934592) << intExpr(30)) or
        not raisesOverflowError(intExpr(        274877906943) << intExpr(26)) or
        not raisesOverflowError(intExpr(        274877906944) << intExpr(25)) or
        not raisesOverflowError(intExpr(       8796093022207) << intExpr(21)) or
        not raisesOverflowError(intExpr(       8796093022208) << intExpr(20)) or
        not raisesOverflowError(intExpr(     281474976710655) << intExpr(16)) or
        not raisesOverflowError(intExpr(     281474976710656) << intExpr(15)) or
        not raisesOverflowError(intExpr(    9007199254740991) << intExpr(11)) or
        not raisesOverflowError(intExpr(    9007199254740992) << intExpr(10)) or
        not raisesOverflowError(intExpr(  288230376151711743) << intExpr( 6)) or
        not raisesOverflowError(intExpr(  288230376151711744) << intExpr( 5)) or
        not raisesOverflowError(intExpr(  576460752303423487) << intExpr( 5)) or
        not raisesOverflowError(intExpr(  576460752303423488) << intExpr( 4)) or
        not raisesOverflowError(intExpr( 1152921504606846975) << intExpr( 4)) or
        not raisesOverflowError(intExpr( 1152921504606846976) << intExpr( 3)) or
        not raisesOverflowError(intExpr( 2305843009213693951) << intExpr( 3)) or
        not raisesOverflowError(intExpr( 2305843009213693952) << intExpr( 2)) or
        not raisesOverflowError(intExpr( 4611686018427387903) << intExpr( 2)) or
        not raisesOverflowError(intExpr( 4611686018427387904) << intExpr( 1)) then
      writeln(" ***** Overflow when computing left shift does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(-16111 << integer.first) or
        not raisesOverflowError(-16111 <<          -999) or
        not raisesOverflowError(-16111 <<           -63) or
        not raisesOverflowError(-16111 <<            -1) or
        not raisesOverflowError(-16111 <<            64) or
        not raisesOverflowError(-16111 <<           999) or
        not raisesOverflowError(-16111 <<  integer.last) or
        not raisesOverflowError(    -1 << integer.first) or
        not raisesOverflowError(    -1 <<          -999) or
        not raisesOverflowError(    -1 <<           -63) or
        not raisesOverflowError(    -1 <<            -1) or
        not raisesOverflowError(    -1 <<            64) or
        not raisesOverflowError(    -1 <<           999) or
        not raisesOverflowError(    -1 <<  integer.last) or
        not raisesOverflowError(     0 << integer.first) or
        not raisesOverflowError(     0 <<          -999) or
        not raisesOverflowError(     0 <<           -63) or
        not raisesOverflowError(     0 <<            -1) or
        not raisesOverflowError(     0 <<            64) or
        not raisesOverflowError(     0 <<           999) or
        not raisesOverflowError(     0 <<  integer.last) or
        not raisesOverflowError( 16111 << integer.first) or
        not raisesOverflowError( 16111 <<          -999) or
        not raisesOverflowError( 16111 <<           -63) or
        not raisesOverflowError( 16111 <<            -1) or
        not raisesOverflowError( 16111 <<            64) or
        not raisesOverflowError( 16111 <<           999) or
        not raisesOverflowError( 16111 <<  integer.last) or
        not raisesOverflowError(intExpr(-16111) << integer.first) or
        not raisesOverflowError(intExpr(-16111) <<          -999) or
        not raisesOverflowError(intExpr(-16111) <<           -63) or
        not raisesOverflowError(intExpr(-16111) <<            -1) or
        not raisesOverflowError(intExpr(-16111) <<            64) or
        not raisesOverflowError(intExpr(-16111) <<           999) or
        not raisesOverflowError(intExpr(-16111) <<  integer.last) or
        not raisesOverflowError(intExpr(    -1) << integer.first) or
        not raisesOverflowError(intExpr(    -1) <<          -999) or
        not raisesOverflowError(intExpr(    -1) <<           -63) or
        not raisesOverflowError(intExpr(    -1) <<            -1) or
        not raisesOverflowError(intExpr(    -1) <<            64) or
        not raisesOverflowError(intExpr(    -1) <<           999) or
        not raisesOverflowError(intExpr(    -1) <<  integer.last) or
        not raisesOverflowError(intExpr(     0) << integer.first) or
        not raisesOverflowError(intExpr(     0) <<          -999) or
        not raisesOverflowError(intExpr(     0) <<           -63) or
        not raisesOverflowError(intExpr(     0) <<            -1) or
        not raisesOverflowError(intExpr(     0) <<            64) or
        not raisesOverflowError(intExpr(     0) <<           999) or
        not raisesOverflowError(intExpr(     0) <<  integer.last) or
        not raisesOverflowError(intExpr( 16111) << integer.first) or
        not raisesOverflowError(intExpr( 16111) <<          -999) or
        not raisesOverflowError(intExpr( 16111) <<           -63) or
        not raisesOverflowError(intExpr( 16111) <<            -1) or
        not raisesOverflowError(intExpr( 16111) <<            64) or
        not raisesOverflowError(intExpr( 16111) <<           999) or
        not raisesOverflowError(intExpr( 16111) <<  integer.last) or
        not raisesOverflowError(-16111 << intExpr(integer.first)) or
        not raisesOverflowError(-16111 << intExpr(         -999)) or
        not raisesOverflowError(-16111 << intExpr(          -63)) or
        not raisesOverflowError(-16111 << intExpr(           -1)) or
        not raisesOverflowError(-16111 << intExpr(           64)) or
        not raisesOverflowError(-16111 << intExpr(          999)) or
        not raisesOverflowError(-16111 << intExpr( integer.last)) or
        not raisesOverflowError(    -1 << intExpr(integer.first)) or
        not raisesOverflowError(    -1 << intExpr(         -999)) or
        not raisesOverflowError(    -1 << intExpr(          -63)) or
        not raisesOverflowError(    -1 << intExpr(           -1)) or
        not raisesOverflowError(    -1 << intExpr(           64)) or
        not raisesOverflowError(    -1 << intExpr(          999)) or
        not raisesOverflowError(    -1 << intExpr( integer.last)) or
        not raisesOverflowError(     0 << intExpr(integer.first)) or
        not raisesOverflowError(     0 << intExpr(         -999)) or
        not raisesOverflowError(     0 << intExpr(          -63)) or
        not raisesOverflowError(     0 << intExpr(           -1)) or
        not raisesOverflowError(     0 << intExpr(           64)) or
        not raisesOverflowError(     0 << intExpr(          999)) or
        not raisesOverflowError(     0 << intExpr( integer.last)) or
        not raisesOverflowError( 16111 << intExpr(integer.first)) or
        not raisesOverflowError( 16111 << intExpr(         -999)) or
        not raisesOverflowError( 16111 << intExpr(          -63)) or
        not raisesOverflowError( 16111 << intExpr(           -1)) or
        not raisesOverflowError( 16111 << intExpr(           64)) or
        not raisesOverflowError( 16111 << intExpr(          999)) or
        not raisesOverflowError( 16111 << intExpr( integer.last)) or
        not raisesOverflowError(intExpr(-16111) << intExpr(integer.first)) or
        not raisesOverflowError(intExpr(-16111) << intExpr(         -999)) or
        not raisesOverflowError(intExpr(-16111) << intExpr(          -63)) or
        not raisesOverflowError(intExpr(-16111) << intExpr(           -1)) or
        not raisesOverflowError(intExpr(-16111) << intExpr(           64)) or
        not raisesOverflowError(intExpr(-16111) << intExpr(          999)) or
        not raisesOverflowError(intExpr(-16111) << intExpr( integer.last)) or
        not raisesOverflowError(intExpr(    -1) << intExpr(integer.first)) or
        not raisesOverflowError(intExpr(    -1) << intExpr(         -999)) or
        not raisesOverflowError(intExpr(    -1) << intExpr(          -63)) or
        not raisesOverflowError(intExpr(    -1) << intExpr(           -1)) or
        not raisesOverflowError(intExpr(    -1) << intExpr(           64)) or
        not raisesOverflowError(intExpr(    -1) << intExpr(          999)) or
        not raisesOverflowError(intExpr(    -1) << intExpr( integer.last)) or
        not raisesOverflowError(intExpr(     0) << intExpr(integer.first)) or
        not raisesOverflowError(intExpr(     0) << intExpr(         -999)) or
        not raisesOverflowError(intExpr(     0) << intExpr(          -63)) or
        not raisesOverflowError(intExpr(     0) << intExpr(           -1)) or
        not raisesOverflowError(intExpr(     0) << intExpr(           64)) or
        not raisesOverflowError(intExpr(     0) << intExpr(          999)) or
        not raisesOverflowError(intExpr(     0) << intExpr( integer.last)) or
        not raisesOverflowError(intExpr( 16111) << intExpr(integer.first)) or
        not raisesOverflowError(intExpr( 16111) << intExpr(         -999)) or
        not raisesOverflowError(intExpr( 16111) << intExpr(          -63)) or
        not raisesOverflowError(intExpr( 16111) << intExpr(           -1)) or
        not raisesOverflowError(intExpr( 16111) << intExpr(           64)) or
        not raisesOverflowError(intExpr( 16111) << intExpr(          999)) or
        not raisesOverflowError(intExpr( 16111) << intExpr( integer.last)) then
      writeln(" ***** Left shift with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if not check_reduced_overflow_checking_for_lshift then
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of left shift works correct.");
    else
      writeln(" ***** Overflow checking of left shift does not work correct.");
    end if;
  end func;


const proc: check_lShift_assign is func
  local
    var boolean: okay is TRUE;
    var boolean: ok is TRUE;
    var integer: num is 0;
    var array integer: arr is [] (0);
  begin
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num <<:=  1);
    num := -4611686018427387905; ok := ok and raisesOverflowError(num <<:=  1);
    num := -4611686018427387904; ok := ok and raisesOverflowError(num <<:=  2);
    num := -2305843009213693953; ok := ok and raisesOverflowError(num <<:=  2);
    num := -2305843009213693952; ok := ok and raisesOverflowError(num <<:=  3);
    num := -1152921504606846977; ok := ok and raisesOverflowError(num <<:=  3);
    num :=  -576460752303423489; ok := ok and raisesOverflowError(num <<:=  4);
    num :=  -576460752303423488; ok := ok and raisesOverflowError(num <<:=  5);
    num :=  -288230376151711745; ok := ok and raisesOverflowError(num <<:=  5);
    num :=  -288230376151711744; ok := ok and raisesOverflowError(num <<:=  6);
    num :=    -9007199254740993; ok := ok and raisesOverflowError(num <<:= 10);
    num :=    -9007199254740992; ok := ok and raisesOverflowError(num <<:= 11);
    num :=     -281474976710657; ok := ok and raisesOverflowError(num <<:= 15);
    num :=     -281474976710656; ok := ok and raisesOverflowError(num <<:= 16);
    num :=       -8796093022209; ok := ok and raisesOverflowError(num <<:= 20);
    num :=       -8796093022208; ok := ok and raisesOverflowError(num <<:= 21);
    num :=        -274877906945; ok := ok and raisesOverflowError(num <<:= 25);
    num :=        -274877906944; ok := ok and raisesOverflowError(num <<:= 26);
    num :=          -8589934593; ok := ok and raisesOverflowError(num <<:= 30);
    num :=          -8589934592; ok := ok and raisesOverflowError(num <<:= 31);
    num :=           -268435457; ok := ok and raisesOverflowError(num <<:= 35);
    num :=           -268435456; ok := ok and raisesOverflowError(num <<:= 36);
    num :=             -8388609; ok := ok and raisesOverflowError(num <<:= 40);
    num :=             -8388608; ok := ok and raisesOverflowError(num <<:= 41);
    num :=              -262145; ok := ok and raisesOverflowError(num <<:= 45);
    num :=              -262144; ok := ok and raisesOverflowError(num <<:= 46);
    num :=                -8193; ok := ok and raisesOverflowError(num <<:= 50);
    num :=                -8192; ok := ok and raisesOverflowError(num <<:= 51);
    num :=                 -257; ok := ok and raisesOverflowError(num <<:= 55);
    num :=                 -256; ok := ok and raisesOverflowError(num <<:= 56);
    num :=                   -9; ok := ok and raisesOverflowError(num <<:= 60);
    num :=                   -8; ok := ok and raisesOverflowError(num <<:= 61);
    num :=                   -5; ok := ok and raisesOverflowError(num <<:= 61);
    num :=                   -4; ok := ok and raisesOverflowError(num <<:= 62);
    num :=                   -3; ok := ok and raisesOverflowError(num <<:= 62);
    num :=                   -2; ok := ok and raisesOverflowError(num <<:= 63);
    num :=                   -1; ok := ok and raisesOverflowError(num <<:= 64);
    num :=                    0; ok := ok and raisesOverflowError(num <<:= 64);
    num :=                    1; ok := ok and raisesOverflowError(num <<:= 63);
    num :=                    2; ok := ok and raisesOverflowError(num <<:= 62);
    num :=                    3; ok := ok and raisesOverflowError(num <<:= 62);
    num :=                    4; ok := ok and raisesOverflowError(num <<:= 61);
    num :=                    7; ok := ok and raisesOverflowError(num <<:= 61);
    num :=                    8; ok := ok and raisesOverflowError(num <<:= 60);
    num :=                  255; ok := ok and raisesOverflowError(num <<:= 56);
    num :=                  256; ok := ok and raisesOverflowError(num <<:= 55);
    num :=                 8191; ok := ok and raisesOverflowError(num <<:= 51);
    num :=                 8192; ok := ok and raisesOverflowError(num <<:= 50);
    num :=               262143; ok := ok and raisesOverflowError(num <<:= 46);
    num :=               262144; ok := ok and raisesOverflowError(num <<:= 45);
    num :=              8388607; ok := ok and raisesOverflowError(num <<:= 41);
    num :=              8388608; ok := ok and raisesOverflowError(num <<:= 40);
    num :=            268435455; ok := ok and raisesOverflowError(num <<:= 36);
    num :=            268435456; ok := ok and raisesOverflowError(num <<:= 35);
    num :=           8589934591; ok := ok and raisesOverflowError(num <<:= 31);
    num :=           8589934592; ok := ok and raisesOverflowError(num <<:= 30);
    num :=         274877906943; ok := ok and raisesOverflowError(num <<:= 26);
    num :=         274877906944; ok := ok and raisesOverflowError(num <<:= 25);
    num :=        8796093022207; ok := ok and raisesOverflowError(num <<:= 21);
    num :=        8796093022208; ok := ok and raisesOverflowError(num <<:= 20);
    num :=      281474976710655; ok := ok and raisesOverflowError(num <<:= 16);
    num :=      281474976710656; ok := ok and raisesOverflowError(num <<:= 15);
    num :=     9007199254740991; ok := ok and raisesOverflowError(num <<:= 11);
    num :=     9007199254740992; ok := ok and raisesOverflowError(num <<:= 10);
    num :=   288230376151711743; ok := ok and raisesOverflowError(num <<:=  6);
    num :=   288230376151711744; ok := ok and raisesOverflowError(num <<:=  5);
    num :=   576460752303423487; ok := ok and raisesOverflowError(num <<:=  5);
    num :=   576460752303423488; ok := ok and raisesOverflowError(num <<:=  4);
    num :=  1152921504606846975; ok := ok and raisesOverflowError(num <<:=  4);
    num :=  1152921504606846976; ok := ok and raisesOverflowError(num <<:=  3);
    num :=  2305843009213693951; ok := ok and raisesOverflowError(num <<:=  3);
    num :=  2305843009213693952; ok := ok and raisesOverflowError(num <<:=  2);
    num :=  4611686018427387903; ok := ok and raisesOverflowError(num <<:=  2);
    num :=  4611686018427387904; ok := ok and raisesOverflowError(num <<:=  1);
    num :=            INT64_MIN; ok := ok and raisesOverflowError(num <<:= intExpr( 1));
    num := -4611686018427387905; ok := ok and raisesOverflowError(num <<:= intExpr( 1));
    num := -4611686018427387904; ok := ok and raisesOverflowError(num <<:= intExpr( 2));
    num := -2305843009213693953; ok := ok and raisesOverflowError(num <<:= intExpr( 2));
    num := -2305843009213693952; ok := ok and raisesOverflowError(num <<:= intExpr( 3));
    num := -1152921504606846977; ok := ok and raisesOverflowError(num <<:= intExpr( 3));
    num :=  -576460752303423489; ok := ok and raisesOverflowError(num <<:= intExpr( 4));
    num :=  -576460752303423488; ok := ok and raisesOverflowError(num <<:= intExpr( 5));
    num :=  -288230376151711745; ok := ok and raisesOverflowError(num <<:= intExpr( 5));
    num :=  -288230376151711744; ok := ok and raisesOverflowError(num <<:= intExpr( 6));
    num :=    -9007199254740993; ok := ok and raisesOverflowError(num <<:= intExpr(10));
    num :=    -9007199254740992; ok := ok and raisesOverflowError(num <<:= intExpr(11));
    num :=     -281474976710657; ok := ok and raisesOverflowError(num <<:= intExpr(15));
    num :=     -281474976710656; ok := ok and raisesOverflowError(num <<:= intExpr(16));
    num :=       -8796093022209; ok := ok and raisesOverflowError(num <<:= intExpr(20));
    num :=       -8796093022208; ok := ok and raisesOverflowError(num <<:= intExpr(21));
    num :=        -274877906945; ok := ok and raisesOverflowError(num <<:= intExpr(25));
    num :=        -274877906944; ok := ok and raisesOverflowError(num <<:= intExpr(26));
    num :=          -8589934593; ok := ok and raisesOverflowError(num <<:= intExpr(30));
    num :=          -8589934592; ok := ok and raisesOverflowError(num <<:= intExpr(31));
    num :=           -268435457; ok := ok and raisesOverflowError(num <<:= intExpr(35));
    num :=           -268435456; ok := ok and raisesOverflowError(num <<:= intExpr(36));
    num :=             -8388609; ok := ok and raisesOverflowError(num <<:= intExpr(40));
    num :=             -8388608; ok := ok and raisesOverflowError(num <<:= intExpr(41));
    num :=              -262145; ok := ok and raisesOverflowError(num <<:= intExpr(45));
    num :=              -262144; ok := ok and raisesOverflowError(num <<:= intExpr(46));
    num :=                -8193; ok := ok and raisesOverflowError(num <<:= intExpr(50));
    num :=                -8192; ok := ok and raisesOverflowError(num <<:= intExpr(51));
    num :=                 -257; ok := ok and raisesOverflowError(num <<:= intExpr(55));
    num :=                 -256; ok := ok and raisesOverflowError(num <<:= intExpr(56));
    num :=                   -9; ok := ok and raisesOverflowError(num <<:= intExpr(60));
    num :=                   -8; ok := ok and raisesOverflowError(num <<:= intExpr(61));
    num :=                   -5; ok := ok and raisesOverflowError(num <<:= intExpr(61));
    num :=                   -4; ok := ok and raisesOverflowError(num <<:= intExpr(62));
    num :=                   -3; ok := ok and raisesOverflowError(num <<:= intExpr(62));
    num :=                   -2; ok := ok and raisesOverflowError(num <<:= intExpr(63));
    num :=                   -1; ok := ok and raisesOverflowError(num <<:= intExpr(64));
    num :=                    0; ok := ok and raisesOverflowError(num <<:= intExpr(64));
    num :=                    1; ok := ok and raisesOverflowError(num <<:= intExpr(63));
    num :=                    2; ok := ok and raisesOverflowError(num <<:= intExpr(62));
    num :=                    3; ok := ok and raisesOverflowError(num <<:= intExpr(62));
    num :=                    4; ok := ok and raisesOverflowError(num <<:= intExpr(61));
    num :=                    7; ok := ok and raisesOverflowError(num <<:= intExpr(61));
    num :=                    8; ok := ok and raisesOverflowError(num <<:= intExpr(60));
    num :=                  255; ok := ok and raisesOverflowError(num <<:= intExpr(56));
    num :=                  256; ok := ok and raisesOverflowError(num <<:= intExpr(55));
    num :=                 8191; ok := ok and raisesOverflowError(num <<:= intExpr(51));
    num :=                 8192; ok := ok and raisesOverflowError(num <<:= intExpr(50));
    num :=               262143; ok := ok and raisesOverflowError(num <<:= intExpr(46));
    num :=               262144; ok := ok and raisesOverflowError(num <<:= intExpr(45));
    num :=              8388607; ok := ok and raisesOverflowError(num <<:= intExpr(41));
    num :=              8388608; ok := ok and raisesOverflowError(num <<:= intExpr(40));
    num :=            268435455; ok := ok and raisesOverflowError(num <<:= intExpr(36));
    num :=            268435456; ok := ok and raisesOverflowError(num <<:= intExpr(35));
    num :=           8589934591; ok := ok and raisesOverflowError(num <<:= intExpr(31));
    num :=           8589934592; ok := ok and raisesOverflowError(num <<:= intExpr(30));
    num :=         274877906943; ok := ok and raisesOverflowError(num <<:= intExpr(26));
    num :=         274877906944; ok := ok and raisesOverflowError(num <<:= intExpr(25));
    num :=        8796093022207; ok := ok and raisesOverflowError(num <<:= intExpr(21));
    num :=        8796093022208; ok := ok and raisesOverflowError(num <<:= intExpr(20));
    num :=      281474976710655; ok := ok and raisesOverflowError(num <<:= intExpr(16));
    num :=      281474976710656; ok := ok and raisesOverflowError(num <<:= intExpr(15));
    num :=     9007199254740991; ok := ok and raisesOverflowError(num <<:= intExpr(11));
    num :=     9007199254740992; ok := ok and raisesOverflowError(num <<:= intExpr(10));
    num :=   288230376151711743; ok := ok and raisesOverflowError(num <<:= intExpr( 6));
    num :=   288230376151711744; ok := ok and raisesOverflowError(num <<:= intExpr( 5));
    num :=   576460752303423487; ok := ok and raisesOverflowError(num <<:= intExpr( 5));
    num :=   576460752303423488; ok := ok and raisesOverflowError(num <<:= intExpr( 4));
    num :=  1152921504606846975; ok := ok and raisesOverflowError(num <<:= intExpr( 4));
    num :=  1152921504606846976; ok := ok and raisesOverflowError(num <<:= intExpr( 3));
    num :=  2305843009213693951; ok := ok and raisesOverflowError(num <<:= intExpr( 3));
    num :=  2305843009213693952; ok := ok and raisesOverflowError(num <<:= intExpr( 2));
    num :=  4611686018427387903; ok := ok and raisesOverflowError(num <<:= intExpr( 2));
    num :=  4611686018427387904; ok := ok and raisesOverflowError(num <<:= intExpr( 1));
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] <<:=  1);
    arr[1] := -4611686018427387905; ok := ok and raisesOverflowError(arr[1] <<:=  1);
    arr[1] := -4611686018427387904; ok := ok and raisesOverflowError(arr[1] <<:=  2);
    arr[1] := -2305843009213693953; ok := ok and raisesOverflowError(arr[1] <<:=  2);
    arr[1] := -2305843009213693952; ok := ok and raisesOverflowError(arr[1] <<:=  3);
    arr[1] := -1152921504606846977; ok := ok and raisesOverflowError(arr[1] <<:=  3);
    arr[1] :=  -576460752303423489; ok := ok and raisesOverflowError(arr[1] <<:=  4);
    arr[1] :=  -576460752303423488; ok := ok and raisesOverflowError(arr[1] <<:=  5);
    arr[1] :=  -288230376151711745; ok := ok and raisesOverflowError(arr[1] <<:=  5);
    arr[1] :=  -288230376151711744; ok := ok and raisesOverflowError(arr[1] <<:=  6);
    arr[1] :=    -9007199254740993; ok := ok and raisesOverflowError(arr[1] <<:= 10);
    arr[1] :=    -9007199254740992; ok := ok and raisesOverflowError(arr[1] <<:= 11);
    arr[1] :=     -281474976710657; ok := ok and raisesOverflowError(arr[1] <<:= 15);
    arr[1] :=     -281474976710656; ok := ok and raisesOverflowError(arr[1] <<:= 16);
    arr[1] :=       -8796093022209; ok := ok and raisesOverflowError(arr[1] <<:= 20);
    arr[1] :=       -8796093022208; ok := ok and raisesOverflowError(arr[1] <<:= 21);
    arr[1] :=        -274877906945; ok := ok and raisesOverflowError(arr[1] <<:= 25);
    arr[1] :=        -274877906944; ok := ok and raisesOverflowError(arr[1] <<:= 26);
    arr[1] :=          -8589934593; ok := ok and raisesOverflowError(arr[1] <<:= 30);
    arr[1] :=          -8589934592; ok := ok and raisesOverflowError(arr[1] <<:= 31);
    arr[1] :=           -268435457; ok := ok and raisesOverflowError(arr[1] <<:= 35);
    arr[1] :=           -268435456; ok := ok and raisesOverflowError(arr[1] <<:= 36);
    arr[1] :=             -8388609; ok := ok and raisesOverflowError(arr[1] <<:= 40);
    arr[1] :=             -8388608; ok := ok and raisesOverflowError(arr[1] <<:= 41);
    arr[1] :=              -262145; ok := ok and raisesOverflowError(arr[1] <<:= 45);
    arr[1] :=              -262144; ok := ok and raisesOverflowError(arr[1] <<:= 46);
    arr[1] :=                -8193; ok := ok and raisesOverflowError(arr[1] <<:= 50);
    arr[1] :=                -8192; ok := ok and raisesOverflowError(arr[1] <<:= 51);
    arr[1] :=                 -257; ok := ok and raisesOverflowError(arr[1] <<:= 55);
    arr[1] :=                 -256; ok := ok and raisesOverflowError(arr[1] <<:= 56);
    arr[1] :=                   -9; ok := ok and raisesOverflowError(arr[1] <<:= 60);
    arr[1] :=                   -8; ok := ok and raisesOverflowError(arr[1] <<:= 61);
    arr[1] :=                   -5; ok := ok and raisesOverflowError(arr[1] <<:= 61);
    arr[1] :=                   -4; ok := ok and raisesOverflowError(arr[1] <<:= 62);
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] <<:= 62);
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] <<:= 63);
    arr[1] :=                   -1; ok := ok and raisesOverflowError(arr[1] <<:= 64);
    arr[1] :=                    0; ok := ok and raisesOverflowError(arr[1] <<:= 64);
    arr[1] :=                    1; ok := ok and raisesOverflowError(arr[1] <<:= 63);
    arr[1] :=                    2; ok := ok and raisesOverflowError(arr[1] <<:= 62);
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] <<:= 62);
    arr[1] :=                    4; ok := ok and raisesOverflowError(arr[1] <<:= 61);
    arr[1] :=                    7; ok := ok and raisesOverflowError(arr[1] <<:= 61);
    arr[1] :=                    8; ok := ok and raisesOverflowError(arr[1] <<:= 60);
    arr[1] :=                  255; ok := ok and raisesOverflowError(arr[1] <<:= 56);
    arr[1] :=                  256; ok := ok and raisesOverflowError(arr[1] <<:= 55);
    arr[1] :=                 8191; ok := ok and raisesOverflowError(arr[1] <<:= 51);
    arr[1] :=                 8192; ok := ok and raisesOverflowError(arr[1] <<:= 50);
    arr[1] :=               262143; ok := ok and raisesOverflowError(arr[1] <<:= 46);
    arr[1] :=               262144; ok := ok and raisesOverflowError(arr[1] <<:= 45);
    arr[1] :=              8388607; ok := ok and raisesOverflowError(arr[1] <<:= 41);
    arr[1] :=              8388608; ok := ok and raisesOverflowError(arr[1] <<:= 40);
    arr[1] :=            268435455; ok := ok and raisesOverflowError(arr[1] <<:= 36);
    arr[1] :=            268435456; ok := ok and raisesOverflowError(arr[1] <<:= 35);
    arr[1] :=           8589934591; ok := ok and raisesOverflowError(arr[1] <<:= 31);
    arr[1] :=           8589934592; ok := ok and raisesOverflowError(arr[1] <<:= 30);
    arr[1] :=         274877906943; ok := ok and raisesOverflowError(arr[1] <<:= 26);
    arr[1] :=         274877906944; ok := ok and raisesOverflowError(arr[1] <<:= 25);
    arr[1] :=        8796093022207; ok := ok and raisesOverflowError(arr[1] <<:= 21);
    arr[1] :=        8796093022208; ok := ok and raisesOverflowError(arr[1] <<:= 20);
    arr[1] :=      281474976710655; ok := ok and raisesOverflowError(arr[1] <<:= 16);
    arr[1] :=      281474976710656; ok := ok and raisesOverflowError(arr[1] <<:= 15);
    arr[1] :=     9007199254740991; ok := ok and raisesOverflowError(arr[1] <<:= 11);
    arr[1] :=     9007199254740992; ok := ok and raisesOverflowError(arr[1] <<:= 10);
    arr[1] :=   288230376151711743; ok := ok and raisesOverflowError(arr[1] <<:=  6);
    arr[1] :=   288230376151711744; ok := ok and raisesOverflowError(arr[1] <<:=  5);
    arr[1] :=   576460752303423487; ok := ok and raisesOverflowError(arr[1] <<:=  5);
    arr[1] :=   576460752303423488; ok := ok and raisesOverflowError(arr[1] <<:=  4);
    arr[1] :=  1152921504606846975; ok := ok and raisesOverflowError(arr[1] <<:=  4);
    arr[1] :=  1152921504606846976; ok := ok and raisesOverflowError(arr[1] <<:=  3);
    arr[1] :=  2305843009213693951; ok := ok and raisesOverflowError(arr[1] <<:=  3);
    arr[1] :=  2305843009213693952; ok := ok and raisesOverflowError(arr[1] <<:=  2);
    arr[1] :=  4611686018427387903; ok := ok and raisesOverflowError(arr[1] <<:=  2);
    arr[1] :=  4611686018427387904; ok := ok and raisesOverflowError(arr[1] <<:=  1);
    arr[1] :=            INT64_MIN; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 1));
    arr[1] := -4611686018427387905; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 1));
    arr[1] := -4611686018427387904; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 2));
    arr[1] := -2305843009213693953; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 2));
    arr[1] := -2305843009213693952; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 3));
    arr[1] := -1152921504606846977; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 3));
    arr[1] :=  -576460752303423489; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 4));
    arr[1] :=  -576460752303423488; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 5));
    arr[1] :=  -288230376151711745; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 5));
    arr[1] :=  -288230376151711744; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 6));
    arr[1] :=    -9007199254740993; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(10));
    arr[1] :=    -9007199254740992; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(11));
    arr[1] :=     -281474976710657; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(15));
    arr[1] :=     -281474976710656; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(16));
    arr[1] :=       -8796093022209; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(20));
    arr[1] :=       -8796093022208; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(21));
    arr[1] :=        -274877906945; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(25));
    arr[1] :=        -274877906944; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(26));
    arr[1] :=          -8589934593; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(30));
    arr[1] :=          -8589934592; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(31));
    arr[1] :=           -268435457; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(35));
    arr[1] :=           -268435456; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(36));
    arr[1] :=             -8388609; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(40));
    arr[1] :=             -8388608; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(41));
    arr[1] :=              -262145; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(45));
    arr[1] :=              -262144; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(46));
    arr[1] :=                -8193; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(50));
    arr[1] :=                -8192; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(51));
    arr[1] :=                 -257; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(55));
    arr[1] :=                 -256; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(56));
    arr[1] :=                   -9; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(60));
    arr[1] :=                   -8; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(61));
    arr[1] :=                   -5; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(61));
    arr[1] :=                   -4; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(62));
    arr[1] :=                   -3; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(62));
    arr[1] :=                   -2; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(63));
    arr[1] :=                   -1; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(64));
    arr[1] :=                    0; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(64));
    arr[1] :=                    1; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(63));
    arr[1] :=                    2; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(62));
    arr[1] :=                    3; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(62));
    arr[1] :=                    4; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(61));
    arr[1] :=                    7; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(61));
    arr[1] :=                    8; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(60));
    arr[1] :=                  255; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(56));
    arr[1] :=                  256; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(55));
    arr[1] :=                 8191; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(51));
    arr[1] :=                 8192; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(50));
    arr[1] :=               262143; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(46));
    arr[1] :=               262144; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(45));
    arr[1] :=              8388607; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(41));
    arr[1] :=              8388608; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(40));
    arr[1] :=            268435455; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(36));
    arr[1] :=            268435456; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(35));
    arr[1] :=           8589934591; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(31));
    arr[1] :=           8589934592; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(30));
    arr[1] :=         274877906943; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(26));
    arr[1] :=         274877906944; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(25));
    arr[1] :=        8796093022207; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(21));
    arr[1] :=        8796093022208; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(20));
    arr[1] :=      281474976710655; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(16));
    arr[1] :=      281474976710656; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(15));
    arr[1] :=     9007199254740991; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(11));
    arr[1] :=     9007199254740992; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(10));
    arr[1] :=   288230376151711743; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 6));
    arr[1] :=   288230376151711744; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 5));
    arr[1] :=   576460752303423487; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 5));
    arr[1] :=   576460752303423488; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 4));
    arr[1] :=  1152921504606846975; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 4));
    arr[1] :=  1152921504606846976; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 3));
    arr[1] :=  2305843009213693951; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 3));
    arr[1] :=  2305843009213693952; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 2));
    arr[1] :=  4611686018427387903; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 2));
    arr[1] :=  4611686018427387904; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 1));
    if not ok then
      writeln(" ***** Left shift assignment does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    ok := TRUE;
    num := -16111; ok := ok and raisesOverflowError(num <<:= -999);
    num := -16111; ok := ok and raisesOverflowError(num <<:=  -63);
    num := -16111; ok := ok and raisesOverflowError(num <<:=   -1);
    num := -16111; ok := ok and raisesOverflowError(num <<:=   64);
    num := -16111; ok := ok and raisesOverflowError(num <<:=  999);
    num :=     -1; ok := ok and raisesOverflowError(num <<:= -999);
    num :=     -1; ok := ok and raisesOverflowError(num <<:=  -63);
    num :=     -1; ok := ok and raisesOverflowError(num <<:=   -1);
    num :=     -1; ok := ok and raisesOverflowError(num <<:=   64);
    num :=     -1; ok := ok and raisesOverflowError(num <<:=  999);
    num :=      0; ok := ok and raisesOverflowError(num <<:= -999);
    num :=      0; ok := ok and raisesOverflowError(num <<:=  -63);
    num :=      0; ok := ok and raisesOverflowError(num <<:=   -1);
    num :=      0; ok := ok and raisesOverflowError(num <<:=   64);
    num :=      0; ok := ok and raisesOverflowError(num <<:=  999);
    num :=  16111; ok := ok and raisesOverflowError(num <<:= -999);
    num :=  16111; ok := ok and raisesOverflowError(num <<:=  -63);
    num :=  16111; ok := ok and raisesOverflowError(num <<:=   -1);
    num :=  16111; ok := ok and raisesOverflowError(num <<:=   64);
    num :=  16111; ok := ok and raisesOverflowError(num <<:=  999);
    num := -16111; ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num := -16111; ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num := -16111; ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num := -16111; ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num := -16111; ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    num :=     -1; ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num :=     -1; ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num :=     -1; ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num :=     -1; ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num :=     -1; ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    num :=      0; ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num :=      0; ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num :=      0; ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num :=      0; ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num :=      0; ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    num :=  16111; ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num :=  16111; ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num :=  16111; ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num :=  16111; ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num :=  16111; ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    if not ok then
      writeln(" ***** Left shift assignment with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of left shift assignment works correct.");
    else
      writeln(" ***** Overflow checking of left shift assignment does not work correct.");
    end if;
  end func;


const proc: check_rShift is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(-16111 >> integer.first) or
        not raisesOverflowError(-16111 >>          -999) or
        not raisesOverflowError(-16111 >>           -63) or
        not raisesOverflowError(-16111 >>            -1) or
        not raisesOverflowError(-16111 >>            64) or
        not raisesOverflowError(-16111 >>           999) or
        not raisesOverflowError(-16111 >>  integer.last) or
        not raisesOverflowError(    -1 >> integer.first) or
        not raisesOverflowError(    -1 >>          -999) or
        not raisesOverflowError(    -1 >>           -63) or
        not raisesOverflowError(    -1 >>            -1) or
        not raisesOverflowError(    -1 >>            64) or
        not raisesOverflowError(    -1 >>           999) or
        not raisesOverflowError(    -1 >>  integer.last) or
        not raisesOverflowError(     0 >> integer.first) or
        not raisesOverflowError(     0 >>          -999) or
        not raisesOverflowError(     0 >>           -63) or
        not raisesOverflowError(     0 >>            -1) or
        not raisesOverflowError(     0 >>            64) or
        not raisesOverflowError(     0 >>           999) or
        not raisesOverflowError(     0 >>  integer.last) or
        not raisesOverflowError( 16111 >> integer.first) or
        not raisesOverflowError( 16111 >>          -999) or
        not raisesOverflowError( 16111 >>           -63) or
        not raisesOverflowError( 16111 >>            -1) or
        not raisesOverflowError( 16111 >>            64) or
        not raisesOverflowError( 16111 >>           999) or
        not raisesOverflowError( 16111 >>  integer.last) or
        not raisesOverflowError(intExpr(-16111) >> integer.first) or
        not raisesOverflowError(intExpr(-16111) >>          -999) or
        not raisesOverflowError(intExpr(-16111) >>           -63) or
        not raisesOverflowError(intExpr(-16111) >>            -1) or
        not raisesOverflowError(intExpr(-16111) >>            64) or
        not raisesOverflowError(intExpr(-16111) >>           999) or
        not raisesOverflowError(intExpr(-16111) >>  integer.last) or
        not raisesOverflowError(intExpr(    -1) >> integer.first) or
        not raisesOverflowError(intExpr(    -1) >>          -999) or
        not raisesOverflowError(intExpr(    -1) >>           -63) or
        not raisesOverflowError(intExpr(    -1) >>            -1) or
        not raisesOverflowError(intExpr(    -1) >>            64) or
        not raisesOverflowError(intExpr(    -1) >>           999) or
        not raisesOverflowError(intExpr(    -1) >>  integer.last) or
        not raisesOverflowError(intExpr(     0) >> integer.first) or
        not raisesOverflowError(intExpr(     0) >>          -999) or
        not raisesOverflowError(intExpr(     0) >>           -63) or
        not raisesOverflowError(intExpr(     0) >>            -1) or
        not raisesOverflowError(intExpr(     0) >>            64) or
        not raisesOverflowError(intExpr(     0) >>           999) or
        not raisesOverflowError(intExpr(     0) >>  integer.last) or
        not raisesOverflowError(intExpr( 16111) >> integer.first) or
        not raisesOverflowError(intExpr( 16111) >>          -999) or
        not raisesOverflowError(intExpr( 16111) >>           -63) or
        not raisesOverflowError(intExpr( 16111) >>            -1) or
        not raisesOverflowError(intExpr( 16111) >>            64) or
        not raisesOverflowError(intExpr( 16111) >>           999) or
        not raisesOverflowError(intExpr( 16111) >>  integer.last) or
        not raisesOverflowError(-16111 >> intExpr(integer.first)) or
        not raisesOverflowError(-16111 >> intExpr(         -999)) or
        not raisesOverflowError(-16111 >> intExpr(          -63)) or
        not raisesOverflowError(-16111 >> intExpr(           -1)) or
        not raisesOverflowError(-16111 >> intExpr(           64)) or
        not raisesOverflowError(-16111 >> intExpr(          999)) or
        not raisesOverflowError(-16111 >> intExpr( integer.last)) or
        not raisesOverflowError(    -1 >> intExpr(integer.first)) or
        not raisesOverflowError(    -1 >> intExpr(         -999)) or
        not raisesOverflowError(    -1 >> intExpr(          -63)) or
        not raisesOverflowError(    -1 >> intExpr(           -1)) or
        not raisesOverflowError(    -1 >> intExpr(           64)) or
        not raisesOverflowError(    -1 >> intExpr(          999)) or
        not raisesOverflowError(    -1 >> intExpr( integer.last)) or
        not raisesOverflowError(     0 >> intExpr(integer.first)) or
        not raisesOverflowError(     0 >> intExpr(         -999)) or
        not raisesOverflowError(     0 >> intExpr(          -63)) or
        not raisesOverflowError(     0 >> intExpr(           -1)) or
        not raisesOverflowError(     0 >> intExpr(           64)) or
        not raisesOverflowError(     0 >> intExpr(          999)) or
        not raisesOverflowError(     0 >> intExpr( integer.last)) or
        not raisesOverflowError( 16111 >> intExpr(integer.first)) or
        not raisesOverflowError( 16111 >> intExpr(         -999)) or
        not raisesOverflowError( 16111 >> intExpr(          -63)) or
        not raisesOverflowError( 16111 >> intExpr(           -1)) or
        not raisesOverflowError( 16111 >> intExpr(           64)) or
        not raisesOverflowError( 16111 >> intExpr(          999)) or
        not raisesOverflowError( 16111 >> intExpr( integer.last)) or
        not raisesOverflowError(intExpr(-16111) >> intExpr(integer.first)) or
        not raisesOverflowError(intExpr(-16111) >> intExpr(         -999)) or
        not raisesOverflowError(intExpr(-16111) >> intExpr(          -63)) or
        not raisesOverflowError(intExpr(-16111) >> intExpr(           -1)) or
        not raisesOverflowError(intExpr(-16111) >> intExpr(           64)) or
        not raisesOverflowError(intExpr(-16111) >> intExpr(          999)) or
        not raisesOverflowError(intExpr(-16111) >> intExpr( integer.last)) or
        not raisesOverflowError(intExpr(    -1) >> intExpr(integer.first)) or
        not raisesOverflowError(intExpr(    -1) >> intExpr(         -999)) or
        not raisesOverflowError(intExpr(    -1) >> intExpr(          -63)) or
        not raisesOverflowError(intExpr(    -1) >> intExpr(           -1)) or
        not raisesOverflowError(intExpr(    -1) >> intExpr(           64)) or
        not raisesOverflowError(intExpr(    -1) >> intExpr(          999)) or
        not raisesOverflowError(intExpr(    -1) >> intExpr( integer.last)) or
        not raisesOverflowError(intExpr(     0) >> intExpr(integer.first)) or
        not raisesOverflowError(intExpr(     0) >> intExpr(         -999)) or
        not raisesOverflowError(intExpr(     0) >> intExpr(          -63)) or
        not raisesOverflowError(intExpr(     0) >> intExpr(           -1)) or
        not raisesOverflowError(intExpr(     0) >> intExpr(           64)) or
        not raisesOverflowError(intExpr(     0) >> intExpr(          999)) or
        not raisesOverflowError(intExpr(     0) >> intExpr( integer.last)) or
        not raisesOverflowError(intExpr( 16111) >> intExpr(integer.first)) or
        not raisesOverflowError(intExpr( 16111) >> intExpr(         -999)) or
        not raisesOverflowError(intExpr( 16111) >> intExpr(          -63)) or
        not raisesOverflowError(intExpr( 16111) >> intExpr(           -1)) or
        not raisesOverflowError(intExpr( 16111) >> intExpr(           64)) or
        not raisesOverflowError(intExpr( 16111) >> intExpr(          999)) or
        not raisesOverflowError(intExpr( 16111) >> intExpr( integer.last)) then
      writeln(" ***** Right shift with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of right shift works correct.");
    else
      writeln(" ***** Overflow checking of right shift does not work correct.");
    end if;
  end func;


const proc: check_rShift_assign is func
  local
    var boolean: okay is TRUE;
    var boolean: ok is TRUE;
    var integer: num is 0;
    var array integer: arr is [] (0);
  begin
    num := -16111; ok := ok and raisesOverflowError(num >>:= -999);
    num := -16111; ok := ok and raisesOverflowError(num >>:=  -63);
    num := -16111; ok := ok and raisesOverflowError(num >>:=   -1);
    num := -16111; ok := ok and raisesOverflowError(num >>:=   64);
    num := -16111; ok := ok and raisesOverflowError(num >>:=  999);
    num :=     -1; ok := ok and raisesOverflowError(num >>:= -999);
    num :=     -1; ok := ok and raisesOverflowError(num >>:=  -63);
    num :=     -1; ok := ok and raisesOverflowError(num >>:=   -1);
    num :=     -1; ok := ok and raisesOverflowError(num >>:=   64);
    num :=     -1; ok := ok and raisesOverflowError(num >>:=  999);
    num :=      0; ok := ok and raisesOverflowError(num >>:= -999);
    num :=      0; ok := ok and raisesOverflowError(num >>:=  -63);
    num :=      0; ok := ok and raisesOverflowError(num >>:=   -1);
    num :=      0; ok := ok and raisesOverflowError(num >>:=   64);
    num :=      0; ok := ok and raisesOverflowError(num >>:=  999);
    num :=  16111; ok := ok and raisesOverflowError(num >>:= -999);
    num :=  16111; ok := ok and raisesOverflowError(num >>:=  -63);
    num :=  16111; ok := ok and raisesOverflowError(num >>:=   -1);
    num :=  16111; ok := ok and raisesOverflowError(num >>:=   64);
    num :=  16111; ok := ok and raisesOverflowError(num >>:=  999);
    num := -16111; ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num := -16111; ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num := -16111; ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num := -16111; ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num := -16111; ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    num :=     -1; ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num :=     -1; ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num :=     -1; ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num :=     -1; ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num :=     -1; ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    num :=      0; ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num :=      0; ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num :=      0; ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num :=      0; ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num :=      0; ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    num :=  16111; ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num :=  16111; ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num :=  16111; ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num :=  16111; ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num :=  16111; ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] := -16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] :=     -1; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] :=      0; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] :=  16111; ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    if not ok then
      writeln(" ***** Right shift assignment with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of right shift assignment works correct.");
    else
      writeln(" ***** Overflow checking of right shift assignment does not work correct.");
    end if;
  end func;


const proc: check_ulShift is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(bin32(-16111) << integer.first) or
        not raisesOverflowError(bin32(-16111) <<          -999) or
        not raisesOverflowError(bin32(-16111) <<           -63) or
        not raisesOverflowError(bin32(-16111) <<            -1) or
        not raisesOverflowError(bin32(-16111) <<            64) or
        not raisesOverflowError(bin32(-16111) <<           999) or
        not raisesOverflowError(bin32(-16111) <<  integer.last) or
        not raisesOverflowError(bin32(    -1) << integer.first) or
        not raisesOverflowError(bin32(    -1) <<          -999) or
        not raisesOverflowError(bin32(    -1) <<           -63) or
        not raisesOverflowError(bin32(    -1) <<            -1) or
        not raisesOverflowError(bin32(    -1) <<            64) or
        not raisesOverflowError(bin32(    -1) <<           999) or
        not raisesOverflowError(bin32(    -1) <<  integer.last) or
        not raisesOverflowError(bin32(     0) << integer.first) or
        not raisesOverflowError(bin32(     0) <<          -999) or
        not raisesOverflowError(bin32(     0) <<           -63) or
        not raisesOverflowError(bin32(     0) <<            -1) or
        not raisesOverflowError(bin32(     0) <<            64) or
        not raisesOverflowError(bin32(     0) <<           999) or
        not raisesOverflowError(bin32(     0) <<  integer.last) or
        not raisesOverflowError(bin32( 16111) << integer.first) or
        not raisesOverflowError(bin32( 16111) <<          -999) or
        not raisesOverflowError(bin32( 16111) <<           -63) or
        not raisesOverflowError(bin32( 16111) <<            -1) or
        not raisesOverflowError(bin32( 16111) <<            64) or
        not raisesOverflowError(bin32( 16111) <<           999) or
        not raisesOverflowError(bin32( 16111) <<  integer.last) or
        not raisesOverflowError(bin32(intExpr(-16111)) << integer.first) or
        not raisesOverflowError(bin32(intExpr(-16111)) <<          -999) or
        not raisesOverflowError(bin32(intExpr(-16111)) <<           -63) or
        not raisesOverflowError(bin32(intExpr(-16111)) <<            -1) or
        not raisesOverflowError(bin32(intExpr(-16111)) <<            64) or
        not raisesOverflowError(bin32(intExpr(-16111)) <<           999) or
        not raisesOverflowError(bin32(intExpr(-16111)) <<  integer.last) or
        not raisesOverflowError(bin32(intExpr(    -1)) << integer.first) or
        not raisesOverflowError(bin32(intExpr(    -1)) <<          -999) or
        not raisesOverflowError(bin32(intExpr(    -1)) <<           -63) or
        not raisesOverflowError(bin32(intExpr(    -1)) <<            -1) or
        not raisesOverflowError(bin32(intExpr(    -1)) <<            64) or
        not raisesOverflowError(bin32(intExpr(    -1)) <<           999) or
        not raisesOverflowError(bin32(intExpr(    -1)) <<  integer.last) or
        not raisesOverflowError(bin32(intExpr(     0)) << integer.first) or
        not raisesOverflowError(bin32(intExpr(     0)) <<          -999) or
        not raisesOverflowError(bin32(intExpr(     0)) <<           -63) or
        not raisesOverflowError(bin32(intExpr(     0)) <<            -1) or
        not raisesOverflowError(bin32(intExpr(     0)) <<            64) or
        not raisesOverflowError(bin32(intExpr(     0)) <<           999) or
        not raisesOverflowError(bin32(intExpr(     0)) <<  integer.last) or
        not raisesOverflowError(bin32(intExpr( 16111)) << integer.first) or
        not raisesOverflowError(bin32(intExpr( 16111)) <<          -999) or
        not raisesOverflowError(bin32(intExpr( 16111)) <<           -63) or
        not raisesOverflowError(bin32(intExpr( 16111)) <<            -1) or
        not raisesOverflowError(bin32(intExpr( 16111)) <<            64) or
        not raisesOverflowError(bin32(intExpr( 16111)) <<           999) or
        not raisesOverflowError(bin32(intExpr( 16111)) <<  integer.last) or
        not raisesOverflowError(bin32(-16111) << intExpr(integer.first)) or
        not raisesOverflowError(bin32(-16111) << intExpr(         -999)) or
        not raisesOverflowError(bin32(-16111) << intExpr(          -63)) or
        not raisesOverflowError(bin32(-16111) << intExpr(           -1)) or
        not raisesOverflowError(bin32(-16111) << intExpr(           64)) or
        not raisesOverflowError(bin32(-16111) << intExpr(          999)) or
        not raisesOverflowError(bin32(-16111) << intExpr( integer.last)) or
        not raisesOverflowError(bin32(    -1) << intExpr(integer.first)) or
        not raisesOverflowError(bin32(    -1) << intExpr(         -999)) or
        not raisesOverflowError(bin32(    -1) << intExpr(          -63)) or
        not raisesOverflowError(bin32(    -1) << intExpr(           -1)) or
        not raisesOverflowError(bin32(    -1) << intExpr(           64)) or
        not raisesOverflowError(bin32(    -1) << intExpr(          999)) or
        not raisesOverflowError(bin32(    -1) << intExpr( integer.last)) or
        not raisesOverflowError(bin32(     0) << intExpr(integer.first)) or
        not raisesOverflowError(bin32(     0) << intExpr(         -999)) or
        not raisesOverflowError(bin32(     0) << intExpr(          -63)) or
        not raisesOverflowError(bin32(     0) << intExpr(           -1)) or
        not raisesOverflowError(bin32(     0) << intExpr(           64)) or
        not raisesOverflowError(bin32(     0) << intExpr(          999)) or
        not raisesOverflowError(bin32(     0) << intExpr( integer.last)) or
        not raisesOverflowError(bin32( 16111) << intExpr(integer.first)) or
        not raisesOverflowError(bin32( 16111) << intExpr(         -999)) or
        not raisesOverflowError(bin32( 16111) << intExpr(          -63)) or
        not raisesOverflowError(bin32( 16111) << intExpr(           -1)) or
        not raisesOverflowError(bin32( 16111) << intExpr(           64)) or
        not raisesOverflowError(bin32( 16111) << intExpr(          999)) or
        not raisesOverflowError(bin32( 16111) << intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr(-16111)) << intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr(-16111)) << intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr(-16111)) << intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr(-16111)) << intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr(-16111)) << intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr(-16111)) << intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr(-16111)) << intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr(    -1)) << intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr(    -1)) << intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr(    -1)) << intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr(    -1)) << intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr(    -1)) << intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr(    -1)) << intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr(    -1)) << intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr(     0)) << intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr(     0)) << intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr(     0)) << intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr(     0)) << intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr(     0)) << intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr(     0)) << intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr(     0)) << intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr( 16111)) << intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr( 16111)) << intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr( 16111)) << intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr( 16111)) << intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr( 16111)) << intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr( 16111)) << intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr( 16111)) << intExpr( integer.last)) then
      writeln(" ***** Unsigned left shift with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of unsigned left shift works correct.");
    else
      writeln(" ***** Overflow checking of unsigned left shift does not work correct.");
    end if;
  end func;


const proc: check_ulShift_assign is func
  local
    var boolean: okay is TRUE;
    var boolean: ok is TRUE;
    var bin32: num is bin32(0);
    var array bin32: arr is 1 times bin32(0);
  begin
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:= -999);
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:=  -63);
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:=   -1);
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:=   64);
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:=  999);
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:= -999);
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:=  -63);
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:=   -1);
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:=   64);
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:=  999);
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:= -999);
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:=  -63);
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:=   -1);
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:=   64);
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:=  999);
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:= -999);
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:=  -63);
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:=   -1);
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:=   64);
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:=  999);
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num := bin32(-16111); ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num := bin32(    -1); ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num := bin32(     0); ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:= intExpr(-999));
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:= intExpr( -63));
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:= intExpr(  -1));
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:= intExpr(  64));
    num := bin32( 16111); ok := ok and raisesOverflowError(num <<:= intExpr( 999));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:= -999);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:=  -63);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:=   -1);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:=   64);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:=  999);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(-999));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( -63));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  -1));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr(  64));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] <<:= intExpr( 999));
    if not ok then
      writeln(" ***** Unsigned left shift assignment with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of unsigned left shift assignment works correct.");
    else
      writeln(" ***** Overflow checking of unsigned left shift assignment does not work correct.");
    end if;
  end func;


const proc: check_urShift is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(bin32(-16111) >> integer.first) or
        not raisesOverflowError(bin32(-16111) >>          -999) or
        not raisesOverflowError(bin32(-16111) >>           -63) or
        not raisesOverflowError(bin32(-16111) >>            -1) or
        not raisesOverflowError(bin32(-16111) >>            64) or
        not raisesOverflowError(bin32(-16111) >>           999) or
        not raisesOverflowError(bin32(-16111) >>  integer.last) or
        not raisesOverflowError(bin32(    -1) >> integer.first) or
        not raisesOverflowError(bin32(    -1) >>          -999) or
        not raisesOverflowError(bin32(    -1) >>           -63) or
        not raisesOverflowError(bin32(    -1) >>            -1) or
        not raisesOverflowError(bin32(    -1) >>            64) or
        not raisesOverflowError(bin32(    -1) >>           999) or
        not raisesOverflowError(bin32(    -1) >>  integer.last) or
        not raisesOverflowError(bin32(     0) >> integer.first) or
        not raisesOverflowError(bin32(     0) >>          -999) or
        not raisesOverflowError(bin32(     0) >>           -63) or
        not raisesOverflowError(bin32(     0) >>            -1) or
        not raisesOverflowError(bin32(     0) >>            64) or
        not raisesOverflowError(bin32(     0) >>           999) or
        not raisesOverflowError(bin32(     0) >>  integer.last) or
        not raisesOverflowError(bin32( 16111) >> integer.first) or
        not raisesOverflowError(bin32( 16111) >>          -999) or
        not raisesOverflowError(bin32( 16111) >>           -63) or
        not raisesOverflowError(bin32( 16111) >>            -1) or
        not raisesOverflowError(bin32( 16111) >>            64) or
        not raisesOverflowError(bin32( 16111) >>           999) or
        not raisesOverflowError(bin32( 16111) >>  integer.last) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> integer.first) or
        not raisesOverflowError(bin32(intExpr(-16111)) >>          -999) or
        not raisesOverflowError(bin32(intExpr(-16111)) >>           -63) or
        not raisesOverflowError(bin32(intExpr(-16111)) >>            -1) or
        not raisesOverflowError(bin32(intExpr(-16111)) >>            64) or
        not raisesOverflowError(bin32(intExpr(-16111)) >>           999) or
        not raisesOverflowError(bin32(intExpr(-16111)) >>  integer.last) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> integer.first) or
        not raisesOverflowError(bin32(intExpr(    -1)) >>          -999) or
        not raisesOverflowError(bin32(intExpr(    -1)) >>           -63) or
        not raisesOverflowError(bin32(intExpr(    -1)) >>            -1) or
        not raisesOverflowError(bin32(intExpr(    -1)) >>            64) or
        not raisesOverflowError(bin32(intExpr(    -1)) >>           999) or
        not raisesOverflowError(bin32(intExpr(    -1)) >>  integer.last) or
        not raisesOverflowError(bin32(intExpr(     0)) >> integer.first) or
        not raisesOverflowError(bin32(intExpr(     0)) >>          -999) or
        not raisesOverflowError(bin32(intExpr(     0)) >>           -63) or
        not raisesOverflowError(bin32(intExpr(     0)) >>            -1) or
        not raisesOverflowError(bin32(intExpr(     0)) >>            64) or
        not raisesOverflowError(bin32(intExpr(     0)) >>           999) or
        not raisesOverflowError(bin32(intExpr(     0)) >>  integer.last) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> integer.first) or
        not raisesOverflowError(bin32(intExpr( 16111)) >>          -999) or
        not raisesOverflowError(bin32(intExpr( 16111)) >>           -63) or
        not raisesOverflowError(bin32(intExpr( 16111)) >>            -1) or
        not raisesOverflowError(bin32(intExpr( 16111)) >>            64) or
        not raisesOverflowError(bin32(intExpr( 16111)) >>           999) or
        not raisesOverflowError(bin32(intExpr( 16111)) >>  integer.last) or
        not raisesOverflowError(bin32(-16111) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32(-16111) >> intExpr(         -999)) or
        not raisesOverflowError(bin32(-16111) >> intExpr(          -63)) or
        not raisesOverflowError(bin32(-16111) >> intExpr(           -1)) or
        not raisesOverflowError(bin32(-16111) >> intExpr(           64)) or
        not raisesOverflowError(bin32(-16111) >> intExpr(          999)) or
        not raisesOverflowError(bin32(-16111) >> intExpr( integer.last)) or
        not raisesOverflowError(bin32(    -1) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32(    -1) >> intExpr(         -999)) or
        not raisesOverflowError(bin32(    -1) >> intExpr(          -63)) or
        not raisesOverflowError(bin32(    -1) >> intExpr(           -1)) or
        not raisesOverflowError(bin32(    -1) >> intExpr(           64)) or
        not raisesOverflowError(bin32(    -1) >> intExpr(          999)) or
        not raisesOverflowError(bin32(    -1) >> intExpr( integer.last)) or
        not raisesOverflowError(bin32(     0) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32(     0) >> intExpr(         -999)) or
        not raisesOverflowError(bin32(     0) >> intExpr(          -63)) or
        not raisesOverflowError(bin32(     0) >> intExpr(           -1)) or
        not raisesOverflowError(bin32(     0) >> intExpr(           64)) or
        not raisesOverflowError(bin32(     0) >> intExpr(          999)) or
        not raisesOverflowError(bin32(     0) >> intExpr( integer.last)) or
        not raisesOverflowError(bin32( 16111) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32( 16111) >> intExpr(         -999)) or
        not raisesOverflowError(bin32( 16111) >> intExpr(          -63)) or
        not raisesOverflowError(bin32( 16111) >> intExpr(           -1)) or
        not raisesOverflowError(bin32( 16111) >> intExpr(           64)) or
        not raisesOverflowError(bin32( 16111) >> intExpr(          999)) or
        not raisesOverflowError(bin32( 16111) >> intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr(-16111)) >> intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr(    -1)) >> intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr(     0)) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr(     0)) >> intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr(     0)) >> intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr(     0)) >> intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr(     0)) >> intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr(     0)) >> intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr(     0)) >> intExpr( integer.last)) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> intExpr(integer.first)) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> intExpr(         -999)) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> intExpr(          -63)) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> intExpr(           -1)) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> intExpr(           64)) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> intExpr(          999)) or
        not raisesOverflowError(bin32(intExpr( 16111)) >> intExpr( integer.last)) then
      writeln(" ***** Unsigned right shift with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of unsigned right shift works correct.");
    else
      writeln(" ***** Overflow checking of unsigned right shift does not work correct.");
    end if;
  end func;


const proc: check_urShift_assign is func
  local
    var boolean: okay is TRUE;
    var boolean: ok is TRUE;
    var bin32: num is bin32(0);
    var array bin32: arr is 1 times bin32(0);
  begin
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:= -999);
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:=  -63);
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:=   -1);
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:=   64);
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:=  999);
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:= -999);
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:=  -63);
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:=   -1);
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:=   64);
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:=  999);
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:= -999);
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:=  -63);
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:=   -1);
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:=   64);
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:=  999);
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:= -999);
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:=  -63);
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:=   -1);
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:=   64);
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:=  999);
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num := bin32(-16111); ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num := bin32(    -1); ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num := bin32(     0); ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:= intExpr(-999));
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:= intExpr( -63));
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:= intExpr(  -1));
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:= intExpr(  64));
    num := bin32( 16111); ok := ok and raisesOverflowError(num >>:= intExpr( 999));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:= -999);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:=  -63);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:=   -1);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:=   64);
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:=  999);
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] := bin32(-16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] := bin32(    -1); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] := bin32(     0); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(-999));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( -63));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  -1));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr(  64));
    arr[1] := bin32( 16111); ok := ok and raisesOverflowError(arr[1] >>:= intExpr( 999));
    if not ok then
      writeln(" ***** Unsigned right shift assignment with illegal shift count does not raise OVERFLOW_ERROR.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of unsigned right shift assignment works correct.");
    else
      writeln(" ***** Overflow checking of unsigned right shift assignment does not work correct.");
    end if;
  end func;


const proc: check_power is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(            INT64_MIN  **  2) or
        not raisesOverflowError((-9223372036854775807) **  2) or
        not raisesOverflowError(         (-3037000500) **  2) or
        not raisesOverflowError(         (-3037000499) **  3) or
        not raisesOverflowError(         (-2147483648) **  3) or
        not raisesOverflowError(            (-2097153) **  3) or
        not raisesOverflowError(            (-2097152) **  4) or
        not raisesOverflowError(            (-2097151) **  4) or
        not raisesOverflowError(            (-1234577) **  4) or
        not raisesOverflowError(             (-123457) **  4) or
        not raisesOverflowError(              (-55109) **  4) or
        not raisesOverflowError(              (-55108) **  5) or
        not raisesOverflowError(              (-32768) **  5) or
        not raisesOverflowError(              (-32767) **  5) or
        not raisesOverflowError(               (-6209) **  5) or
        not raisesOverflowError(               (-6208) **  6) or
        not raisesOverflowError(               (-1449) **  6) or
        not raisesOverflowError(               (-1448) **  7) or
        not raisesOverflowError(                (-513) **  7) or
        not raisesOverflowError(                (-512) **  8) or
        not raisesOverflowError(                (-511) **  8) or
        not raisesOverflowError(                (-235) **  8) or
        not raisesOverflowError(                (-234) **  9) or
        not raisesOverflowError(                (-129) **  9) or
        not raisesOverflowError(                (-128) ** 10) or
        not raisesOverflowError(                (-127) ** 10) or
        not raisesOverflowError(                 (-97) ** 10) or
        not raisesOverflowError(                 (-10) ** 19) or
        not raisesOverflowError(                  (-9) ** 20) or
        not raisesOverflowError(                  (-8) ** 22) or
        not raisesOverflowError(                  (-7) ** 23) or
        not raisesOverflowError(                  (-6) ** 25) or
        not raisesOverflowError(                  (-5) ** 28) or
        not raisesOverflowError(                  (-4) ** 32) or
        not raisesOverflowError(                  (-3) ** 40) or
        not raisesOverflowError(                  (-2) ** 64) or
        not raisesOverflowError(                    2  ** 63) or
        not raisesOverflowError(                    3  ** 40) or
        not raisesOverflowError(                    4  ** 32) or
        not raisesOverflowError(                    5  ** 28) or
        not raisesOverflowError(                    6  ** 25) or
        not raisesOverflowError(                    7  ** 23) or
        not raisesOverflowError(                    8  ** 21) or
        not raisesOverflowError(                    9  ** 20) or
        not raisesOverflowError(                   10  ** 19) or
        not raisesOverflowError(                   97  ** 10) or
        not raisesOverflowError(                  127  ** 10) or
        not raisesOverflowError(                  128  **  9) or
        not raisesOverflowError(                  129  **  9) or
        not raisesOverflowError(                  234  **  9) or
        not raisesOverflowError(                  235  **  8) or
        not raisesOverflowError(                  511  **  8) or
        not raisesOverflowError(                  512  **  7) or
        not raisesOverflowError(                  513  **  7) or
        not raisesOverflowError(                 1448  **  7) or
        not raisesOverflowError(                 1449  **  6) or
        not raisesOverflowError(                 6208  **  6) or
        not raisesOverflowError(                 6209  **  5) or
        not raisesOverflowError(                32767  **  5) or
        not raisesOverflowError(                32768  **  5) or
        not raisesOverflowError(                55108  **  5) or
        not raisesOverflowError(                55109  **  4) or
        not raisesOverflowError(               123457  **  4) or
        not raisesOverflowError(              1234577  **  4) or
        not raisesOverflowError(              2097151  **  4) or
        not raisesOverflowError(              2097152  **  3) or
        not raisesOverflowError(              2097153  **  3) or
        not raisesOverflowError(           2147483648  **  3) or
        not raisesOverflowError(           3037000499  **  3) or
        not raisesOverflowError(           3037000500  **  2) or
        not raisesOverflowError(  9223372036854775807  **  2) then
      writeln(" ***** Overflow when computing power does not raise OVERFLOW_ERROR. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) **  2) or
        not raisesOverflowError(intExpr(-9223372036854775807) **  2) or
        not raisesOverflowError(intExpr(         -3037000500) **  2) or
        not raisesOverflowError(intExpr(         -3037000499) **  3) or
        not raisesOverflowError(intExpr(         -2147483648) **  3) or
        not raisesOverflowError(intExpr(            -2097153) **  3) or
        not raisesOverflowError(intExpr(            -2097152) **  4) or
        not raisesOverflowError(intExpr(            -2097151) **  4) or
        not raisesOverflowError(intExpr(            -1234577) **  4) or
        not raisesOverflowError(intExpr(             -123457) **  4) or
        not raisesOverflowError(intExpr(              -55109) **  4) or
        not raisesOverflowError(intExpr(              -55108) **  5) or
        not raisesOverflowError(intExpr(              -32768) **  5) or
        not raisesOverflowError(intExpr(              -32767) **  5) or
        not raisesOverflowError(intExpr(               -6209) **  5) or
        not raisesOverflowError(intExpr(               -6208) **  6) or
        not raisesOverflowError(intExpr(               -1449) **  6) or
        not raisesOverflowError(intExpr(               -1448) **  7) or
        not raisesOverflowError(intExpr(                -513) **  7) or
        not raisesOverflowError(intExpr(                -512) **  8) or
        not raisesOverflowError(intExpr(                -511) **  8) or
        not raisesOverflowError(intExpr(                -235) **  8) or
        not raisesOverflowError(intExpr(                -234) **  9) or
        not raisesOverflowError(intExpr(                -129) **  9) or
        not raisesOverflowError(intExpr(                -128) ** 10) or
        not raisesOverflowError(intExpr(                -127) ** 10) or
        not raisesOverflowError(intExpr(                 -97) ** 10) or
        not raisesOverflowError(intExpr(                 -10) ** 19) or
        not raisesOverflowError(intExpr(                  -9) ** 20) or
        not raisesOverflowError(intExpr(                  -8) ** 22) or
        not raisesOverflowError(intExpr(                  -7) ** 23) or
        not raisesOverflowError(intExpr(                  -6) ** 25) or
        not raisesOverflowError(intExpr(                  -5) ** 28) or
        not raisesOverflowError(intExpr(                  -4) ** 32) or
        not raisesOverflowError(intExpr(                  -3) ** 40) or
        not raisesOverflowError(intExpr(                  -2) ** 64) or
        not raisesOverflowError(intExpr(                   2) ** 63) or
        not raisesOverflowError(intExpr(                   3) ** 40) or
        not raisesOverflowError(intExpr(                   4) ** 32) or
        not raisesOverflowError(intExpr(                   5) ** 28) or
        not raisesOverflowError(intExpr(                   6) ** 25) or
        not raisesOverflowError(intExpr(                   7) ** 23) or
        not raisesOverflowError(intExpr(                   8) ** 21) or
        not raisesOverflowError(intExpr(                   9) ** 20) or
        not raisesOverflowError(intExpr(                  10) ** 19) or
        not raisesOverflowError(intExpr(                  97) ** 10) or
        not raisesOverflowError(intExpr(                 127) ** 10) or
        not raisesOverflowError(intExpr(                 128) **  9) or
        not raisesOverflowError(intExpr(                 129) **  9) or
        not raisesOverflowError(intExpr(                 234) **  9) or
        not raisesOverflowError(intExpr(                 235) **  8) or
        not raisesOverflowError(intExpr(                 511) **  8) or
        not raisesOverflowError(intExpr(                 512) **  7) or
        not raisesOverflowError(intExpr(                 513) **  7) or
        not raisesOverflowError(intExpr(                1448) **  7) or
        not raisesOverflowError(intExpr(                1449) **  6) or
        not raisesOverflowError(intExpr(                6208) **  6) or
        not raisesOverflowError(intExpr(                6209) **  5) or
        not raisesOverflowError(intExpr(               32767) **  5) or
        not raisesOverflowError(intExpr(               32768) **  5) or
        not raisesOverflowError(intExpr(               55108) **  5) or
        not raisesOverflowError(intExpr(               55109) **  4) or
        not raisesOverflowError(intExpr(              123457) **  4) or
        not raisesOverflowError(intExpr(             1234577) **  4) or
        not raisesOverflowError(intExpr(             2097151) **  4) or
        not raisesOverflowError(intExpr(             2097152) **  3) or
        not raisesOverflowError(intExpr(             2097153) **  3) or
        not raisesOverflowError(intExpr(          2147483648) **  3) or
        not raisesOverflowError(intExpr(          3037000499) **  3) or
        not raisesOverflowError(intExpr(          3037000500) **  2) or
        not raisesOverflowError(intExpr( 9223372036854775807) **  2) then
      writeln(" ***** Overflow when computing power does not raise OVERFLOW_ERROR. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(            INT64_MIN  ** intExpr( 2)) or
        not raisesOverflowError((-9223372036854775807) ** intExpr( 2)) or
        not raisesOverflowError(         (-3037000500) ** intExpr( 2)) or
        not raisesOverflowError(         (-3037000499) ** intExpr( 3)) or
        not raisesOverflowError(         (-2147483648) ** intExpr( 3)) or
        not raisesOverflowError(            (-2097153) ** intExpr( 3)) or
        not raisesOverflowError(            (-2097152) ** intExpr( 4)) or
        not raisesOverflowError(            (-2097151) ** intExpr( 4)) or
        not raisesOverflowError(            (-1234577) ** intExpr( 4)) or
        not raisesOverflowError(             (-123457) ** intExpr( 4)) or
        not raisesOverflowError(              (-55109) ** intExpr( 4)) or
        not raisesOverflowError(              (-55108) ** intExpr( 5)) or
        not raisesOverflowError(              (-32768) ** intExpr( 5)) or
        not raisesOverflowError(              (-32767) ** intExpr( 5)) or
        not raisesOverflowError(               (-6209) ** intExpr( 5)) or
        not raisesOverflowError(               (-6208) ** intExpr( 6)) or
        not raisesOverflowError(               (-1449) ** intExpr( 6)) or
        not raisesOverflowError(               (-1448) ** intExpr( 7)) or
        not raisesOverflowError(                (-513) ** intExpr( 7)) or
        not raisesOverflowError(                (-512) ** intExpr( 8)) or
        not raisesOverflowError(                (-511) ** intExpr( 8)) or
        not raisesOverflowError(                (-235) ** intExpr( 8)) or
        not raisesOverflowError(                (-234) ** intExpr( 9)) or
        not raisesOverflowError(                (-129) ** intExpr( 9)) or
        not raisesOverflowError(                (-128) ** intExpr(10)) or
        not raisesOverflowError(                (-127) ** intExpr(10)) or
        not raisesOverflowError(                 (-97) ** intExpr(10)) or
        not raisesOverflowError(                 (-10) ** intExpr(19)) or
        not raisesOverflowError(                  (-9) ** intExpr(20)) or
        not raisesOverflowError(                  (-8) ** intExpr(22)) or
        not raisesOverflowError(                  (-7) ** intExpr(23)) or
        not raisesOverflowError(                  (-6) ** intExpr(25)) or
        not raisesOverflowError(                  (-5) ** intExpr(28)) or
        not raisesOverflowError(                  (-4) ** intExpr(32)) or
        not raisesOverflowError(                  (-3) ** intExpr(40)) or
        not raisesOverflowError(                  (-2) ** intExpr(64)) or
        not raisesOverflowError(                    2  ** intExpr(63)) or
        not raisesOverflowError(                    3  ** intExpr(40)) or
        not raisesOverflowError(                    4  ** intExpr(32)) or
        not raisesOverflowError(                    5  ** intExpr(28)) or
        not raisesOverflowError(                    6  ** intExpr(25)) or
        not raisesOverflowError(                    7  ** intExpr(23)) or
        not raisesOverflowError(                    8  ** intExpr(21)) or
        not raisesOverflowError(                    9  ** intExpr(20)) or
        not raisesOverflowError(                   10  ** intExpr(19)) or
        not raisesOverflowError(                   97  ** intExpr(10)) or
        not raisesOverflowError(                  127  ** intExpr(10)) or
        not raisesOverflowError(                  128  ** intExpr( 9)) or
        not raisesOverflowError(                  129  ** intExpr( 9)) or
        not raisesOverflowError(                  234  ** intExpr( 9)) or
        not raisesOverflowError(                  235  ** intExpr( 8)) or
        not raisesOverflowError(                  511  ** intExpr( 8)) or
        not raisesOverflowError(                  512  ** intExpr( 7)) or
        not raisesOverflowError(                  513  ** intExpr( 7)) or
        not raisesOverflowError(                 1448  ** intExpr( 7)) or
        not raisesOverflowError(                 1449  ** intExpr( 6)) or
        not raisesOverflowError(                 6208  ** intExpr( 6)) or
        not raisesOverflowError(                 6209  ** intExpr( 5)) or
        not raisesOverflowError(                32767  ** intExpr( 5)) or
        not raisesOverflowError(                32768  ** intExpr( 5)) or
        not raisesOverflowError(                55108  ** intExpr( 5)) or
        not raisesOverflowError(                55109  ** intExpr( 4)) or
        not raisesOverflowError(               123457  ** intExpr( 4)) or
        not raisesOverflowError(              1234577  ** intExpr( 4)) or
        not raisesOverflowError(              2097151  ** intExpr( 4)) or
        not raisesOverflowError(              2097152  ** intExpr( 3)) or
        not raisesOverflowError(              2097153  ** intExpr( 3)) or
        not raisesOverflowError(           2147483648  ** intExpr( 3)) or
        not raisesOverflowError(           3037000499  ** intExpr( 3)) or
        not raisesOverflowError(           3037000500  ** intExpr( 2)) or
        not raisesOverflowError(  9223372036854775807  ** intExpr( 2)) then
      writeln(" ***** Overflow when computing power does not raise OVERFLOW_ERROR. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(           INT64_MIN) ** intExpr( 2)) or
        not raisesOverflowError(intExpr(-9223372036854775807) ** intExpr( 2)) or
        not raisesOverflowError(intExpr(         -3037000500) ** intExpr( 2)) or
        not raisesOverflowError(intExpr(         -3037000499) ** intExpr( 3)) or
        not raisesOverflowError(intExpr(         -2147483648) ** intExpr( 3)) or
        not raisesOverflowError(intExpr(            -2097153) ** intExpr( 3)) or
        not raisesOverflowError(intExpr(            -2097152) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(            -2097151) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(            -1234577) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(             -123457) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(              -55109) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(              -55108) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(              -32768) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(              -32767) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(               -6209) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(               -6208) ** intExpr( 6)) or
        not raisesOverflowError(intExpr(               -1449) ** intExpr( 6)) or
        not raisesOverflowError(intExpr(               -1448) ** intExpr( 7)) or
        not raisesOverflowError(intExpr(                -513) ** intExpr( 7)) or
        not raisesOverflowError(intExpr(                -512) ** intExpr( 8)) or
        not raisesOverflowError(intExpr(                -511) ** intExpr( 8)) or
        not raisesOverflowError(intExpr(                -235) ** intExpr( 8)) or
        not raisesOverflowError(intExpr(                -234) ** intExpr( 9)) or
        not raisesOverflowError(intExpr(                -129) ** intExpr( 9)) or
        not raisesOverflowError(intExpr(                -128) ** intExpr(10)) or
        not raisesOverflowError(intExpr(                -127) ** intExpr(10)) or
        not raisesOverflowError(intExpr(                 -97) ** intExpr(10)) or
        not raisesOverflowError(intExpr(                 -10) ** intExpr(19)) or
        not raisesOverflowError(intExpr(                  -9) ** intExpr(20)) or
        not raisesOverflowError(intExpr(                  -8) ** intExpr(22)) or
        not raisesOverflowError(intExpr(                  -7) ** intExpr(23)) or
        not raisesOverflowError(intExpr(                  -6) ** intExpr(25)) or
        not raisesOverflowError(intExpr(                  -5) ** intExpr(28)) or
        not raisesOverflowError(intExpr(                  -4) ** intExpr(32)) or
        not raisesOverflowError(intExpr(                  -3) ** intExpr(40)) or
        not raisesOverflowError(intExpr(                  -2) ** intExpr(64)) or
        not raisesOverflowError(intExpr(                   2) ** intExpr(63)) or
        not raisesOverflowError(intExpr(                   3) ** intExpr(40)) or
        not raisesOverflowError(intExpr(                   4) ** intExpr(32)) or
        not raisesOverflowError(intExpr(                   5) ** intExpr(28)) or
        not raisesOverflowError(intExpr(                   6) ** intExpr(25)) or
        not raisesOverflowError(intExpr(                   7) ** intExpr(23)) or
        not raisesOverflowError(intExpr(                   8) ** intExpr(21)) or
        not raisesOverflowError(intExpr(                   9) ** intExpr(20)) or
        not raisesOverflowError(intExpr(                  10) ** intExpr(19)) or
        not raisesOverflowError(intExpr(                  97) ** intExpr(10)) or
        not raisesOverflowError(intExpr(                 127) ** intExpr(10)) or
        not raisesOverflowError(intExpr(                 128) ** intExpr( 9)) or
        not raisesOverflowError(intExpr(                 129) ** intExpr( 9)) or
        not raisesOverflowError(intExpr(                 234) ** intExpr( 9)) or
        not raisesOverflowError(intExpr(                 235) ** intExpr( 8)) or
        not raisesOverflowError(intExpr(                 511) ** intExpr( 8)) or
        not raisesOverflowError(intExpr(                 512) ** intExpr( 7)) or
        not raisesOverflowError(intExpr(                 513) ** intExpr( 7)) or
        not raisesOverflowError(intExpr(                1448) ** intExpr( 7)) or
        not raisesOverflowError(intExpr(                1449) ** intExpr( 6)) or
        not raisesOverflowError(intExpr(                6208) ** intExpr( 6)) or
        not raisesOverflowError(intExpr(                6209) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(               32767) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(               32768) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(               55108) ** intExpr( 5)) or
        not raisesOverflowError(intExpr(               55109) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(              123457) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(             1234577) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(             2097151) ** intExpr( 4)) or
        not raisesOverflowError(intExpr(             2097152) ** intExpr( 3)) or
        not raisesOverflowError(intExpr(             2097153) ** intExpr( 3)) or
        not raisesOverflowError(intExpr(          2147483648) ** intExpr( 3)) or
        not raisesOverflowError(intExpr(          3037000499) ** intExpr( 3)) or
        not raisesOverflowError(intExpr(          3037000500) ** intExpr( 2)) or
        not raisesOverflowError(intExpr( 9223372036854775807) ** intExpr( 2)) then
      writeln(" ***** Overflow when computing power does not raise OVERFLOW_ERROR. (4)");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of power works correct.");
    else
      writeln(" ***** Overflow checking of power does not work correct.");
    end if;
  end func;


const proc: check_binom is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError((-99) !         16) or
        not raisesOverflowError((-98) !         16) or
        not raisesOverflowError((-97) !         16) or
        not raisesOverflowError((-96) !         17) or
        not raisesOverflowError((-95) !         17) or
        not raisesOverflowError((-94) !         17) or
        not raisesOverflowError((-93) !         17) or
        not raisesOverflowError((-92) !         17) or
        not raisesOverflowError((-91) !         17) or
        not raisesOverflowError((-90) !         17) or
        not raisesOverflowError((-89) !         17) or
        not raisesOverflowError((-88) !         17) or
        not raisesOverflowError((-87) !         17) or
        not raisesOverflowError((-86) !         17) or
        not raisesOverflowError((-85) !         18) or
        not raisesOverflowError((-84) !         18) or
        not raisesOverflowError((-83) !         18) or
        not raisesOverflowError((-82) !         18) or
        not raisesOverflowError((-81) !         18) or
        not raisesOverflowError((-80) !         18) or
        not raisesOverflowError((-79) !         18) or
        not raisesOverflowError((-78) !         18) or
        not raisesOverflowError((-77) !         19) or
        not raisesOverflowError((-76) !         19) or
        not raisesOverflowError((-75) !         19) or
        not raisesOverflowError((-74) !         19) or
        not raisesOverflowError((-73) !         19) or
        not raisesOverflowError((-72) !         19) or
        not raisesOverflowError((-71) !         19) or
        not raisesOverflowError((-70) !         20) or
        not raisesOverflowError((-69) !         20) or
        not raisesOverflowError((-68) !         20) or
        not raisesOverflowError((-67) !         20) or
        not raisesOverflowError((-66) !         20) or
        not raisesOverflowError((-65) !         20) or
        not raisesOverflowError((-64) !         21) or
        not raisesOverflowError((-63) !         21) or
        not raisesOverflowError((-62) !         21) or
        not raisesOverflowError((-61) !         21) or
        not raisesOverflowError((-60) !         21) or
        not raisesOverflowError((-59) !         22) or
        not raisesOverflowError((-58) !         22) or
        not raisesOverflowError((-57) !         22) or
        not raisesOverflowError((-56) !         22) or
        not raisesOverflowError((-55) !         23) or
        not raisesOverflowError((-54) !         23) or
        not raisesOverflowError((-53) !         23) or
        not raisesOverflowError((-52) !         24) or
        not raisesOverflowError((-51) !         24) or
        not raisesOverflowError((-50) !         24) or
        not raisesOverflowError((-49) !         25) or
        not raisesOverflowError((-48) !         25) or
        not raisesOverflowError((-47) !         25) or
        not raisesOverflowError((-46) !         26) or
        not raisesOverflowError((-45) !         26) or
        not raisesOverflowError((-44) !         27) or
        not raisesOverflowError((-43) !         27) or
        not raisesOverflowError((-42) !         28) or
        not raisesOverflowError((-41) !         28) or
        not raisesOverflowError((-40) !         29) or
        not raisesOverflowError((-39) !         30) or
        not raisesOverflowError((-38) !         30) or
        not raisesOverflowError((-37) !         31) or
        not raisesOverflowError((-36) !         32) or
        not raisesOverflowError((-35) !         33) or
        not raisesOverflowError((-34) !         34) or
        not raisesOverflowError((-33) !         35) or
        not raisesOverflowError((-32) !         36) or
        not raisesOverflowError((-31) !         37) or
        not raisesOverflowError((-30) !         39) or
        not raisesOverflowError((-29) !         40) or
        not raisesOverflowError((-28) !         42) or
        not raisesOverflowError((-27) !         44) or
        not raisesOverflowError((-26) !         46) or
        not raisesOverflowError((-25) !         49) or
        not raisesOverflowError((-24) !         52) or
        not raisesOverflowError((-23) !         55) or
        not raisesOverflowError((-22) !         59) or
        not raisesOverflowError((-21) !         64) or
        not raisesOverflowError((-20) !         70) or
        not raisesOverflowError((-19) !         77) or
        not raisesOverflowError((-18) !         85) or
        not raisesOverflowError((-17) !         96) or
        not raisesOverflowError((-16) !        111) or
        not raisesOverflowError((-15) !        130) or
        not raisesOverflowError((-14) !        157) or
        not raisesOverflowError((-13) !        195) or
        not raisesOverflowError((-12) !        255) or
        not raisesOverflowError((-11) !        352) or
        not raisesOverflowError((-10) !        526) or
        not raisesOverflowError(( -9) !        880) or
        not raisesOverflowError(( -8) !       1727) or
        not raisesOverflowError(( -7) !       4332) or
        not raisesOverflowError(( -6) !      16171) or
        not raisesOverflowError(( -5) !     121974) or
        not raisesOverflowError(( -4) !    3810777) or
        not raisesOverflowError(( -3) ! 4294967295) then
      writeln(" ***** Overflow not raised for binomial coefficient with negative n. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(-99) !         16) or
        not raisesOverflowError(intExpr(-98) !         16) or
        not raisesOverflowError(intExpr(-97) !         16) or
        not raisesOverflowError(intExpr(-96) !         17) or
        not raisesOverflowError(intExpr(-95) !         17) or
        not raisesOverflowError(intExpr(-94) !         17) or
        not raisesOverflowError(intExpr(-93) !         17) or
        not raisesOverflowError(intExpr(-92) !         17) or
        not raisesOverflowError(intExpr(-91) !         17) or
        not raisesOverflowError(intExpr(-90) !         17) or
        not raisesOverflowError(intExpr(-89) !         17) or
        not raisesOverflowError(intExpr(-88) !         17) or
        not raisesOverflowError(intExpr(-87) !         17) or
        not raisesOverflowError(intExpr(-86) !         17) or
        not raisesOverflowError(intExpr(-85) !         18) or
        not raisesOverflowError(intExpr(-84) !         18) or
        not raisesOverflowError(intExpr(-83) !         18) or
        not raisesOverflowError(intExpr(-82) !         18) or
        not raisesOverflowError(intExpr(-81) !         18) or
        not raisesOverflowError(intExpr(-80) !         18) or
        not raisesOverflowError(intExpr(-79) !         18) or
        not raisesOverflowError(intExpr(-78) !         18) or
        not raisesOverflowError(intExpr(-77) !         19) or
        not raisesOverflowError(intExpr(-76) !         19) or
        not raisesOverflowError(intExpr(-75) !         19) or
        not raisesOverflowError(intExpr(-74) !         19) or
        not raisesOverflowError(intExpr(-73) !         19) or
        not raisesOverflowError(intExpr(-72) !         19) or
        not raisesOverflowError(intExpr(-71) !         19) or
        not raisesOverflowError(intExpr(-70) !         20) or
        not raisesOverflowError(intExpr(-69) !         20) or
        not raisesOverflowError(intExpr(-68) !         20) or
        not raisesOverflowError(intExpr(-67) !         20) or
        not raisesOverflowError(intExpr(-66) !         20) or
        not raisesOverflowError(intExpr(-65) !         20) or
        not raisesOverflowError(intExpr(-64) !         21) or
        not raisesOverflowError(intExpr(-63) !         21) or
        not raisesOverflowError(intExpr(-62) !         21) or
        not raisesOverflowError(intExpr(-61) !         21) or
        not raisesOverflowError(intExpr(-60) !         21) or
        not raisesOverflowError(intExpr(-59) !         22) or
        not raisesOverflowError(intExpr(-58) !         22) or
        not raisesOverflowError(intExpr(-57) !         22) or
        not raisesOverflowError(intExpr(-56) !         22) or
        not raisesOverflowError(intExpr(-55) !         23) or
        not raisesOverflowError(intExpr(-54) !         23) or
        not raisesOverflowError(intExpr(-53) !         23) or
        not raisesOverflowError(intExpr(-52) !         24) or
        not raisesOverflowError(intExpr(-51) !         24) or
        not raisesOverflowError(intExpr(-50) !         24) or
        not raisesOverflowError(intExpr(-49) !         25) or
        not raisesOverflowError(intExpr(-48) !         25) or
        not raisesOverflowError(intExpr(-47) !         25) or
        not raisesOverflowError(intExpr(-46) !         26) or
        not raisesOverflowError(intExpr(-45) !         26) or
        not raisesOverflowError(intExpr(-44) !         27) or
        not raisesOverflowError(intExpr(-43) !         27) or
        not raisesOverflowError(intExpr(-42) !         28) or
        not raisesOverflowError(intExpr(-41) !         28) or
        not raisesOverflowError(intExpr(-40) !         29) or
        not raisesOverflowError(intExpr(-39) !         30) or
        not raisesOverflowError(intExpr(-38) !         30) or
        not raisesOverflowError(intExpr(-37) !         31) or
        not raisesOverflowError(intExpr(-36) !         32) or
        not raisesOverflowError(intExpr(-35) !         33) or
        not raisesOverflowError(intExpr(-34) !         34) or
        not raisesOverflowError(intExpr(-33) !         35) or
        not raisesOverflowError(intExpr(-32) !         36) or
        not raisesOverflowError(intExpr(-31) !         37) or
        not raisesOverflowError(intExpr(-30) !         39) or
        not raisesOverflowError(intExpr(-29) !         40) or
        not raisesOverflowError(intExpr(-28) !         42) or
        not raisesOverflowError(intExpr(-27) !         44) or
        not raisesOverflowError(intExpr(-26) !         46) or
        not raisesOverflowError(intExpr(-25) !         49) or
        not raisesOverflowError(intExpr(-24) !         52) or
        not raisesOverflowError(intExpr(-23) !         55) or
        not raisesOverflowError(intExpr(-22) !         59) or
        not raisesOverflowError(intExpr(-21) !         64) or
        not raisesOverflowError(intExpr(-20) !         70) or
        not raisesOverflowError(intExpr(-19) !         77) or
        not raisesOverflowError(intExpr(-18) !         85) or
        not raisesOverflowError(intExpr(-17) !         96) or
        not raisesOverflowError(intExpr(-16) !        111) or
        not raisesOverflowError(intExpr(-15) !        130) or
        not raisesOverflowError(intExpr(-14) !        157) or
        not raisesOverflowError(intExpr(-13) !        195) or
        not raisesOverflowError(intExpr(-12) !        255) or
        not raisesOverflowError(intExpr(-11) !        352) or
        not raisesOverflowError(intExpr(-10) !        526) or
        not raisesOverflowError(intExpr( -9) !        880) or
        not raisesOverflowError(intExpr( -8) !       1727) or
        not raisesOverflowError(intExpr( -7) !       4332) or
        not raisesOverflowError(intExpr( -6) !      16171) or
        not raisesOverflowError(intExpr( -5) !     121974) or
        not raisesOverflowError(intExpr( -4) !    3810777) or
        not raisesOverflowError(intExpr( -3) ! 4294967295) then
      writeln(" ***** Overflow not raised for binomial coefficient with negative n. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError((-99) ! intExpr(        16)) or
        not raisesOverflowError((-98) ! intExpr(        16)) or
        not raisesOverflowError((-97) ! intExpr(        16)) or
        not raisesOverflowError((-96) ! intExpr(        17)) or
        not raisesOverflowError((-95) ! intExpr(        17)) or
        not raisesOverflowError((-94) ! intExpr(        17)) or
        not raisesOverflowError((-93) ! intExpr(        17)) or
        not raisesOverflowError((-92) ! intExpr(        17)) or
        not raisesOverflowError((-91) ! intExpr(        17)) or
        not raisesOverflowError((-90) ! intExpr(        17)) or
        not raisesOverflowError((-89) ! intExpr(        17)) or
        not raisesOverflowError((-88) ! intExpr(        17)) or
        not raisesOverflowError((-87) ! intExpr(        17)) or
        not raisesOverflowError((-86) ! intExpr(        17)) or
        not raisesOverflowError((-85) ! intExpr(        18)) or
        not raisesOverflowError((-84) ! intExpr(        18)) or
        not raisesOverflowError((-83) ! intExpr(        18)) or
        not raisesOverflowError((-82) ! intExpr(        18)) or
        not raisesOverflowError((-81) ! intExpr(        18)) or
        not raisesOverflowError((-80) ! intExpr(        18)) or
        not raisesOverflowError((-79) ! intExpr(        18)) or
        not raisesOverflowError((-78) ! intExpr(        18)) or
        not raisesOverflowError((-77) ! intExpr(        19)) or
        not raisesOverflowError((-76) ! intExpr(        19)) or
        not raisesOverflowError((-75) ! intExpr(        19)) or
        not raisesOverflowError((-74) ! intExpr(        19)) or
        not raisesOverflowError((-73) ! intExpr(        19)) or
        not raisesOverflowError((-72) ! intExpr(        19)) or
        not raisesOverflowError((-71) ! intExpr(        19)) or
        not raisesOverflowError((-70) ! intExpr(        20)) or
        not raisesOverflowError((-69) ! intExpr(        20)) or
        not raisesOverflowError((-68) ! intExpr(        20)) or
        not raisesOverflowError((-67) ! intExpr(        20)) or
        not raisesOverflowError((-66) ! intExpr(        20)) or
        not raisesOverflowError((-65) ! intExpr(        20)) or
        not raisesOverflowError((-64) ! intExpr(        21)) or
        not raisesOverflowError((-63) ! intExpr(        21)) or
        not raisesOverflowError((-62) ! intExpr(        21)) or
        not raisesOverflowError((-61) ! intExpr(        21)) or
        not raisesOverflowError((-60) ! intExpr(        21)) or
        not raisesOverflowError((-59) ! intExpr(        22)) or
        not raisesOverflowError((-58) ! intExpr(        22)) or
        not raisesOverflowError((-57) ! intExpr(        22)) or
        not raisesOverflowError((-56) ! intExpr(        22)) or
        not raisesOverflowError((-55) ! intExpr(        23)) or
        not raisesOverflowError((-54) ! intExpr(        23)) or
        not raisesOverflowError((-53) ! intExpr(        23)) or
        not raisesOverflowError((-52) ! intExpr(        24)) or
        not raisesOverflowError((-51) ! intExpr(        24)) or
        not raisesOverflowError((-50) ! intExpr(        24)) or
        not raisesOverflowError((-49) ! intExpr(        25)) or
        not raisesOverflowError((-48) ! intExpr(        25)) or
        not raisesOverflowError((-47) ! intExpr(        25)) or
        not raisesOverflowError((-46) ! intExpr(        26)) or
        not raisesOverflowError((-45) ! intExpr(        26)) or
        not raisesOverflowError((-44) ! intExpr(        27)) or
        not raisesOverflowError((-43) ! intExpr(        27)) or
        not raisesOverflowError((-42) ! intExpr(        28)) or
        not raisesOverflowError((-41) ! intExpr(        28)) or
        not raisesOverflowError((-40) ! intExpr(        29)) or
        not raisesOverflowError((-39) ! intExpr(        30)) or
        not raisesOverflowError((-38) ! intExpr(        30)) or
        not raisesOverflowError((-37) ! intExpr(        31)) or
        not raisesOverflowError((-36) ! intExpr(        32)) or
        not raisesOverflowError((-35) ! intExpr(        33)) or
        not raisesOverflowError((-34) ! intExpr(        34)) or
        not raisesOverflowError((-33) ! intExpr(        35)) or
        not raisesOverflowError((-32) ! intExpr(        36)) or
        not raisesOverflowError((-31) ! intExpr(        37)) or
        not raisesOverflowError((-30) ! intExpr(        39)) or
        not raisesOverflowError((-29) ! intExpr(        40)) or
        not raisesOverflowError((-28) ! intExpr(        42)) or
        not raisesOverflowError((-27) ! intExpr(        44)) or
        not raisesOverflowError((-26) ! intExpr(        46)) or
        not raisesOverflowError((-25) ! intExpr(        49)) or
        not raisesOverflowError((-24) ! intExpr(        52)) or
        not raisesOverflowError((-23) ! intExpr(        55)) or
        not raisesOverflowError((-22) ! intExpr(        59)) or
        not raisesOverflowError((-21) ! intExpr(        64)) or
        not raisesOverflowError((-20) ! intExpr(        70)) or
        not raisesOverflowError((-19) ! intExpr(        77)) or
        not raisesOverflowError((-18) ! intExpr(        85)) or
        not raisesOverflowError((-17) ! intExpr(        96)) or
        not raisesOverflowError((-16) ! intExpr(       111)) or
        not raisesOverflowError((-15) ! intExpr(       130)) or
        not raisesOverflowError((-14) ! intExpr(       157)) or
        not raisesOverflowError((-13) ! intExpr(       195)) or
        not raisesOverflowError((-12) ! intExpr(       255)) or
        not raisesOverflowError((-11) ! intExpr(       352)) or
        not raisesOverflowError((-10) ! intExpr(       526)) or
        not raisesOverflowError(( -9) ! intExpr(       880)) or
        not raisesOverflowError(( -8) ! intExpr(      1727)) or
        not raisesOverflowError(( -7) ! intExpr(      4332)) or
        not raisesOverflowError(( -6) ! intExpr(     16171)) or
        not raisesOverflowError(( -5) ! intExpr(    121974)) or
        not raisesOverflowError(( -4) ! intExpr(   3810777)) or
        not raisesOverflowError(( -3) ! intExpr(4294967295)) then
      writeln(" ***** Overflow not raised for binomial coefficient with negative n. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(-99) ! intExpr(        16)) or
        not raisesOverflowError(intExpr(-98) ! intExpr(        16)) or
        not raisesOverflowError(intExpr(-97) ! intExpr(        16)) or
        not raisesOverflowError(intExpr(-96) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-95) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-94) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-93) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-92) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-91) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-90) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-89) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-88) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-87) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-86) ! intExpr(        17)) or
        not raisesOverflowError(intExpr(-85) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-84) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-83) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-82) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-81) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-80) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-79) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-78) ! intExpr(        18)) or
        not raisesOverflowError(intExpr(-77) ! intExpr(        19)) or
        not raisesOverflowError(intExpr(-76) ! intExpr(        19)) or
        not raisesOverflowError(intExpr(-75) ! intExpr(        19)) or
        not raisesOverflowError(intExpr(-74) ! intExpr(        19)) or
        not raisesOverflowError(intExpr(-73) ! intExpr(        19)) or
        not raisesOverflowError(intExpr(-72) ! intExpr(        19)) or
        not raisesOverflowError(intExpr(-71) ! intExpr(        19)) or
        not raisesOverflowError(intExpr(-70) ! intExpr(        20)) or
        not raisesOverflowError(intExpr(-69) ! intExpr(        20)) or
        not raisesOverflowError(intExpr(-68) ! intExpr(        20)) or
        not raisesOverflowError(intExpr(-67) ! intExpr(        20)) or
        not raisesOverflowError(intExpr(-66) ! intExpr(        20)) or
        not raisesOverflowError(intExpr(-65) ! intExpr(        20)) or
        not raisesOverflowError(intExpr(-64) ! intExpr(        21)) or
        not raisesOverflowError(intExpr(-63) ! intExpr(        21)) or
        not raisesOverflowError(intExpr(-62) ! intExpr(        21)) or
        not raisesOverflowError(intExpr(-61) ! intExpr(        21)) or
        not raisesOverflowError(intExpr(-60) ! intExpr(        21)) or
        not raisesOverflowError(intExpr(-59) ! intExpr(        22)) or
        not raisesOverflowError(intExpr(-58) ! intExpr(        22)) or
        not raisesOverflowError(intExpr(-57) ! intExpr(        22)) or
        not raisesOverflowError(intExpr(-56) ! intExpr(        22)) or
        not raisesOverflowError(intExpr(-55) ! intExpr(        23)) or
        not raisesOverflowError(intExpr(-54) ! intExpr(        23)) or
        not raisesOverflowError(intExpr(-53) ! intExpr(        23)) or
        not raisesOverflowError(intExpr(-52) ! intExpr(        24)) or
        not raisesOverflowError(intExpr(-51) ! intExpr(        24)) or
        not raisesOverflowError(intExpr(-50) ! intExpr(        24)) or
        not raisesOverflowError(intExpr(-49) ! intExpr(        25)) or
        not raisesOverflowError(intExpr(-48) ! intExpr(        25)) or
        not raisesOverflowError(intExpr(-47) ! intExpr(        25)) or
        not raisesOverflowError(intExpr(-46) ! intExpr(        26)) or
        not raisesOverflowError(intExpr(-45) ! intExpr(        26)) or
        not raisesOverflowError(intExpr(-44) ! intExpr(        27)) or
        not raisesOverflowError(intExpr(-43) ! intExpr(        27)) or
        not raisesOverflowError(intExpr(-42) ! intExpr(        28)) or
        not raisesOverflowError(intExpr(-41) ! intExpr(        28)) or
        not raisesOverflowError(intExpr(-40) ! intExpr(        29)) or
        not raisesOverflowError(intExpr(-39) ! intExpr(        30)) or
        not raisesOverflowError(intExpr(-38) ! intExpr(        30)) or
        not raisesOverflowError(intExpr(-37) ! intExpr(        31)) or
        not raisesOverflowError(intExpr(-36) ! intExpr(        32)) or
        not raisesOverflowError(intExpr(-35) ! intExpr(        33)) or
        not raisesOverflowError(intExpr(-34) ! intExpr(        34)) or
        not raisesOverflowError(intExpr(-33) ! intExpr(        35)) or
        not raisesOverflowError(intExpr(-32) ! intExpr(        36)) or
        not raisesOverflowError(intExpr(-31) ! intExpr(        37)) or
        not raisesOverflowError(intExpr(-30) ! intExpr(        39)) or
        not raisesOverflowError(intExpr(-29) ! intExpr(        40)) or
        not raisesOverflowError(intExpr(-28) ! intExpr(        42)) or
        not raisesOverflowError(intExpr(-27) ! intExpr(        44)) or
        not raisesOverflowError(intExpr(-26) ! intExpr(        46)) or
        not raisesOverflowError(intExpr(-25) ! intExpr(        49)) or
        not raisesOverflowError(intExpr(-24) ! intExpr(        52)) or
        not raisesOverflowError(intExpr(-23) ! intExpr(        55)) or
        not raisesOverflowError(intExpr(-22) ! intExpr(        59)) or
        not raisesOverflowError(intExpr(-21) ! intExpr(        64)) or
        not raisesOverflowError(intExpr(-20) ! intExpr(        70)) or
        not raisesOverflowError(intExpr(-19) ! intExpr(        77)) or
        not raisesOverflowError(intExpr(-18) ! intExpr(        85)) or
        not raisesOverflowError(intExpr(-17) ! intExpr(        96)) or
        not raisesOverflowError(intExpr(-16) ! intExpr(       111)) or
        not raisesOverflowError(intExpr(-15) ! intExpr(       130)) or
        not raisesOverflowError(intExpr(-14) ! intExpr(       157)) or
        not raisesOverflowError(intExpr(-13) ! intExpr(       195)) or
        not raisesOverflowError(intExpr(-12) ! intExpr(       255)) or
        not raisesOverflowError(intExpr(-11) ! intExpr(       352)) or
        not raisesOverflowError(intExpr(-10) ! intExpr(       526)) or
        not raisesOverflowError(intExpr( -9) ! intExpr(       880)) or
        not raisesOverflowError(intExpr( -8) ! intExpr(      1727)) or
        not raisesOverflowError(intExpr( -7) ! intExpr(      4332)) or
        not raisesOverflowError(intExpr( -6) ! intExpr(     16171)) or
        not raisesOverflowError(intExpr( -5) ! intExpr(    121974)) or
        not raisesOverflowError(intExpr( -4) ! intExpr(   3810777)) or
        not raisesOverflowError(intExpr( -3) ! intExpr(4294967295)) then
      writeln(" ***** Overflow not raised for binomial coefficient with negative n. (4)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(4294967297 !  2) or
        not raisesOverflowError(   3810780 !  3) or
        not raisesOverflowError(    121978 !  4) or
        not raisesOverflowError(     16176 !  5) or
        not raisesOverflowError(      4338 !  6) or
        not raisesOverflowError(      1734 !  7) or
        not raisesOverflowError(       888 !  8) or
        not raisesOverflowError(       535 !  9) or
        not raisesOverflowError(       362 ! 10) or
        not raisesOverflowError(       266 ! 11) or
        not raisesOverflowError(       207 ! 12) or
        not raisesOverflowError(       170 ! 13) or
        not raisesOverflowError(       144 ! 14) or
        not raisesOverflowError(       126 ! 15) or
        not raisesOverflowError(       112 ! 16) or
        not raisesOverflowError(       102 ! 17) or
        not raisesOverflowError(        95 ! 18) or
        not raisesOverflowError(        89 ! 19) or
        not raisesOverflowError(        84 ! 20) or
        not raisesOverflowError(        80 ! 21) or
        not raisesOverflowError(        77 ! 22) or
        not raisesOverflowError(        75 ! 23) or
        not raisesOverflowError(        73 ! 24) or
        not raisesOverflowError(        71 ! 25) or
        not raisesOverflowError(        70 ! 26) or
        not raisesOverflowError(        69 ! 27) or
        not raisesOverflowError(        68 ! 28) or
        not raisesOverflowError(        68 ! 29) or
        not raisesOverflowError(        67 ! 30) or
        not raisesOverflowError(        67 ! 31) or
        not raisesOverflowError(        67 ! 32) or
        not raisesOverflowError(        67 ! 33) or
        not raisesOverflowError(        67 ! 34) or
        not raisesOverflowError(        67 ! 35) or
        not raisesOverflowError(        67 ! 36) or
        not raisesOverflowError(        67 ! 37) or
        not raisesOverflowError(        68 ! 38) or
        not raisesOverflowError(        68 ! 39) or
        not raisesOverflowError(        68 ! 40) or
        not raisesOverflowError(        69 ! 41) or
        not raisesOverflowError(        69 ! 42) or
        not raisesOverflowError(        70 ! 43) or
        not raisesOverflowError(        70 ! 44) or
        not raisesOverflowError(        71 ! 45) or
        not raisesOverflowError(        71 ! 46) or
        not raisesOverflowError(        72 ! 47) or
        not raisesOverflowError(        73 ! 48) or
        not raisesOverflowError(        73 ! 49) or
        not raisesOverflowError(        74 ! 50) or
        not raisesOverflowError(        75 ! 51) or
        not raisesOverflowError(        75 ! 52) or
        not raisesOverflowError(        76 ! 53) or
        not raisesOverflowError(        77 ! 54) or
        not raisesOverflowError(        77 ! 55) or
        not raisesOverflowError(        78 ! 56) or
        not raisesOverflowError(        79 ! 57) or
        not raisesOverflowError(        80 ! 58) or
        not raisesOverflowError(        80 ! 59) or
        not raisesOverflowError(        81 ! 60) or
        not raisesOverflowError(        82 ! 61) or
        not raisesOverflowError(        83 ! 62) or
        not raisesOverflowError(        84 ! 63) or
        not raisesOverflowError(        84 ! 64) or
        not raisesOverflowError(        85 ! 65) or
        not raisesOverflowError(        86 ! 66) or
        not raisesOverflowError(        87 ! 67) or
        not raisesOverflowError(        88 ! 68) or
        not raisesOverflowError(        89 ! 69) or
        not raisesOverflowError(        89 ! 70) or
        not raisesOverflowError(        90 ! 71) or
        not raisesOverflowError(        91 ! 72) or
        not raisesOverflowError(        92 ! 73) or
        not raisesOverflowError(        93 ! 74) or
        not raisesOverflowError(        94 ! 75) or
        not raisesOverflowError(        95 ! 76) or
        not raisesOverflowError(        95 ! 77) or
        not raisesOverflowError(        96 ! 78) or
        not raisesOverflowError(        97 ! 79) or
        not raisesOverflowError(        98 ! 80) or
        not raisesOverflowError(        99 ! 81) or
        not raisesOverflowError(       100 ! 82) or
        not raisesOverflowError(       101 ! 83) or
        not raisesOverflowError(       102 ! 84) or
        not raisesOverflowError(       102 ! 85) or
        not raisesOverflowError(       103 ! 86) or
        not raisesOverflowError(       104 ! 87) or
        not raisesOverflowError(       105 ! 88) or
        not raisesOverflowError(       106 ! 89) or
        not raisesOverflowError(       107 ! 90) or
        not raisesOverflowError(       108 ! 91) or
        not raisesOverflowError(       109 ! 92) or
        not raisesOverflowError(       110 ! 93) or
        not raisesOverflowError(       111 ! 94) or
        not raisesOverflowError(       112 ! 95) or
        not raisesOverflowError(       113 ! 96) or
        not raisesOverflowError(       113 ! 97) or
        not raisesOverflowError(       114 ! 98) or
        not raisesOverflowError(       115 ! 99) then
      writeln(" ***** Overflow not raised for binomial coefficient with positive n. (1)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(4294967297) !  2) or
        not raisesOverflowError(intExpr(   3810780) !  3) or
        not raisesOverflowError(intExpr(    121978) !  4) or
        not raisesOverflowError(intExpr(     16176) !  5) or
        not raisesOverflowError(intExpr(      4338) !  6) or
        not raisesOverflowError(intExpr(      1734) !  7) or
        not raisesOverflowError(intExpr(       888) !  8) or
        not raisesOverflowError(intExpr(       535) !  9) or
        not raisesOverflowError(intExpr(       362) ! 10) or
        not raisesOverflowError(intExpr(       266) ! 11) or
        not raisesOverflowError(intExpr(       207) ! 12) or
        not raisesOverflowError(intExpr(       170) ! 13) or
        not raisesOverflowError(intExpr(       144) ! 14) or
        not raisesOverflowError(intExpr(       126) ! 15) or
        not raisesOverflowError(intExpr(       112) ! 16) or
        not raisesOverflowError(intExpr(       102) ! 17) or
        not raisesOverflowError(intExpr(        95) ! 18) or
        not raisesOverflowError(intExpr(        89) ! 19) or
        not raisesOverflowError(intExpr(        84) ! 20) or
        not raisesOverflowError(intExpr(        80) ! 21) or
        not raisesOverflowError(intExpr(        77) ! 22) or
        not raisesOverflowError(intExpr(        75) ! 23) or
        not raisesOverflowError(intExpr(        73) ! 24) or
        not raisesOverflowError(intExpr(        71) ! 25) or
        not raisesOverflowError(intExpr(        70) ! 26) or
        not raisesOverflowError(intExpr(        69) ! 27) or
        not raisesOverflowError(intExpr(        68) ! 28) or
        not raisesOverflowError(intExpr(        68) ! 29) or
        not raisesOverflowError(intExpr(        67) ! 30) or
        not raisesOverflowError(intExpr(        67) ! 31) or
        not raisesOverflowError(intExpr(        67) ! 32) or
        not raisesOverflowError(intExpr(        67) ! 33) or
        not raisesOverflowError(intExpr(        67) ! 34) or
        not raisesOverflowError(intExpr(        67) ! 35) or
        not raisesOverflowError(intExpr(        67) ! 36) or
        not raisesOverflowError(intExpr(        67) ! 37) or
        not raisesOverflowError(intExpr(        68) ! 38) or
        not raisesOverflowError(intExpr(        68) ! 39) or
        not raisesOverflowError(intExpr(        68) ! 40) or
        not raisesOverflowError(intExpr(        69) ! 41) or
        not raisesOverflowError(intExpr(        69) ! 42) or
        not raisesOverflowError(intExpr(        70) ! 43) or
        not raisesOverflowError(intExpr(        70) ! 44) or
        not raisesOverflowError(intExpr(        71) ! 45) or
        not raisesOverflowError(intExpr(        71) ! 46) or
        not raisesOverflowError(intExpr(        72) ! 47) or
        not raisesOverflowError(intExpr(        73) ! 48) or
        not raisesOverflowError(intExpr(        73) ! 49) or
        not raisesOverflowError(intExpr(        74) ! 50) or
        not raisesOverflowError(intExpr(        75) ! 51) or
        not raisesOverflowError(intExpr(        75) ! 52) or
        not raisesOverflowError(intExpr(        76) ! 53) or
        not raisesOverflowError(intExpr(        77) ! 54) or
        not raisesOverflowError(intExpr(        77) ! 55) or
        not raisesOverflowError(intExpr(        78) ! 56) or
        not raisesOverflowError(intExpr(        79) ! 57) or
        not raisesOverflowError(intExpr(        80) ! 58) or
        not raisesOverflowError(intExpr(        80) ! 59) or
        not raisesOverflowError(intExpr(        81) ! 60) or
        not raisesOverflowError(intExpr(        82) ! 61) or
        not raisesOverflowError(intExpr(        83) ! 62) or
        not raisesOverflowError(intExpr(        84) ! 63) or
        not raisesOverflowError(intExpr(        84) ! 64) or
        not raisesOverflowError(intExpr(        85) ! 65) or
        not raisesOverflowError(intExpr(        86) ! 66) or
        not raisesOverflowError(intExpr(        87) ! 67) or
        not raisesOverflowError(intExpr(        88) ! 68) or
        not raisesOverflowError(intExpr(        89) ! 69) or
        not raisesOverflowError(intExpr(        89) ! 70) or
        not raisesOverflowError(intExpr(        90) ! 71) or
        not raisesOverflowError(intExpr(        91) ! 72) or
        not raisesOverflowError(intExpr(        92) ! 73) or
        not raisesOverflowError(intExpr(        93) ! 74) or
        not raisesOverflowError(intExpr(        94) ! 75) or
        not raisesOverflowError(intExpr(        95) ! 76) or
        not raisesOverflowError(intExpr(        95) ! 77) or
        not raisesOverflowError(intExpr(        96) ! 78) or
        not raisesOverflowError(intExpr(        97) ! 79) or
        not raisesOverflowError(intExpr(        98) ! 80) or
        not raisesOverflowError(intExpr(        99) ! 81) or
        not raisesOverflowError(intExpr(       100) ! 82) or
        not raisesOverflowError(intExpr(       101) ! 83) or
        not raisesOverflowError(intExpr(       102) ! 84) or
        not raisesOverflowError(intExpr(       102) ! 85) or
        not raisesOverflowError(intExpr(       103) ! 86) or
        not raisesOverflowError(intExpr(       104) ! 87) or
        not raisesOverflowError(intExpr(       105) ! 88) or
        not raisesOverflowError(intExpr(       106) ! 89) or
        not raisesOverflowError(intExpr(       107) ! 90) or
        not raisesOverflowError(intExpr(       108) ! 91) or
        not raisesOverflowError(intExpr(       109) ! 92) or
        not raisesOverflowError(intExpr(       110) ! 93) or
        not raisesOverflowError(intExpr(       111) ! 94) or
        not raisesOverflowError(intExpr(       112) ! 95) or
        not raisesOverflowError(intExpr(       113) ! 96) or
        not raisesOverflowError(intExpr(       113) ! 97) or
        not raisesOverflowError(intExpr(       114) ! 98) or
        not raisesOverflowError(intExpr(       115) ! 99) then
      writeln(" ***** Overflow not raised for binomial coefficient with positive n. (2)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(4294967297 ! intExpr( 2)) or
        not raisesOverflowError(   3810780 ! intExpr( 3)) or
        not raisesOverflowError(    121978 ! intExpr( 4)) or
        not raisesOverflowError(     16176 ! intExpr( 5)) or
        not raisesOverflowError(      4338 ! intExpr( 6)) or
        not raisesOverflowError(      1734 ! intExpr( 7)) or
        not raisesOverflowError(       888 ! intExpr( 8)) or
        not raisesOverflowError(       535 ! intExpr( 9)) or
        not raisesOverflowError(       362 ! intExpr(10)) or
        not raisesOverflowError(       266 ! intExpr(11)) or
        not raisesOverflowError(       207 ! intExpr(12)) or
        not raisesOverflowError(       170 ! intExpr(13)) or
        not raisesOverflowError(       144 ! intExpr(14)) or
        not raisesOverflowError(       126 ! intExpr(15)) or
        not raisesOverflowError(       112 ! intExpr(16)) or
        not raisesOverflowError(       102 ! intExpr(17)) or
        not raisesOverflowError(        95 ! intExpr(18)) or
        not raisesOverflowError(        89 ! intExpr(19)) or
        not raisesOverflowError(        84 ! intExpr(20)) or
        not raisesOverflowError(        80 ! intExpr(21)) or
        not raisesOverflowError(        77 ! intExpr(22)) or
        not raisesOverflowError(        75 ! intExpr(23)) or
        not raisesOverflowError(        73 ! intExpr(24)) or
        not raisesOverflowError(        71 ! intExpr(25)) or
        not raisesOverflowError(        70 ! intExpr(26)) or
        not raisesOverflowError(        69 ! intExpr(27)) or
        not raisesOverflowError(        68 ! intExpr(28)) or
        not raisesOverflowError(        68 ! intExpr(29)) or
        not raisesOverflowError(        67 ! intExpr(30)) or
        not raisesOverflowError(        67 ! intExpr(31)) or
        not raisesOverflowError(        67 ! intExpr(32)) or
        not raisesOverflowError(        67 ! intExpr(33)) or
        not raisesOverflowError(        67 ! intExpr(34)) or
        not raisesOverflowError(        67 ! intExpr(35)) or
        not raisesOverflowError(        67 ! intExpr(36)) or
        not raisesOverflowError(        67 ! intExpr(37)) or
        not raisesOverflowError(        68 ! intExpr(38)) or
        not raisesOverflowError(        68 ! intExpr(39)) or
        not raisesOverflowError(        68 ! intExpr(40)) or
        not raisesOverflowError(        69 ! intExpr(41)) or
        not raisesOverflowError(        69 ! intExpr(42)) or
        not raisesOverflowError(        70 ! intExpr(43)) or
        not raisesOverflowError(        70 ! intExpr(44)) or
        not raisesOverflowError(        71 ! intExpr(45)) or
        not raisesOverflowError(        71 ! intExpr(46)) or
        not raisesOverflowError(        72 ! intExpr(47)) or
        not raisesOverflowError(        73 ! intExpr(48)) or
        not raisesOverflowError(        73 ! intExpr(49)) or
        not raisesOverflowError(        74 ! intExpr(50)) or
        not raisesOverflowError(        75 ! intExpr(51)) or
        not raisesOverflowError(        75 ! intExpr(52)) or
        not raisesOverflowError(        76 ! intExpr(53)) or
        not raisesOverflowError(        77 ! intExpr(54)) or
        not raisesOverflowError(        77 ! intExpr(55)) or
        not raisesOverflowError(        78 ! intExpr(56)) or
        not raisesOverflowError(        79 ! intExpr(57)) or
        not raisesOverflowError(        80 ! intExpr(58)) or
        not raisesOverflowError(        80 ! intExpr(59)) or
        not raisesOverflowError(        81 ! intExpr(60)) or
        not raisesOverflowError(        82 ! intExpr(61)) or
        not raisesOverflowError(        83 ! intExpr(62)) or
        not raisesOverflowError(        84 ! intExpr(63)) or
        not raisesOverflowError(        84 ! intExpr(64)) or
        not raisesOverflowError(        85 ! intExpr(65)) or
        not raisesOverflowError(        86 ! intExpr(66)) or
        not raisesOverflowError(        87 ! intExpr(67)) or
        not raisesOverflowError(        88 ! intExpr(68)) or
        not raisesOverflowError(        89 ! intExpr(69)) or
        not raisesOverflowError(        89 ! intExpr(70)) or
        not raisesOverflowError(        90 ! intExpr(71)) or
        not raisesOverflowError(        91 ! intExpr(72)) or
        not raisesOverflowError(        92 ! intExpr(73)) or
        not raisesOverflowError(        93 ! intExpr(74)) or
        not raisesOverflowError(        94 ! intExpr(75)) or
        not raisesOverflowError(        95 ! intExpr(76)) or
        not raisesOverflowError(        95 ! intExpr(77)) or
        not raisesOverflowError(        96 ! intExpr(78)) or
        not raisesOverflowError(        97 ! intExpr(79)) or
        not raisesOverflowError(        98 ! intExpr(80)) or
        not raisesOverflowError(        99 ! intExpr(81)) or
        not raisesOverflowError(       100 ! intExpr(82)) or
        not raisesOverflowError(       101 ! intExpr(83)) or
        not raisesOverflowError(       102 ! intExpr(84)) or
        not raisesOverflowError(       102 ! intExpr(85)) or
        not raisesOverflowError(       103 ! intExpr(86)) or
        not raisesOverflowError(       104 ! intExpr(87)) or
        not raisesOverflowError(       105 ! intExpr(88)) or
        not raisesOverflowError(       106 ! intExpr(89)) or
        not raisesOverflowError(       107 ! intExpr(90)) or
        not raisesOverflowError(       108 ! intExpr(91)) or
        not raisesOverflowError(       109 ! intExpr(92)) or
        not raisesOverflowError(       110 ! intExpr(93)) or
        not raisesOverflowError(       111 ! intExpr(94)) or
        not raisesOverflowError(       112 ! intExpr(95)) or
        not raisesOverflowError(       113 ! intExpr(96)) or
        not raisesOverflowError(       113 ! intExpr(97)) or
        not raisesOverflowError(       114 ! intExpr(98)) or
        not raisesOverflowError(       115 ! intExpr(99)) then
      writeln(" ***** Overflow not raised for binomial coefficient with positive n. (3)");
      okay := FALSE;
    end if;

    if  not raisesOverflowError(intExpr(4294967297) ! intExpr( 2)) or
        not raisesOverflowError(intExpr(   3810780) ! intExpr( 3)) or
        not raisesOverflowError(intExpr(    121978) ! intExpr( 4)) or
        not raisesOverflowError(intExpr(     16176) ! intExpr( 5)) or
        not raisesOverflowError(intExpr(      4338) ! intExpr( 6)) or
        not raisesOverflowError(intExpr(      1734) ! intExpr( 7)) or
        not raisesOverflowError(intExpr(       888) ! intExpr( 8)) or
        not raisesOverflowError(intExpr(       535) ! intExpr( 9)) or
        not raisesOverflowError(intExpr(       362) ! intExpr(10)) or
        not raisesOverflowError(intExpr(       266) ! intExpr(11)) or
        not raisesOverflowError(intExpr(       207) ! intExpr(12)) or
        not raisesOverflowError(intExpr(       170) ! intExpr(13)) or
        not raisesOverflowError(intExpr(       144) ! intExpr(14)) or
        not raisesOverflowError(intExpr(       126) ! intExpr(15)) or
        not raisesOverflowError(intExpr(       112) ! intExpr(16)) or
        not raisesOverflowError(intExpr(       102) ! intExpr(17)) or
        not raisesOverflowError(intExpr(        95) ! intExpr(18)) or
        not raisesOverflowError(intExpr(        89) ! intExpr(19)) or
        not raisesOverflowError(intExpr(        84) ! intExpr(20)) or
        not raisesOverflowError(intExpr(        80) ! intExpr(21)) or
        not raisesOverflowError(intExpr(        77) ! intExpr(22)) or
        not raisesOverflowError(intExpr(        75) ! intExpr(23)) or
        not raisesOverflowError(intExpr(        73) ! intExpr(24)) or
        not raisesOverflowError(intExpr(        71) ! intExpr(25)) or
        not raisesOverflowError(intExpr(        70) ! intExpr(26)) or
        not raisesOverflowError(intExpr(        69) ! intExpr(27)) or
        not raisesOverflowError(intExpr(        68) ! intExpr(28)) or
        not raisesOverflowError(intExpr(        68) ! intExpr(29)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(30)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(31)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(32)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(33)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(34)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(35)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(36)) or
        not raisesOverflowError(intExpr(        67) ! intExpr(37)) or
        not raisesOverflowError(intExpr(        68) ! intExpr(38)) or
        not raisesOverflowError(intExpr(        68) ! intExpr(39)) or
        not raisesOverflowError(intExpr(        68) ! intExpr(40)) or
        not raisesOverflowError(intExpr(        69) ! intExpr(41)) or
        not raisesOverflowError(intExpr(        69) ! intExpr(42)) or
        not raisesOverflowError(intExpr(        70) ! intExpr(43)) or
        not raisesOverflowError(intExpr(        70) ! intExpr(44)) or
        not raisesOverflowError(intExpr(        71) ! intExpr(45)) or
        not raisesOverflowError(intExpr(        71) ! intExpr(46)) or
        not raisesOverflowError(intExpr(        72) ! intExpr(47)) or
        not raisesOverflowError(intExpr(        73) ! intExpr(48)) or
        not raisesOverflowError(intExpr(        73) ! intExpr(49)) or
        not raisesOverflowError(intExpr(        74) ! intExpr(50)) or
        not raisesOverflowError(intExpr(        75) ! intExpr(51)) or
        not raisesOverflowError(intExpr(        75) ! intExpr(52)) or
        not raisesOverflowError(intExpr(        76) ! intExpr(53)) or
        not raisesOverflowError(intExpr(        77) ! intExpr(54)) or
        not raisesOverflowError(intExpr(        77) ! intExpr(55)) or
        not raisesOverflowError(intExpr(        78) ! intExpr(56)) or
        not raisesOverflowError(intExpr(        79) ! intExpr(57)) or
        not raisesOverflowError(intExpr(        80) ! intExpr(58)) or
        not raisesOverflowError(intExpr(        80) ! intExpr(59)) or
        not raisesOverflowError(intExpr(        81) ! intExpr(60)) or
        not raisesOverflowError(intExpr(        82) ! intExpr(61)) or
        not raisesOverflowError(intExpr(        83) ! intExpr(62)) or
        not raisesOverflowError(intExpr(        84) ! intExpr(63)) or
        not raisesOverflowError(intExpr(        84) ! intExpr(64)) or
        not raisesOverflowError(intExpr(        85) ! intExpr(65)) or
        not raisesOverflowError(intExpr(        86) ! intExpr(66)) or
        not raisesOverflowError(intExpr(        87) ! intExpr(67)) or
        not raisesOverflowError(intExpr(        88) ! intExpr(68)) or
        not raisesOverflowError(intExpr(        89) ! intExpr(69)) or
        not raisesOverflowError(intExpr(        89) ! intExpr(70)) or
        not raisesOverflowError(intExpr(        90) ! intExpr(71)) or
        not raisesOverflowError(intExpr(        91) ! intExpr(72)) or
        not raisesOverflowError(intExpr(        92) ! intExpr(73)) or
        not raisesOverflowError(intExpr(        93) ! intExpr(74)) or
        not raisesOverflowError(intExpr(        94) ! intExpr(75)) or
        not raisesOverflowError(intExpr(        95) ! intExpr(76)) or
        not raisesOverflowError(intExpr(        95) ! intExpr(77)) or
        not raisesOverflowError(intExpr(        96) ! intExpr(78)) or
        not raisesOverflowError(intExpr(        97) ! intExpr(79)) or
        not raisesOverflowError(intExpr(        98) ! intExpr(80)) or
        not raisesOverflowError(intExpr(        99) ! intExpr(81)) or
        not raisesOverflowError(intExpr(       100) ! intExpr(82)) or
        not raisesOverflowError(intExpr(       101) ! intExpr(83)) or
        not raisesOverflowError(intExpr(       102) ! intExpr(84)) or
        not raisesOverflowError(intExpr(       102) ! intExpr(85)) or
        not raisesOverflowError(intExpr(       103) ! intExpr(86)) or
        not raisesOverflowError(intExpr(       104) ! intExpr(87)) or
        not raisesOverflowError(intExpr(       105) ! intExpr(88)) or
        not raisesOverflowError(intExpr(       106) ! intExpr(89)) or
        not raisesOverflowError(intExpr(       107) ! intExpr(90)) or
        not raisesOverflowError(intExpr(       108) ! intExpr(91)) or
        not raisesOverflowError(intExpr(       109) ! intExpr(92)) or
        not raisesOverflowError(intExpr(       110) ! intExpr(93)) or
        not raisesOverflowError(intExpr(       111) ! intExpr(94)) or
        not raisesOverflowError(intExpr(       112) ! intExpr(95)) or
        not raisesOverflowError(intExpr(       113) ! intExpr(96)) or
        not raisesOverflowError(intExpr(       113) ! intExpr(97)) or
        not raisesOverflowError(intExpr(       114) ! intExpr(98)) or
        not raisesOverflowError(intExpr(       115) ! intExpr(99)) then
      writeln(" ***** Overflow not raised for binomial coefficient with positive n. (4)");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of binomial coefficient works correct.");
    else
      writeln(" ***** Overflow checking of binomial coefficient does not work correct.");
    end if;
  end func;


const proc: check_abs is func
  local
    var boolean: okay is TRUE;
  begin
    if  not raisesOverflowError(abs(                      INT64_MIN))   or
        not raisesOverflowError(abs(intExpr(              INT64_MIN)))  or
        not raisesOverflowError(abs(        (-9223372036854775807-1)))  or
        not raisesOverflowError(abs(intExpr((-9223372036854775807-1)))) then
      writeln(" ***** Overflow when computing abs(-9223372036854775808) does not work correct.");
      okay := FALSE;
    end if;

    if okay then
      writeln("Overflow checking of abs works correct.");
    else
      writeln(" ***** Overflow checking of abs does not work correct.");
    end if;
  end func;


const proc: main is func

  begin
    writeln;
    check_negation;
    check_add;
    check_add_assign;
    check_subtract;
    check_subtract_assign;
    check_succ;
    check_pred;
    check_incr;
    check_decr;
    check_mult;
    check_mult_assign;
    check_div;
    check_rem;
    check_mdiv;
    check_mod;
    check_lShift;
    check_lShift_assign;
    check_rShift;
    check_rShift_assign;
    check_ulShift;
    check_ulShift_assign;
    check_urShift;
    check_urShift_assign;
    check_power;
    check_binom;
    check_abs;
  end func;
