annotate gcc/testsuite/gfortran.dg/char_result_15.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! Tests the fix for PR44265. This test arose because of an issue found
kono
parents:
diff changeset
4 ! during the development of the fix; namely the clash between the normal
kono
parents:
diff changeset
5 ! module parameter and that found in the specification expression for
kono
parents:
diff changeset
6 ! 'Get'.
kono
parents:
diff changeset
7 !
kono
parents:
diff changeset
8 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
kono
parents:
diff changeset
9 !
kono
parents:
diff changeset
10 MODULE Fruits
kono
parents:
diff changeset
11 IMPLICIT NONE
kono
parents:
diff changeset
12 PRIVATE
kono
parents:
diff changeset
13 character (20) :: buffer
kono
parents:
diff changeset
14 PUBLIC :: Get, names, fruity, buffer
kono
parents:
diff changeset
15 CHARACTER(len=7), PARAMETER :: names(3) = [ &
kono
parents:
diff changeset
16 'Pomme ', &
kono
parents:
diff changeset
17 'Orange ', &
kono
parents:
diff changeset
18 'Mangue ' ];
kono
parents:
diff changeset
19 CONTAINS
kono
parents:
diff changeset
20 FUNCTION Get(i) RESULT(s)
kono
parents:
diff changeset
21 CHARACTER(len=7), PARAMETER :: names(3) = [ &
kono
parents:
diff changeset
22 'Apple ', &
kono
parents:
diff changeset
23 'Orange ', &
kono
parents:
diff changeset
24 'Mango ' ];
kono
parents:
diff changeset
25 INTEGER, INTENT(IN) :: i
kono
parents:
diff changeset
26 CHARACTER(LEN_TRIM(names(i))) :: s
kono
parents:
diff changeset
27 s = names(i)
kono
parents:
diff changeset
28 END FUNCTION Get
kono
parents:
diff changeset
29 subroutine fruity (i)
kono
parents:
diff changeset
30 integer :: i
kono
parents:
diff changeset
31 write (buffer, '(i2,a)') len (Get (i)), Get (i)
kono
parents:
diff changeset
32 end subroutine
kono
parents:
diff changeset
33 END MODULE Fruits
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 PROGRAM WheresThatbLinkingConstantGone
kono
parents:
diff changeset
36 USE Fruits
kono
parents:
diff changeset
37 IMPLICIT NONE
kono
parents:
diff changeset
38 integer :: i
kono
parents:
diff changeset
39 write (buffer, '(i2,a)') len (Get (1)), Get (1)
kono
parents:
diff changeset
40 if (trim (buffer) .ne. " 5Apple") call abort
kono
parents:
diff changeset
41 call fruity(3)
kono
parents:
diff changeset
42 if (trim (buffer) .ne. " 5Mango") call abort
kono
parents:
diff changeset
43 if (trim (names(3)) .ne. "Mangue") Call abort
kono
parents:
diff changeset
44 END PROGRAM WheresThatbLinkingConstantGone