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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR30876 in which interface derived types were
3
! not always being associated.
4
!
5
! Contributed by Joost VandeVondele 
6
!
7
MODULE M1
8
CONTAINS
9
 FUNCTION correct_input(i)
10
   INTEGER :: i,correct_input(5), ans(5) = 0
11
   IF (i<1) correct_input=test(1)
12
   IF (i>5) correct_input=test(5)
13
 END FUNCTION correct_input
14
 
15
 RECURSIVE FUNCTION test(i)
16
  INTEGER :: test(5),i,j
17
  IF (i<1 .OR. i>5) THEN
18
    test=correct_input(i)
19
  ELSE
20
    test=0
21
    test(1:6-i)=(/(j,j=i,5)/)
22
    test=test(3)
23
  ENDIF
24
 END FUNCTION
25
 
26
END MODULE M1
27
 
28
USE M1
29
integer :: ans(5)
30
IF (ANY(TEST(3).NE.(/5,5,5,5,5/))) CALL ABORT()
31
IF (ANY(TEST(6).NE.(/0,0,0,0,0/))) CALL ABORT()
32
END
33
! { dg-final { cleanup-modules "m1" } }
34
 

powered by: WebSVN 2.1.0

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