OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [alloc_comp_basics_2.f90] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! Check "double" allocations of allocatable components (PR 20541).
3
!
4
! Contributed by Erik Edelmann  
5
!            and Paul Thomas  
6
!
7
program main
8
 
9
  implicit none
10
 
11
  type foo
12
     integer, dimension(:), allocatable :: array
13
  end type foo
14
 
15
  type(foo),allocatable,dimension(:) :: mol
16
  type(foo),pointer,dimension(:) :: molp
17
  integer :: i
18
 
19
  allocate (mol(1))
20
  allocate (mol(1), stat=i)
21
  !print *, i  ! /= 0
22
  if (i == 0) call abort()
23
 
24
  allocate (mol(1)%array(5))
25
  allocate (mol(1)%array(5),stat=i)
26
  !print *, i  ! /= 0
27
  if (i == 0) call abort()
28
 
29
  allocate (molp(1))
30
  allocate (molp(1), stat=i)
31
  !print *, i  ! == 0
32
  if (i /= 0) call abort()
33
 
34
  allocate (molp(1)%array(5))
35
  allocate (molp(1)%array(5),stat=i)
36
  !print *, i  ! /= 0
37
  if (i == 0) call abort()
38
 
39
end program main

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.