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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [class_allocate_9.f03] - Blame information for rev 708

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR51870 - ALLOCATE with class function expression for SOURCE failed.
3
! This is the original test in the PR.
4
!
5
! Reported by Tobias Burnus  
6
!
7
module show_producer_class
8
  implicit none
9
  type integrand
10
    integer :: variable = -1
11
  end type integrand
12
 
13
  type show_producer
14
  contains
15
    procedure ,nopass :: create_show
16
  end type
17
contains
18
  function create_show () result(new_integrand)
19
    class(integrand) ,allocatable :: new_integrand
20
    allocate(new_integrand)
21
    new_integrand%variable = 99
22
  end function
23
end module
24
 
25
program main
26
  use show_producer_class
27
  implicit none
28
  class(integrand) ,allocatable :: kernel1, kernel2
29
  type(show_producer) :: executive_producer
30
 
31
  allocate(kernel1, kernel2,mold=executive_producer%create_show ())
32
  if (kernel1%variable .ne. -1) call abort
33
  if (kernel2%variable .ne. -1) call abort
34
end program
35
! { dg-final { cleanup-modules "show_producer_class" } }
36
 

powered by: WebSVN 2.1.0

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