OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [used_dummy_types_8.f90] - Blame information for rev 699

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR30880, in which the variable d1
3
! in module m1 would cause an error in the main program
4
! because it has an initializer and is a dummy.  This
5
! came about because the function with multiple entries
6
! assigns the initializer earlier than for other cases.
7
!
8
! Contributed by Joost VandeVondele 
9
!
10
MODULE M1
11
  TYPE T1
12
  INTEGER :: i=7
13
  END TYPE T1
14
CONTAINS
15
  FUNCTION F1(d1) RESULT(res)
16
    INTEGER :: res
17
    TYPE(T1), INTENT(OUT) :: d1
18
    TYPE(T1), INTENT(INOUT) :: d2
19
    res=d1%i
20
    d1%i=0
21
    RETURN
22
  ENTRY E1(d2) RESULT(res)
23
    res=d2%i
24
    d2%i=0
25
  END FUNCTION F1
26
END MODULE M1
27
 
28
  USE M1
29
  TYPE(T1) :: D1
30
  D1=T1(3)
31
  write(6,*) F1(D1)
32
  D1=T1(3)
33
  write(6,*) E1(D1)
34
END
35
! { dg-final { cleanup-modules "m1" } }

powered by: WebSVN 2.1.0

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