OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / parent_result_ref_4.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 function results can be referenced in modules.\r
5 !
6 module m
7 contains\r
8   function f()\r
9     integer :: f\r
10     f = 42\r
11     call sub ()\r
12     if (f.eq.1) f = f + 1\r
13   contains\r
14     subroutine sub\r
15      if (f.eq.42) f = f - 41\r
16     end subroutine sub\r
17   end function f
18 end module m\r
19 \r
20   use m\r
21   if (f ().ne.2) call abort ()\r
22 end\r
23
24 ! { dg-final { cleanup-modules "m" } }