Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gfortran.dg / associated_6.f90
1 ! { dg-do run }\r
2 !\r
3 ! PR 54881: [4.8 Regression] [OOP] ICE in fold_convert_loc, at fold-const.c:2016\r
4 !\r
5 ! Contributed by Richard L Lozes <richard@lozestech.com>\r
6 \r
7   implicit none\r
8 \r
9   type treeNode\r
10     type(treeNode), pointer :: right => null()\r
11   end type\r
12 \r
13   type(treeNode) :: n\r
14 \r
15   if (associated(RightOf(n))) call abort()\r
16   allocate(n%right)\r
17   if (.not.associated(RightOf(n))) call abort()\r
18   deallocate(n%right)\r
19   \r
20 contains\r
21 \r
22   function RightOf (theNode)\r
23     class(treeNode), pointer :: RightOf\r
24     type(treeNode), intent(in) :: theNode\r
25     RightOf => theNode%right\r
26   end function\r
27   \r
28 end\r