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

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900 (2017-10-27)
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 ! { dg-options "-std=legacy" }
kono
parents:
diff changeset
3 !
kono
parents:
diff changeset
4 program char_pointer_dummy
kono
parents:
diff changeset
5 ! Test character pointer dummy arguments, required
kono
parents:
diff changeset
6 ! to fix PR16939 and PR18689
kono
parents:
diff changeset
7 ! Provided by Paul Thomas pault@gcc.gnu.org
kono
parents:
diff changeset
8 implicit none
kono
parents:
diff changeset
9 character*4 :: c0
kono
parents:
diff changeset
10 character*4, pointer :: c1
kono
parents:
diff changeset
11 character*4, pointer :: c2(:)
kono
parents:
diff changeset
12 allocate (c1, c2(1))
kono
parents:
diff changeset
13 ! Check that we have not broken non-pointer characters.
kono
parents:
diff changeset
14 c0 = "wxyz"
kono
parents:
diff changeset
15 call foo (c0)
kono
parents:
diff changeset
16 ! Now the pointers
kono
parents:
diff changeset
17 c1 = "wxyz"
kono
parents:
diff changeset
18 call sfoo (c1)
kono
parents:
diff changeset
19 c2 = "wxyz"
kono
parents:
diff changeset
20 call afoo (c2)
kono
parents:
diff changeset
21 deallocate (c1, c2)
kono
parents:
diff changeset
22 contains
kono
parents:
diff changeset
23 subroutine foo (cc1)
kono
parents:
diff changeset
24 character*4 :: cc1
kono
parents:
diff changeset
25 if (cc1 /= "wxyz") call abort ()
kono
parents:
diff changeset
26 end subroutine foo
kono
parents:
diff changeset
27 subroutine sfoo (sc1)
kono
parents:
diff changeset
28 character*4, pointer :: sc1
kono
parents:
diff changeset
29 if (sc1 /= "wxyz") call abort ()
kono
parents:
diff changeset
30 end subroutine sfoo
kono
parents:
diff changeset
31 subroutine afoo (ac1)
kono
parents:
diff changeset
32 character*4, pointer :: ac1(:)
kono
parents:
diff changeset
33 if (ac1(1) /= "wxyz") call abort ()
kono
parents:
diff changeset
34 end subroutine afoo
kono
parents:
diff changeset
35 end program char_pointer_dummy
kono
parents:
diff changeset
36