OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [used_before_typed_3.f90] - Blame information for rev 424

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! { dg-options "-std=f95" }
3
 
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.
8
 
9
MODULE testmod
10
  IMPLICIT REAL(a-z)
11
 
12
CONTAINS
13
 
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
19
 
20
  CHARACTER(len=x) FUNCTION test2 (x) ! { dg-bogus "used before|of INTEGER" }
21
    IMPLICIT INTEGER(a-z)
22
    test2 = "foobar"
23
  END FUNCTION test2
24
 
25
END MODULE testmod
26
 
27
CHARACTER(len=i) FUNCTION test3 (i) ! { dg-bogus "used before|of INTEGER" }
28
  ! i is IMPLICIT INTEGER by default
29
  test3 = "foobar"
30
END FUNCTION test3
31
 
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
36
 
37
! Test an empty function works, too.
38
INTEGER FUNCTION test5 ()
39
END FUNCTION test5
40
 
41
! { dg-final { cleanup-modules "testmod" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.