| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! Test the fix for pr79685, which failed as in the comments below. |
| 4 |
! |
| 5 |
! Contributed by Juergen Reuter <[email protected]> |
| 6 |
! |
| 7 |
module omega_color |
| 8 |
implicit none |
| 9 |
|
| 10 |
type omega_color_factor |
| 11 |
integer :: i |
| 12 |
end type |
| 13 |
|
| 14 |
type(omega_color_factor), parameter :: op = omega_color_factor (199) |
| 15 |
|
| 16 |
end module |
| 17 |
|
| 18 |
module foo |
| 19 |
use omega_color, ocf => omega_color_factor, ocfp => op |
| 20 |
implicit none |
| 21 |
|
| 22 |
type(ocf) :: table_color_factors1 = ocf(42) |
| 23 |
type(ocf) :: table_color_factors2 |
| 24 |
type(ocf) :: table_color_factors3 (2) |
| 25 |
type(ocf) :: table_color_factors4 |
| 26 |
data table_color_factors2 / ocf(99) / ! This failed in gfc_match_structure_constructor. |
| 27 |
data table_color_factors3 / ocf(1), ocf(2) / ! ditto. |
| 28 |
data table_color_factors4 / ocfp / |
| 29 |
end module |
| 30 |
|
| 31 |
use foo |
| 32 |
if (table_color_factors1%i .ne. 42) stop 1 |
| 33 |
if (table_color_factors2%i .ne. 99) stop 2 |
| 34 |
if (any (table_color_factors3%i .ne. [1,2])) stop 3 |
| 35 |
if (table_color_factors4%i .ne. 199) stop 4 |
| 36 |
end |
| 37 |
|