URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
694 |
jeremybenn |
! { dg-do run }
|
2 |
|
|
! Check that maxval uses for integers HUGE()-1.
|
3 |
|
|
! PR fortran/30512
|
4 |
|
|
|
5 |
|
|
program main
|
6 |
|
|
implicit none
|
7 |
|
|
integer(1) :: i1(3), a1(3:2)
|
8 |
|
|
integer(2) :: i2(3), a2(3:2)
|
9 |
|
|
integer(4) :: i4(3), a4(3:2)
|
10 |
|
|
integer(8) :: i8(3), a8(3:2)
|
11 |
|
|
|
12 |
|
|
integer(kind=4), allocatable :: a(:,:)
|
13 |
|
|
integer(kind=8), allocatable :: b(:,:)
|
14 |
|
|
|
15 |
|
|
logical :: msk(3)
|
16 |
|
|
msk = .false.
|
17 |
|
|
|
18 |
|
|
i1 = 1
|
19 |
|
|
i2 = 1
|
20 |
|
|
i4 = 1
|
21 |
|
|
i8 = 1
|
22 |
|
|
|
23 |
|
|
if(-huge(i1)-1_1 /= maxval(i1, msk)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
24 |
|
|
if(-huge(a1)-1_1 /= maxval(a1)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
25 |
|
|
|
26 |
|
|
if(-huge(i2)-1_2 /= maxval(i2, msk)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
27 |
|
|
if(-huge(a2)-1_2 /= maxval(a2)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
28 |
|
|
|
29 |
|
|
if(-huge(i4)-1_4 /= maxval(i4, msk)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
30 |
|
|
if(-huge(a4)-1_4 /= maxval(a4)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
31 |
|
|
|
32 |
|
|
if(-huge(i8)-1_4 /= maxval(i8, msk)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
33 |
|
|
if(-huge(a8)-1_4 /= maxval(a8)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
34 |
|
|
|
35 |
|
|
allocate (a(0:-1,1:1))
|
36 |
|
|
allocate (b(0:-1,1:1))
|
37 |
|
|
|
38 |
|
|
if(any(maxval(a,dim=1) /= -huge(a)-1_4)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
39 |
|
|
if(any(minval(a,dim=1) /= huge(a) )) call abort()
|
40 |
|
|
|
41 |
|
|
if(any(maxval(b,dim=1) /= -huge(b)-1_8)) call abort() ! { dg-warning "outside symmetric range implied by Standard Fortran" }
|
42 |
|
|
if(any(minval(b,dim=1) /= huge(b) )) call abort()
|
43 |
|
|
|
44 |
|
|
end program main
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.