111
|
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.
|
|
5 !
|
|
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
|
131
|
12 if (j .ne. 1) STOP 1
|
111
|
13 call y(a,10)
|
131
|
14 if (j .ne. 2) STOP 2
|
111
|
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
|
|
31
|