AArch64: correct constraint on Upl early clobber alternatives
[official-gcc.git] / gcc / testsuite / gfortran.dg / PR96726.f90
blobb0b26b906693f743dc5e2bf8d7598c0f3d7d17e5
1 ! { dg-do run }
3 ! Test the fix for PR96726
6 module cref_m
8 implicit none
10 private
12 public :: &
13 sizeish
15 contains
17 pure function sizeish(a) result(s)
18 integer, intent(in) :: a(..)
20 integer :: s
22 s = size(a)
23 return
24 end function sizeish
26 end module cref_m
28 program cref_p
30 use cref_m, only: &
31 sizeish
33 implicit none
35 integer :: i
37 integer, parameter :: n = 3
38 integer, parameter :: p(*) = [(i, i=1,n*n)]
40 integer :: a(n,n)
41 integer :: b(n*n)
43 a = reshape(p, shape=[n,n])
44 call isub_a(a, b)
45 if (any(b/=p)) stop 1
46 call isub_b(a, b)
47 if (any(b/=p)) stop 2
48 stop
50 contains
52 subroutine isub_a(a, b)
53 integer, intent(in) :: a(..)
54 integer, intent(out) :: b(size(a))
56 integer :: i
58 b = [(i, i=1,size(b))]
59 return
60 end subroutine isub_a
62 subroutine isub_b(a, b)
63 integer, intent(in) :: a(..)
64 integer, intent(out) :: b(sizeish(a))
66 integer :: i
68 b = [(i, i=1,sizeish(b))]
69 return
70 end subroutine isub_b
72 end program cref_p