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/] [stfunc_6.f90] - Blame information for rev 414

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! { dg-options "-std=legacy" }
3
!
4
! Tests the fix for the second bit of PR29389, in which the
5
! statement function would not be recognised as not PURE
6
! when it referenced a procedure that is not PURE.
7
!
8
! This is based on stfunc_4.f90 with the statement function made
9
! impure by a reference to 'v'.
10
!
11
! Contributed by Francois-Xavier Coudert 
12
 
13
  INTEGER :: st1, i = 99, a(4), q = 6
14
  st1 (i) = i * i * i
15
  st3 (i) = i * v(i)
16
  FORALL(i=1:4) a(i) = st1 (i)
17
  FORALL(i=1:4) a(i) = u (a(i)) - a(i)** 2
18
  if (any (a .ne. 0)) call abort ()
19
  if (i .ne. 99) call abort ()
20
  FORALL (i=1:4) a(i) = st3 (i) ! { dg-error "non-PURE function" "non-PURE reference in FORALL" { xfail *-*-*} }
21
  FORALL (i=1:4) a(i) = v(i) ! { dg-error "non-PURE function" }
22
contains
23
  pure integer function u (x)
24
    integer,intent(in) :: x
25
    st2 (i) = i * v(i) ! { dg-error "non-PURE procedure" }
26
    u = st2(x)
27
  end function
28
  integer function v (x)
29
    integer,intent(in) :: x
30
    v = i
31
  end function
32
end

powered by: WebSVN 2.1.0

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