File: use_rename_13.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (37 lines) | stat: -rw-r--r-- 977 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
! { dg-do compile }
!
! Test the fix for pr79685, which failed as in the comments below.
!
! Contributed by Juergen Reuter  <juergen.reuter@desy.de>
!
module omega_color
  implicit none

  type omega_color_factor
     integer :: i
  end type

  type(omega_color_factor), parameter :: op = omega_color_factor (199)

end module

module foo
  use omega_color, ocf => omega_color_factor, ocfp => op
  implicit none

  type(ocf) :: table_color_factors1 = ocf(42)
  type(ocf) :: table_color_factors2
  type(ocf) :: table_color_factors3 (2)
  type(ocf) :: table_color_factors4
  data table_color_factors2 / ocf(99) /        ! This failed in gfc_match_structure_constructor.
  data table_color_factors3 / ocf(1), ocf(2) / ! ditto.
  data table_color_factors4 / ocfp /
end module

  use foo
  if (table_color_factors1%i .ne. 42) stop 1
  if (table_color_factors2%i .ne. 99) stop 2
  if (any (table_color_factors3%i .ne. [1,2])) stop 3
  if (table_color_factors4%i .ne. 199) stop 4
end