lto: Remove random_seed from section name.
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_10.f03
blob856a933863a41ac133451d12836bc9b940ee6899
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    character(kind = 4), parameter :: hello = "Hello World!"
14    type :: pdt_t(k,l)
15       integer, kind :: k = CK(1)
16       integer, len :: l
17       character(kind=k,len=l) :: s
18    end type
19    type(pdt_t(l=12)) :: foo
20    type(pdt_t(k = kind (c), l=12)) :: foo_4
22    foo%s = "Hello World!"
23    if (foo%s .ne. "Hello World!") STOP 1
24    if (KIND (foo%s) .ne. 1) STOP 2
25    if (len (foo%s) .ne. 12) STOP 3
27    foo_4%s = hello
28    if (foo_4%s .ne. hello) STOP 4
29    if (KIND (foo_4%s) .ne. 4) STOP 5
30    if (len (foo_4%s) .ne. 12) STOP 6
31 end program