OSDN Git Service

PR c++/9335
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / parent_result_ref_3.f90
1 ! { dg-do run }\r
2 ! Tests the fix for PR19546 in which an ICE would result from\r
3 ! setting the parent result in a contained procedure. \r
4 ! Check that parent alternate entry results can be referenced.\r
5\r
6 function f()\r
7   integer :: f, g\r
8   f = 42\r
9   call sub1 ()\r
10   if (f.eq.1) f = 2\r
11   return\r
12 entry g()\r
13   g = 99\r
14   call sub2 ()
15   if (g.eq.77) g = 33\r
16 contains\r
17   subroutine sub1\r
18     if (f.eq.42) f = 1\r
19   end subroutine sub1\r
20   subroutine sub2\r
21     if (g.eq.99) g = g - 22\r
22   end subroutine sub2\r
23 end function f\r
24 \r
25   integer, external :: f, g\r
26   if (f ().ne.2) call abort ()
27   if (g ().ne.33) call abort ()\r
28 end\r