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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [where_2.f90] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
! Tests the fix for PR35743 and PR35745.
3
!
4
! Contributed by Dick Hendrickson 
5
!
6
program try_rg0025
7
  logical lda(5)
8
  lda = (/(i/2*2 .ne. I, i=1,5)/)
9
  call PR35743 (lda,  1,  2,  3,  5,  6, -1, -2)
10
  CALL PR34745
11
end program
12
 
13
! Previously, the negative mask size would not be detected.
14
SUBROUTINE PR35743 (LDA,nf1,nf2,nf3,nf5,nf6,mf1,mf2)
15
  type unseq
16
    real  r
17
  end type unseq
18
  TYPE(UNSEQ) TDA1L(6)
19
  LOGICAL LDA(NF5)
20
  TDA1L(1:6)%r = 1.0
21
  WHERE (LDA(NF6:NF3))
22
    TDA1L(MF1:NF5:MF1) = TDA1L(NF6:NF2)
23
  ENDWHERE
24
END SUBROUTINE
25
 
26
! Previously, the expression in the WHERE block would be evaluated
27
! ouside the loop generated by the where.
28
SUBROUTINE PR34745
29
  INTEGER IDA(10)
30
  REAL RDA(10)
31
  RDA    = 1.0
32
  nf0 = 0
33
  WHERE (RDA < -15.0)
34
    IDA = 1/NF0 + 2
35
  ENDWHERE
36
END SUBROUTINE

powered by: WebSVN 2.1.0

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