aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gfortran.dg/select_5.f90
blob: 9afc1603ba2cb33a3007f9ad0e44eec7a3bd3135 (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
! { dg-do run }
! Test mismatched type kinds in a select statement.
program select_5
  integer(kind=1) i          ! kind = 1, -128 <= i < 127
  do i = 1, 3
    select case (i)

    ! kind = 4, reachable
    case (1_4)
      if (i /=  1_4) call abort

    ! kind = 8, reachable
    case (2_8)
      if (i /= 2_8) call abort

    ! kind = 4, unreachable because of range of i
    case (200)                       ! { dg-warning "not in the range" }
      call abort

    case default
      if (i /= 3) call abort
    end select
  end do
end program select_5