[to-be-committed] [RISC-V] Use Zbkb for general 64 bit constants when profitable
[official-gcc.git] / gcc / testsuite / gfortran.dg / used_before_typed_3.f90
blobef2c679e08286d870bf16406ef2c0c2bbbaa0850
1 ! { dg-do compile }
2 ! { dg-options "-std=f95" }
4 ! PR fortran/32095
5 ! PR fortran/34228
6 ! Check for a special case when the return-type of a function is given outside
7 ! its "body" and contains symbols defined inside.
9 MODULE testmod
10 IMPLICIT REAL(a-z)
12 CONTAINS
14 CHARACTER(len=x) FUNCTION test1 (x) ! { dg-error "of INTEGER" }
15 IMPLICIT REAL(a-z)
16 INTEGER :: x ! { dg-error "already has basic type" }
17 test1 = "foobar"
18 END FUNCTION test1
20 CHARACTER(len=x) FUNCTION test2 (x) ! { dg-error "of INTEGER" }
21 IMPLICIT INTEGER(a-z)
22 test2 = "foobar"
23 END FUNCTION test2
25 END MODULE testmod
27 CHARACTER(len=i) FUNCTION test3 (i)
28 ! i is IMPLICIT INTEGER by default
29 test3 = "foobar"
30 END FUNCTION test3
32 CHARACTER(len=g) FUNCTION test4 (g) ! { dg-error "of INTEGER" }
33 ! g is REAL, unless declared INTEGER.
34 test4 = "foobar"
35 END FUNCTION test4
37 ! Test an empty function works, too.
38 INTEGER FUNCTION test5 ()
39 END FUNCTION test5