fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / entry_17.f90
blobb4e91c2a8eea42977222854837a8b61fe165b20e
1 function test1(n)
2 integer :: n
3 character(n) :: test1
4 character(n) :: bar1
5 test1 = ""
6 return
7 entry bar1()
8 bar1 = ""
9 end function test1
11 function test2()
12 character(1) :: test2
13 character(1) :: bar2
14 test2 = ""
15 return
16 entry bar2()
17 bar2 = ""
18 end function test2
20 function test3() ! { dg-warning "Obsolescent feature" }
21 character(*) :: test3
22 character(*) :: bar3 ! { dg-warning "Obsolescent feature" }
23 test3 = ""
24 return
25 entry bar3()
26 bar3 = ""
27 end function test3
29 function test4(n) ! { dg-error "returning variables of different string lengths" }
30 integer :: n
31 character(n) :: test4
32 character(*) :: bar4 ! { dg-warning "Obsolescent feature" }
33 test4 = ""
34 return
35 entry bar4()
36 bar4 = ""
37 end function test4
39 function test5() ! { dg-error "returning variables of different string lengths" }
40 character(1) :: test5
41 character(2) :: bar5
42 test5 = ""
43 return
44 entry bar5()
45 bar5 = ""
46 end function test5
48 function test6() ! { dg-warning "Obsolescent feature|returning variables of different string lengths" }
49 character(*) :: test6
50 character(2) :: bar6
51 test6 = ""
52 return
53 entry bar6()
54 bar6 = ""
55 end function test6