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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [associate_9.f03] - Blame information for rev 708

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "-std=f2003 -fall-intrinsics" }
3
 
4
! FIXME: Change into run test and remove excess error expectation.
5
 
6
! PR fortran/38936
7
! Association to derived-type, where the target type is not know
8
! during parsing (only resolution).
9
 
10
! Contributed by Daniel Kraft, d@domob.eu.
11
 
12
MODULE m
13
  IMPLICIT NONE
14
 
15
  TYPE :: mynum
16
    INTEGER :: comp
17
  END TYPE mynum
18
 
19
  INTERFACE OPERATOR(+)
20
    MODULE PROCEDURE add
21
  END INTERFACE OPERATOR(+)
22
 
23
CONTAINS
24
 
25
  PURE FUNCTION add (a, b)
26
    TYPE(mynum), INTENT(IN) :: a, b
27
    TYPE(mynum) :: add
28
 
29
    add%comp = a%comp + b%comp
30
  END FUNCTION add
31
 
32
END MODULE m
33
 
34
PROGRAM main
35
  USE :: m
36
  IMPLICIT NONE
37
 
38
  TYPE(mynum) :: a
39
  a = mynum (5)
40
 
41
  ASSOCIATE (x => add (a, a))
42
    IF (x%comp /= 10) CALL abort ()
43
  END ASSOCIATE
44
 
45
  ASSOCIATE (x => a + a)
46
    IF (x%comp /= 10) CALL abort ()
47
  END ASSOCIATE
48
END PROGRAM main
49
 
50
! { dg-excess-errors "Syntex error in IF" }
51
! { dg-final { cleanup-modules "m" } }

powered by: WebSVN 2.1.0

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