OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / alloc_comp_basics_2.f90
1 ! { dg-do run }\r
2 ! Check "double" allocations of allocatable components (PR 20541).\r
3 !\r
4 ! Contributed by Erik Edelmann  <eedelmann@gcc.gnu.org>\r
5 !            and Paul Thomas  <pault@gcc.gnu.org>\r
6 !\r
7 program main\r
8 \r
9   implicit none\r
10 \r
11   type foo\r
12      integer, dimension(:), allocatable :: array\r
13   end type foo\r
14 \r
15   type(foo),allocatable,dimension(:) :: mol\r
16   type(foo),pointer,dimension(:) :: molp\r
17   integer :: i\r
18 \r
19   allocate (mol(1))\r
20   allocate (mol(1), stat=i)\r
21   !print *, i  ! /= 0\r
22   if (i == 0) call abort()\r
23 \r
24   allocate (mol(1)%array(5))\r
25   allocate (mol(1)%array(5),stat=i)\r
26   !print *, i  ! /= 0\r
27   if (i == 0) call abort()\r
28 \r
29   allocate (molp(1))\r
30   allocate (molp(1), stat=i)\r
31   !print *, i  ! == 0\r
32   if (i /= 0) call abort()\r
33 \r
34   allocate (molp(1)%array(5))\r
35   allocate (molp(1)%array(5),stat=i)\r
36   !print *, i  ! /= 0\r
37   if (i == 0) call abort()\r
38 \r
39 end program main\r