PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / entry_array_specs_2.f
blob2320697d3ea845ad3643302d41bba7e825bf9c8e
1 ! { dg-do run }
2 ! Tests the patch for PR30025, aka 25818, in which the initialization
3 ! code for the array a, was causing a segfault in runtime for a call
4 ! to x, since n is missing.
6 ! COntributed by Elizabeth Yip <elizabeth.l.yip@boeing.com>
7 program test_entry
8 common // j
9 real a(10)
10 a(1) = 999.
11 call x
12 if (j .ne. 1) STOP 1
13 call y(a,10)
14 if (j .ne. 2) STOP 2
15 stop
16 end
17 subroutine x
18 common // j
19 real a(n)
20 j = 1
21 return
22 entry y(a,n)
23 call foo(a(1))
24 end
25 subroutine foo(a)
26 common // j
27 real a
28 j = 2
29 return
30 end