ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git] / gcc / testsuite / gfortran.dg / recursive_reference_2.f90
blobc329012c05c78768e96b244c594503d4cfbc5186
1 ! { dg-do compile }
2 ! Tests the fix for PR30876 in which interface derived types were
3 ! not always being associated.
5 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
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
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
26 END MODULE M1
28 USE M1
29 integer :: ans(5)
30 IF (ANY(TEST(3).NE.(/5,5,5,5,5/))) STOP 1
31 IF (ANY(TEST(6).NE.(/0,0,0,0,0/))) STOP 2
32 END