2 ! Tests the fix for PR31213, which exposed rather a lot of
3 ! bugs - see the PR and the ChangeLog.
5 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
9 integer, parameter :: ik1 = selected_int_kind (2)
10 integer, parameter :: ik2 = selected_int_kind (4)
11 integer, parameter :: dp = selected_real_kind (15,300)
19 pure function tricky (str,ugly)
20 character(*), intent(in) :: str
21 integer(ik1) :: ia_ik1(len(str))
26 integer, intent(in) :: n
27 complex(dp) :: ugly(3*n+2)
30 logical :: la(size (yoagly (size (ia_ik1))))
32 character(tricky_helper ((/(.TRUE., i=1, size (la))/)) + c_size) :: tricky
34 tricky = transfer (yoagly (1), tricky)
37 pure function tricky_helper (lb)
38 logical, intent(in) :: lb(:)
39 integer :: tricky_helper
40 tricky_helper = 2 * size (lb) + 3
41 end function tricky_helper
47 pure function butt_ugly(n)
50 integer, intent(in) :: n
51 complex(dp) :: butt_ugly(3*n+2)
54 pi = 4 * atan (1.0_dp)
56 butt_ugly = cmplx (pi, sq2, dp)
57 end function butt_ugly
68 if (tricky ('Help me', butt_ugly) .ne. transfer (butt_ugly (1), chr)) call abort ()
70 ! { dg-final { cleanup-modules "mykinds spec_xpr xtra_fun" } }