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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [scalarize_parameter_array_1.f90] - Blame information for rev 308

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
! Tests the fix for pr32682, in which the scalarization loop variables
3
! were not being determined when 'c' came first in an expression.
4
!
5
! Contributed by Janus Weil 
6
!
7
program matrix
8
 
9
  implicit none
10
  real,dimension(2,2),parameter::c=reshape((/1,2,3,4/),(/2,2/))
11
  real,dimension(2,2)::m, n
12
 
13
  m=f()+c
14
  if (any (m .ne. reshape((/2,3,4,5/),(/2,2/)))) call abort ()
15
  m=c+f()
16
  if (any (m .ne. reshape((/2,3,4,5/),(/2,2/)))) call abort ()
17
  call sub(m+f())
18
  if (any (n .ne. reshape((/3,4,5,6/),(/2,2/)))) call abort ()
19
  call sub(c+m)
20
  if (any (n .ne. reshape((/3,5,7,9/),(/2,2/)))) call abort ()
21
  call sub(f()+c)
22
  if (any (n .ne. reshape((/2,3,4,5/),(/2,2/)))) call abort ()
23
  call sub(c+f())
24
  if (any (n .ne. reshape((/2,3,4,5/),(/2,2/)))) call abort ()
25
 
26
contains
27
 
28
  function f()
29
    implicit none
30
    real, dimension(2,2)::f
31
    f=1
32
  end function f
33
 
34
  subroutine sub(a)
35
    implicit none
36
    real, dimension(2,2)::a
37
    n = a
38
  end subroutine sub
39
 
40
end program matrix

powered by: WebSVN 2.1.0

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