RISC-V: Regenerate opt urls.
[official-gcc.git] / gcc / testsuite / gfortran.dg / PR97046.f90
blob7d133a5ad70916d89bfd375f636698971ce1a980
1 ! { dg-do run }
3 ! Test the fix for PR94331
5 ! Contributed by Igor Gayday <igor.gayday@mu.edu>
8 MODULE FOO
10 implicit none
12 INTEGER, parameter :: n = 11
14 contains
16 SUBROUTINE dummyc(x0) BIND(C)
17 type(*), dimension(..) :: x0
18 if(LBOUND(x0,1)/=1) stop 5
19 if(UBOUND(x0,1)/=n) stop 6
20 if(rank(x0)/=1) stop 7
21 END SUBROUTINE dummyc
23 SUBROUTINE dummy(x0)
24 type(*), dimension(..) :: x0
25 call dummyc(x0)
26 END SUBROUTINE dummy
28 END MODULE
30 PROGRAM main
31 USE FOO
32 IMPLICIT NONE
33 integer :: before(2), after(2)
35 DOUBLE PRECISION, ALLOCATABLE :: buf(:)
36 DOUBLE PRECISION :: buf2(n)
38 ALLOCATE(buf(n))
39 before(1) = LBOUND(buf,1)
40 before(2) = UBOUND(buf,1)
41 CALL dummy (buf)
42 after(1) = LBOUND(buf,1)
43 after(2) = UBOUND(buf,1)
44 deallocate(buf)
46 if (before(1) .NE. after(1)) stop 1
47 if (before(2) .NE. after(2)) stop 2
49 before(1) = LBOUND(buf2,1)
50 before(2) = UBOUND(buf2,1)
51 CALL dummy (buf2)
52 after(1) = LBOUND(buf2,1)
53 after(2) = UBOUND(buf2,1)
55 if (before(1) .NE. after(1)) stop 3
56 if (before(2) .NE. after(2)) stop 4
58 END PROGRAM