c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / bounds_check_14.f90
blob67ed14bb7da2f18ad48be7527bdee1d785427f9c
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
4 program test
5 integer x(20)
6 integer, volatile :: n
7 n = 1
8 if (size(x(n:2:-3)) /= 0) STOP 1
10 call ha0020(-3)
11 call ha0020(-1)
12 end program test
14 subroutine ha0020(mf3)
15 implicit none
16 integer xca(2), xda(2), mf3
18 xca = 1
19 xda = -1
21 xca(1:2:-1) = xda(1:2:mf3)
23 if (any (xca /= 1)) STOP 2
24 if (any(xda(1:2:mf3) /= xda(1:0))) STOP 3
25 if (size(xda(1:2:mf3)) /= 0) STOP 4
26 if (any(shape(xda(1:2:mf3)) /= 0)) STOP 5
27 if (any(ubound(xda(1:2:mf3)) /= 0)) STOP 6
28 if (ubound(xda(1:2:mf3),1) /= 0) STOP 7
29 if (lbound(xda(1:2:mf3),1) /= 1) STOP 8
31 end subroutine