gcc/testsuite/gfortran.dg/generic_4.f90
raw| 1 | ! { dg-do run } |
| 2 | ! reduced testcase from PR 17740 |
| 3 | module FOO |
| 4 | |
| 5 | interface BAR |
| 6 | module procedure BAR2 |
| 7 | end interface |
| 8 | |
| 9 | contains |
| 10 | |
| 11 | elemental integer function BAR2(X) |
| 12 | integer, intent(in) :: X |
| 13 | BAR2 = X |
| 14 | end function |
| 15 | |
| 16 | subroutine BAZ(y,z) |
| 17 | integer :: Y(3), Z(3) |
| 18 | Z = BAR(Y) |
| 19 | end subroutine |
| 20 | |
| 21 | end module |
| 22 | |
| 23 | use foo |
| 24 | integer :: y(3), z(3) |
| 25 | y = (/1,2,3/) |
| 26 | call baz(y,z) |
| 27 | if (any (y /= z)) STOP 1 |
| 28 | end |