OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [allocate_derived_1.f90] - Blame information for rev 437

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
!
3
! ALLOCATE statements with derived type specification
4
!
5
! Contributed by Janus Weil 
6
 
7
 type :: t1
8
  integer :: i
9
 end type
10
 
11
 type, extends(t1) :: t2
12
  real :: r
13
 end type
14
 
15
 type, extends(t2) :: t3
16
  real :: q
17
 end type
18
 
19
 type, abstract :: u0
20
  logical :: nothing
21
 end type
22
 
23
 type :: v1
24
  real :: r
25
 end type
26
 
27
 class(t1),dimension(:),allocatable :: x
28
 type(t2),dimension(:),allocatable :: y
29
 class(t3),dimension(:),allocatable :: z
30
 
31
 allocate(      x(1))
32
 allocate(t1 :: x(2))
33
 allocate(t2 :: x(3))
34
 allocate(t3 :: x(4))
35
 allocate(tx :: x(5))  ! { dg-error "is not an accessible derived type" }
36
 allocate(u0 :: x(6))  ! { dg-error "may not be ABSTRACT" }
37
 allocate(v1 :: x(7))  ! { dg-error "is type incompatible with typespec" }
38
 
39
 allocate(      y(1))
40
 allocate(t1 :: y(2))  ! { dg-error "is type incompatible with typespec" }
41
 allocate(t2 :: y(3))
42
 allocate(t3 :: y(3))  ! { dg-error "is type incompatible with typespec" }
43
 
44
 allocate(      z(1))
45
 allocate(t1 :: z(2))  ! { dg-error "is type incompatible with typespec" }
46
 allocate(t2 :: z(3))  ! { dg-error "is type incompatible with typespec" }
47
 allocate(t3 :: z(4))
48
 
49
end
50
 

powered by: WebSVN 2.1.0

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