PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / entry_array_specs_1.f90
blob5e6e5f676500745f0ec401e673b3b8cf85a3f9a3
1 ! { dg-do compile }
2 ! Tests the fix for PR25091 and PR25092 in which mismatched array
3 ! specifications between entries of the same procedure were not diagnosed.
5 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
7 ! This was PR25091 - no diagnostic given on error
8 FUNCTION F1() RESULT(RES_F1) ! { dg-error "mismatched array specifications" }
9 INTEGER RES_F1(2,2)
10 INTEGER RES_E1(4)
11 ENTRY E1() RESULT(RES_E1)
12 END FUNCTION
14 ! This was PR25092 - no diagnostic given on error
15 FUNCTION F2() RESULT(RES_F2) ! { dg-error "mismatched array specifications" }
16 INTEGER :: RES_F2(4)
17 INTEGER :: RES_E2(3)
18 ENTRY E2() RESULT(RES_E2)
19 END FUNCTION
21 ! Check that the versions without explicit results give the error
22 FUNCTION F3() ! { dg-error "mismatched array specifications" }
23 INTEGER :: F3(4)
24 INTEGER :: E3(2,2)
25 ENTRY E3()
26 END FUNCTION
28 FUNCTION F4() ! { dg-error "mismatched array specifications" }
29 INTEGER :: F4(4)
30 INTEGER :: E4(3)
31 ENTRY E4()
32 END FUNCTION
34 ! Check that conforming entries are OK.
35 FUNCTION F5()
36 INTEGER :: F5(4,5,6)
37 INTEGER :: E5(4,5,6)
38 ENTRY E5()
39 END FUNCTION