* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_10.f03
blob2f3194a1b94e19f114248ea865b40283250b43b7
1 ! { dg-do run }
3 ! Fixes problem setting CHARACTER KIND expressions in PDT components
4 ! and resolution of intrinsic functions and numeric expressions.
6 ! Contributed by FortranFan on clf thread "Parameterized Derived Types
7 ! make first appearance in gfortran 8.0.0"
9 program p
10    use, intrinsic :: iso_fortran_env, only : CK => character_kinds
11    implicit none
12    character(kind = 4), parameter :: c = 'a'
13    type :: pdt_t(k,l)
14       integer, kind :: k = CK(1)
15       integer, len :: l
16       character(kind=k,len=l) :: s
17    end type
18    type(pdt_t(l=12)) :: foo
19    type(pdt_t(k = kind (c), l=12)) :: foo_4
21    foo%s = "Hello World!"
22    if (foo%s .ne. "Hello World!") call abort
23    if (KIND (foo%s) .ne. 1) call abort
24    if (len (foo%s) .ne. 12) call abort
26    foo_4%s = "Hello World!"
27    if (foo_4%s .ne. "Hello World!") call abort
28    if (KIND (foo_4%s) .ne. 1) call abort
29    if (len (foo_4%s) .ne. 12) call abort
30 end program