3 ! Test the implementation of inquiry part references (PR40196).
4 ! "Type parameter inquiry (str%len, a%kind) and Complex parts (z%re, z%im)"
6 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
10 character (:), allocatable :: str
11 real, pointer :: r => z%re
12 real, pointer :: i => z%im
14 complex :: z = ( 10.0, 11.0 )
23 character (len=der%str%len) :: str1
24 complex, parameter :: zc = ( 99.0, 199.0 )
25 REAL, parameter :: rc = zc%re
26 REAL, parameter :: ic = zc%im
31 ! Check the pointer initializations
32 if (r .ne. real (z)) stop 1
33 if (i .ne. imag (z)) stop 2
35 ! Check the use of inquiry part_refs on lvalues and rvalues.
38 ! Check that the result is OK.
39 if (z%re .ne. real (z)) stop 3
40 if (abs (z*im - 4.0 * real (z)) .lt. 1e-6) stop 4
42 ! Check a double inquiry part_ref.
43 if (z%im%kind .ne. kind (z)) stop 5
45 ! Test on deferred character length.
46 if (str%kind .ne. kind (str)) stop 6
47 if (str%len .ne. len (str)) stop 7
49 ! Check the use in specification expressions.
50 if (len (der%str) .ne. LEN (str1)) stop 8
51 if (rc .ne. real (zc)) stop 9
52 if (ic .ne. aimag (zc)) stop 10