Increase timeout factor for hppa*-*-* in gcc.dg/long_branch.c
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_remapping_9.f90
blobc9fc992f773856c9933160a77f36961ce2a0fd76
1 ! { dg-do run }
3 ! PR fortran/61138
4 ! Wrong code with pointer-bounds remapping
6 ! Contributed by Tobias Burnus <burnus@net-b.de>
8 implicit none
9 integer, target :: tgt(10)
10 integer, target, allocatable :: tgt2(:)
11 integer, pointer :: ptr(:)
13 tgt = [1,2,3,4,5,6,7,8,9,10]
14 tgt2 = [1,2,3,4,5,6,7,8,9,10]
17 ptr(-5:) => tgt(5:) ! Okay
19 if (size(ptr) /= 6 .or. lbound(ptr,1) /= -5) STOP 1
20 if (any (ptr /= [5,6,7,8,9,10])) STOP 2
23 ptr(-5:) => tgt2(5:) ! wrongly associates the whole array
25 print '(*(i4))', size(ptr), lbound(ptr)
26 print '(*(i4))', ptr
28 if (size(ptr) /= 6 .or. lbound(ptr,1) /= -5) STOP 3
29 if (any (ptr /= [5,6,7,8,9,10])) STOP 4
30 end