gcc/testsuite/gfortran.dg/arithmetic_overflow_2.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! { dg-additional-options "-frange-check" } |
| 3 | ! |
| 4 | ! PR fortran/113799 - handle arithmetic overflow on unary minus |
| 5 | |
| 6 | program p |
| 7 | implicit none |
| 8 | real, parameter :: inf = real(z'7F800000') |
| 9 | real, parameter :: someInf(*) = [inf, 0.] |
| 10 | print *, -someInf ! { dg-error "Arithmetic overflow" } |
| 11 | print *, minval(-someInf) ! { dg-error "Arithmetic overflow" } |
| 12 | end |