OSDN Git Service

ChangeLogs fixed, again.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / namelist_4.f90
1 ! { dg-do compile }\r
2 ! This tests the fix for PR25089 in which it was noted that a\r
3 ! NAMELIST member that is an internal(or module) procedure gave\r
4 ! no error if the NAMELIST declaration appeared before the\r
5 ! procedure declaration. Not mentioned in the PR is that any\r
6 ! reference to the NAMELIST object would cause a segfault.\r
7 !\r
8 ! Based on the contribution from Joost VanderVondele\r
9 !\r
10 module M1\r
11 CONTAINS\r
12 ! This is the original PR\r
13   INTEGER FUNCTION G1()\r
14     NAMELIST /NML1/ G2 ! { dg-error "PROCEDURE attribute conflicts" }\r
15     G1=1\r
16   END FUNCTION\r
17   INTEGER FUNCTION G2()\r
18     G2=1\r
19   END FUNCTION\r
20 ! This has always been picked up - namelist after function\r
21   INTEGER FUNCTION G3()\r
22     NAMELIST /NML2/ G1 ! { dg-error "PROCEDURE attribute conflicts" }\r
23     G3=1\r
24   END FUNCTION\r
25 END module M1\r
26  
27 program P1\r
28 CONTAINS\r
29 ! This has the additional wrinkle of a reference to the object.\r
30   INTEGER FUNCTION F1()\r
31     NAMELIST /NML3/ F2 ! { dg-error "PROCEDURE attribute conflicts" }
32 ! Used to ICE here\r
33     f2 = 1             ! { dg-error "is not a VALUE" }\r
34     F1=1\r
35   END FUNCTION\r
36   INTEGER FUNCTION F2()\r
37     F2=1\r
38   END FUNCTION\r
39 END
40 \r
41 ! { dg-final { cleanup-modules "M1" } }