File: parameter_array_ref_2.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A12.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 959,712 kB
  • sloc: cpp: 3,275,382; ansic: 2,061,766; ada: 840,956; f90: 208,513; makefile: 76,132; asm: 73,433; xml: 50,448; exp: 34,146; sh: 32,436; objc: 15,637; fortran: 14,012; python: 11,991; pascal: 6,787; awk: 4,779; perl: 3,054; yacc: 338; ml: 285; lex: 201; haskell: 122
file content (39 lines) | stat: -rw-r--r-- 1,879 bytes parent folder | download | duplicates (6)
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
38
39
! { dg-do compile }
! Test the fix for the problems in PR41044
!
! Contributed by <ros@rzg.mpg.de>
! Reduced by Joos VandeVondele <jv244@cam.ac.uk>
!
  Subroutine PS_INIT (bkgd, punit, pform, psize, rot90, bbox, clip, eps,  &
                        caller)
    type psfd                          ! paper size and frame defaults
      character(3)                     :: n
      real                             :: p(2)
      real                             :: f(4)
    end type psfd
    character(4)                       :: fn, orich, pfmt
    type(psfd), parameter              :: pfd(0:11)=(/  &
         psfd('   ',(/   0.0,   0.0/),(/200.,120.,800.,560./)), &    ! A0_L
         psfd('A0 ',(/ 840.9,1189.2/),(/140., 84.,560.,400./)), &    ! A0_P
         psfd('A1 ',(/ 594.6, 840.9/),(/100., 60.,400.,280./)), &    ! A1_P
         psfd('A2 ',(/ 420.4, 594.6/),(/ 70., 42.,280.,200./)), &    ! A2_P
         psfd('A3 ',(/ 297.3, 420.4/),(/ 50., 30.,200.,140./)), &    ! A3_P
         psfd('A4 ',(/ 210.2, 297.3/),(/ 35., 21.,140.,100./)), &    ! A4_P
         psfd('A5 ',(/ 148.7, 210.2/),(/ 25., 15.,100., 70./)), &    ! A5_P
         psfd('A6 ',(/ 105.1, 148.7/),(/ 18., 11., 70., 50./)), &    ! A6_P
         psfd('   ',(/   0.0,   0.0/),(/ 50., 30.,200.,140./)), &    ! Letter_L
         psfd('LET',(/ 215.9, 279.4/),(/ 35., 21.,140.,100./)), &    ! Letter_P
         psfd('   ',(/   0.0,   0.0/),(/ 50., 30.,200.,140./)), &    ! Legal_L
         psfd('LEG',(/ 215.9, 355.6/),(/ 35., 21.,140.,100./))/)     ! Legal_P
    if (len_trim(pfmt) > 0) then       ! set paper format
      idx=sum(maxloc(index(pfd%n,pfmt(1:3))))-1
    end if
  end subroutine PS_INIT

! This, additional problem, was posted as comment #8 by Tobias Burnus <burnus@gcc.gnu.org>
  type t
    integer :: i
  end type t
  type(t), parameter :: a(1) = t(4) ! [t(4)] worked OK
  real(a(1)%i) :: b
end