| 1 |
! { dg-do run } |
| 2 |
! { dg-additional-options "-fdump-tree-original" } |
| 3 |
! PR fortran/106557 - nesting intrinsics ibset and transfer gives wrong result |
| 4 |
|
| 5 |
program p |
| 6 |
implicit none |
| 7 |
character(1) :: s |
| 8 |
|
| 9 |
write(s,'(i1)') ibset (transfer (0, 0), 0) |
| 10 |
if (s /= '1') stop 1 |
| 11 |
write(s,'(i1)') ibclr (transfer (1, 0), 0) |
| 12 |
if (s /= '0') stop 2 |
| 13 |
|
| 14 |
! These shall be fully resolved at compile time: |
| 15 |
if (transfer (ibset (transfer (0, 0), 0), 0) /= 1) stop 3 |
| 16 |
if (transfer (ibclr (transfer (1, 0), 0), 0) /= 0) stop 4 |
| 17 |
end |
| 18 |
|
| 19 |
! { dg-final { scan-tree-dump-times "_gfortran_stop_numeric" 2 "original" } } |