gcc/testsuite/gfortran.dg/select_5.f90
raw| 1 | ! { dg-do run } |
| 2 | ! Test mismatched type kinds in a select statement. |
| 3 | program select_5 |
| 4 | integer(kind=1) i ! kind = 1, -128 <= i < 127 |
| 5 | do i = 1, 3 |
| 6 | select case (i) |
| 7 | |
| 8 | ! kind = 4, reachable |
| 9 | case (1_4) |
| 10 | if (i /= 1_4) STOP 1 |
| 11 | |
| 12 | ! kind = 8, reachable |
| 13 | case (2_8) |
| 14 | if (i /= 2_8) STOP 2 |
| 15 | |
| 16 | ! kind = 4, unreachable because of range of i |
| 17 | case (200) ! { dg-warning "not in the range" } |
| 18 | STOP 3 |
| 19 | |
| 20 | case default |
| 21 | if (i /= 3) STOP 4 |
| 22 | end select |
| 23 | end do |
| 24 | end program select_5 |