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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [func_assign_3.f90] - Blame information for rev 749

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Tests the fix for PR40646 in which the assignment would cause an ICE.
3
!
4
! Contributed by Charlie Sharpsteen  
5
! http://gcc.gnu.org/ml/fortran/2009-07/msg00010.html
6
! and reported by Tobias Burnus  
7
!
8
module bugTestMod
9
  implicit none
10
  type:: boundTest
11
  contains
12
    procedure, nopass:: test => returnMat
13
  end type boundTest
14
contains
15
  function returnMat( a, b ) result( mat )
16
    integer:: a, b, i
17
    double precision, dimension(a,b):: mat
18
    mat = dble (reshape ([(i, i = 1, a * b)],[a,b]))
19
    return
20
  end function returnMat
21
end module bugTestMod
22
 
23
program bugTest
24
  use bugTestMod
25
  implicit none
26
  integer i
27
  double precision, dimension(2,2):: testCatch
28
  type( boundTest ):: testObj
29
  testCatch = testObj%test(2,2)  ! This would cause an ICE
30
  if (any (testCatch .ne. dble (reshape ([(i, i = 1, 4)],[2,2])))) call abort
31
end program bugTest
32
! { dg-final { cleanup-modules "bugtestmod" } }

powered by: WebSVN 2.1.0

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