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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options -O2 }
3
! Tests the fix for PRs29507 and 31404, where elemental functions in
4
! initialization expressions could not be simplified with array arguments.
5
!
6
! Contributed by Steve Kargl 
7
!             and Vivek Rao 
8
!
9
  real, parameter :: a(2,2) = reshape ((/1.0, 2.0, 3.0, 4.0/), (/2,2/))
10
  real, parameter :: b(2,2) = sin (a)
11
  character(8), parameter :: oa(1:3)=(/'nint()  ', 'log10() ', 'sqrt()  '/)
12
  integer, parameter :: ob(1:3) = index(oa, '(')
13
  character(6), parameter :: ch(3) = (/"animal", "person", "mantee"/)
14
  character(1), parameter :: ch2(3) = (/"n", "r", "t"/)
15
  integer, parameter :: i(3) = index (ch, ch2)
16
  integer :: ic(1) = len_trim((/"a"/))
17
 
18
  if (any (reshape (b, (/4/)) .ne. (/(sin(real(k)), k = 1,4)/))) call abort ()
19
  if (any (ob .ne. (/5,6,5/))) call abort ()  ! Original PR29507
20
  if (any (i .ne. (/2,3,4/))) call abort ()
21
  if (ic(1) .ne. 1) call abort ()             ! Original PR31404
22
end

powered by: WebSVN 2.1.0

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