annotate gcc/testsuite/gfortran.dg/associate_24.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 ! From posting by Spectrum to clf on thread entitled "Bounds for array pointer dummy argument".
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 PROGRAM X
kono
parents:
diff changeset
6 implicit none
kono
parents:
diff changeset
7 TYPE T
kono
parents:
diff changeset
8 INTEGER :: I
kono
parents:
diff changeset
9 END TYPE T
kono
parents:
diff changeset
10 TYPE(T), TARGET :: T1( 0:3 )
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 associate( P => T1 % I )
kono
parents:
diff changeset
13 call check (lbound (P, 1), ubound (P, 1) ,1 , 4)
kono
parents:
diff changeset
14 endassociate
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 associate( P2 => T1(:) % I )
kono
parents:
diff changeset
17 call check (lbound (P2, 1), ubound (P2, 1) ,1 , 4)
kono
parents:
diff changeset
18 endassociate
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 associate( Q => T1 )
kono
parents:
diff changeset
21 call check (lbound (Q, 1), ubound (Q, 1) ,0 , 3)
kono
parents:
diff changeset
22 endassociate
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 associate( Q2 => T1(:) )
kono
parents:
diff changeset
25 call check (lbound (Q2, 1), ubound (Q2, 1) ,1 , 4)
kono
parents:
diff changeset
26 endassociate
kono
parents:
diff changeset
27 contains
kono
parents:
diff changeset
28 subroutine check (lbnd, ubnd, lower, upper)
kono
parents:
diff changeset
29 integer :: lbnd, ubnd, lower, upper
kono
parents:
diff changeset
30 if (lbnd .ne. lower) call abort
kono
parents:
diff changeset
31 if (ubnd .ne. upper) call abort
kono
parents:
diff changeset
32 end subroutine
kono
parents:
diff changeset
33 END PROGRAM X