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