summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/ibits.f90
blob: c817c483281622b5c56b5ae55eaa2bf569008e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do run }
! { dg-options "-fallow-invalid-boz" }
! Test that the mask is properly converted to the kind type of j in ibits.
program ibits_test
  implicit none
  integer(8), parameter :: &
  &  n = z'00000000FFFFFFFF' ! { dg-warning "BOZ literal constant" }
  integer(8) i,j,k,m
  j = 1
  do i=1,70
     j = ishft(j,1) + 1
     k = ibits(j, 0, 32)
     m = iand(j,n)
     if (k /= m) STOP 1
  end do
end program ibits_test