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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do compile }
2
! Test the patch for PR30084 in which the reference to SIZE
3
! in function diag caused a segfault in module.c.
4
!
5
! Contributed by Troban Trumsko 
6
! and reduced by Steve Kargl 
7
!
8
module tao_random_numbers
9
  integer, dimension(10) :: s_buffer
10
  integer :: s_last = size (s_buffer)
11
end module tao_random_numbers
12
 
13
module linalg
14
  contains
15
  function diag (a) result (d)
16
    real, dimension(:,:), intent(in) :: a
17
    real, dimension(min(size(a,dim=1),size(a,dim=2))) :: d
18
    integer :: i
19
    do i = 1, min(size(a, dim = 1), size(a, dim = 2))
20
       d(i) = a(i,i)
21
    end do
22
  end function diag
23
end module linalg
24
 
25
module vamp_rest
26
  use tao_random_numbers
27
  use linalg
28
end module vamp_rest
29
 
30
  use vamp_rest
31
  real :: x(2, 2) = reshape ([1.,2.,3.,4.], [2,2]) ! { dg-warning "nonstandard" }
32
  print *, s_last
33
  print *, diag (x)
34
end
35
! { dg-final { cleanup-modules "tao_random_numbers linalg vamp_rest" } }

powered by: WebSVN 2.1.0

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