[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / minval_char_2.f90
blob93ea4f6e18ff74b1ce1a06fee7677c873cb10242
1 ! { dg-do run }
2 program main
3 implicit none
4 integer, parameter :: n=5, m=3
5 character(kind=4,len=5), dimension(n) :: a
6 character(kind=4,len=5), dimension(n,m) :: b
7 character(kind=4,len=5) :: res
8 integer, dimension(n,m) :: v
9 real, dimension(n,m) :: r
10 integer :: i,j
11 logical, dimension(n,m) :: mask
12 character(kind=4,len=5), dimension(:,:), allocatable :: empty
13 integer(kind=4), dimension(5) :: kmin = [-1, -1, -1, -1, -1]
14 character(kind=4,len=5) :: all_full
15 logical :: smask
17 all_full = transfer(kmin,all_full)
18 write (unit=a,fmt='(I5.5)') (21-i*i+6*i,i=1,n)
19 res = minval(a)
20 if (res /= 4_'00026') call abort
22 call random_number(r)
23 v = int(r * 100)
24 if (count(v<30) > 1) exit
25 end do
26 write (unit=b,fmt='(I5.5)') v
27 write (unit=res,fmt='(I5.5)') minval(v)
28 if (res /= minval(b)) call abort
29 smask = .true.
30 if (res /= minval(b, smask)) call abort
31 smask = .false.
32 if (all_full /= minval(b, smask)) call abort
34 mask = v < 30
35 write (unit=res,fmt='(I5.5)') minval(v,mask)
36 if (res /= minval(b, mask)) call abort
37 mask = .false.
38 if (minval(b, mask) /= all_full) call abort
39 allocate (empty(0:3,0))
40 res = minval(empty)
41 if (res /= all_full) call abort
42 end program main