annotate gcc/testsuite/gfortran.dg/intrinsic_actual_2.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! Tests the fix for PR29387, in which array valued arguments of
kono
parents:
diff changeset
3 ! LEN and ASSOCIATED would cause an ICE.
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
kono
parents:
diff changeset
6 !
kono
parents:
diff changeset
7 integer :: ans
kono
parents:
diff changeset
8 TYPE T1
kono
parents:
diff changeset
9 INTEGER, POINTER :: I=>NULL()
kono
parents:
diff changeset
10 END TYPE T1
kono
parents:
diff changeset
11 type(T1), pointer :: tar(:)
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 character(20) res
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 j = 10
kono
parents:
diff changeset
16 PRINT *, LEN(SUB(8)), ans
kono
parents:
diff changeset
17 PRINT *, LEN(SUB(j)), ans
kono
parents:
diff changeset
18 ! print *, len(SUB(j + 2)//"a"), ans ! This still fails (no charlen).
kono
parents:
diff changeset
19 print *, len(bar(2)), ans
kono
parents:
diff changeset
20
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 IF(.NOT.ASSOCIATED(F1(10))) STOP 1
111
kono
parents:
diff changeset
22 deallocate (tar)
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 CONTAINS
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 FUNCTION SUB(I)
kono
parents:
diff changeset
27 CHARACTER(LEN=I) :: SUB(1)
kono
parents:
diff changeset
28 ans = LEN(SUB(1))
kono
parents:
diff changeset
29 SUB = ""
kono
parents:
diff changeset
30 END FUNCTION
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 FUNCTION BAR(I)
kono
parents:
diff changeset
33 CHARACTER(LEN=I*10) :: BAR(1)
kono
parents:
diff changeset
34 ans = LEN(BAR)
kono
parents:
diff changeset
35 BAR = ""
kono
parents:
diff changeset
36 END FUNCTION
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 FUNCTION F1(I) RESULT(R)
kono
parents:
diff changeset
39 TYPE(T1), DIMENSION(:), POINTER :: R
kono
parents:
diff changeset
40 INTEGER :: I
kono
parents:
diff changeset
41 ALLOCATE(tar(I))
kono
parents:
diff changeset
42 R => tar
kono
parents:
diff changeset
43 END FUNCTION F1
kono
parents:
diff changeset
44 END