summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/no_range_check_1.f9016
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/no_range_check_1.f90 b/gcc/testsuite/gfortran.dg/no_range_check_1.f90
new file mode 100644
index 00000000000..36890866e3a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/no_range_check_1.f90
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-options "-fno-range-check -O0" }
+!
+! This testcase arose from PR 31262
+ integer :: a
+ integer(kind=8) :: b
+ a = -3
+ b = -huge(b) / 7
+ a = a ** 73
+ b = 7894_8 * b - 78941_8
+ if ((-3)**73 /= a) call abort
+ if (7894_8 * (-huge(b) / 7) - 78941_8 /= b) call abort
+
+ a = 1234789786453123
+ if (a - 1234789786453123 /= a - (-426244989)) call abort
+ end