Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / entry_array_specs_2.f
blobba4de318c88462997dd95531c0660a3ac5ed129f
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) call abort ()
13 call y(a,10)
14 if (j .ne. 2) call abort ()
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