| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-Og -Wuninitialized -Wmaybe-uninitialized -fdump-tree-optimized" } |
| 3 |
! |
| 4 |
! PR fortran/115700 - Bogus warning for associate with assumed-length character array |
| 5 |
! This testcase checks for the suppression of the bogus error and associate_70 for |
| 6 |
! correct results. |
| 7 |
! |
| 8 |
subroutine mvce(x) |
| 9 |
implicit none |
| 10 |
character(len=*), dimension(:), intent(in) :: x |
| 11 |
integer :: i |
| 12 |
i = len(x) |
| 13 |
|
| 14 |
associate (tmp1 => x) |
| 15 |
if (len (tmp1) /= len (x)) stop 1 |
| 16 |
end associate |
| 17 |
|
| 18 |
associate (tmp2 => x(1:)) |
| 19 |
if (len (tmp2) /= len (x)) stop 2 |
| 20 |
end associate |
| 21 |
|
| 22 |
associate (tmp3 => x(1:)(:)) |
| 23 |
if (len (tmp3) /= len (x)) stop 3 |
| 24 |
end associate |
| 25 |
|
| 26 |
associate (tmp4 => x(:)(1:)) |
| 27 |
if (len (tmp4) /= len (x)) stop 4 |
| 28 |
end associate |
| 29 |
|
| 30 |
associate (tmp5 => x(1:)(1:)) |
| 31 |
if (len (tmp5) /= len (x)) stop 5 |
| 32 |
end associate |
| 33 |
end |
| 34 |
|
| 35 |
! { dg-final { scan-tree-dump-not " \\.tmp" "optimized" } } |