aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/derived_comp_array_ref_6.f90
blob: c0fb7c86cace0b502486a63f83a333338b130668 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! { dg-do compile }
! Check the fix for PR32129 in which the argument 'vec(vy(i, :))' was
! incorrectly simplified, resulting in an ICE and a missed error.
!
! Reported by Tobias Burnus <burnus@gcc.gnu.org>
!
    MODULE cdf_aux_mod
      TYPE :: the_distribution
        INTEGER :: parameters(1)
      END TYPE the_distribution
      TYPE (the_distribution), PARAMETER :: the_beta = the_distribution((/0/))
    CONTAINS
      SUBROUTINE set_bound(arg_name)
        INTEGER, INTENT (IN) :: arg_name
      END SUBROUTINE set_bound
    END MODULE cdf_aux_mod
    MODULE cdf_beta_mod
    CONTAINS
      SUBROUTINE cdf_beta()
        USE cdf_aux_mod
        INTEGER :: which
          which = 1
          CALL set_bound(the_beta%parameters(1:which)) ! { dg-error "Rank mismatch" }
      END SUBROUTINE cdf_beta
    END MODULE cdf_beta_mod