File: derived_constructor_char_1.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 (49 lines) | stat: -rw-r--r-- 1,650 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
! { dg-do compile }
! { dg-options "-fdump-tree-original" }
!
! PR fortran/44857
!
!
  Type :: t5
    character (len=5) :: txt(2)
  End Type t5

  character (len=3), parameter :: str3(2) = [ "ABC", "ZYX" ]
  character (len=5), parameter :: str5(2) = [ "AbCdE", "ZyXwV" ]
  character (len=5), parameter :: str7(2) = [ "aBcDeFg", "zYxWvUt" ]

  Type (t5) :: one   = t5((/ "12345", "67890" /))
  Type (t5) :: two   = t5((/ "123", "678" /))
  Type (t5) :: three = t5((/ "1234567", "abcdefg" /))
  Type (t5) :: four  = t5(str3)
  Type (t5) :: five  = t5(str5)
  Type (t5) :: six  = t5(str7)
  print '(2a)', one, two, three, four, five, six
End

subroutine wasICEing()
  implicit none

  Type :: Err_Text_Type
    integer :: nlines
    character (len=132), dimension(5) :: txt
  End Type Err_Text_Type

  Type (Err_Text_Type)  :: Mess_FindFMT =  &
                                Err_Text_Type(0, (/" "," "," "," "," "/))
end subroutine wasICEing

subroutine anotherCheck()
  Type :: t
    character (len=3) :: txt(2)
  End Type
  Type (t) :: tt = t((/ character(len=5) :: "12345", "67890" /))
  print *, tt
end subroutine

! { dg-final { scan-tree-dump-times "one = ..txt=..12345., .67890...;" 1 "original" } }
! { dg-final { scan-tree-dump-times "two = ..txt=..123  ., .678  ...;" 1 "original" } }
! { dg-final { scan-tree-dump-times "three = ..txt=..12345., .abcde...;" 1 "original" } }
! { dg-final { scan-tree-dump-times "four = ..txt=..ABC  ., .ZYX  ...;" 1 "original" } }
! { dg-final { scan-tree-dump-times "five = ..txt=..AbCdE., .ZyXwV...;" 1 "original" } }
! { dg-final { scan-tree-dump-times "six = ..txt=..aBcDe., .zYxWv...;" 1 "original" } }