summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/operator_c1202.f90
blob: c53079ac5d84aa211874d81abd88f5d6f08052ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
! { dg-do compile }
module op

   implicit none

   type a
      integer i
   end type a

   type b
      real i
   end type b

   interface operator(==)
      module procedure f1
   end interface operator(.eq.)
   interface operator(.eq.)
      module procedure f2
   end interface operator(==)

   interface operator(/=)
      module procedure f1
   end interface operator(.ne.)
   interface operator(.ne.)
      module procedure f2
   end interface operator(/=)

   interface operator(<=)
      module procedure f1
   end interface operator(.le.)
   interface operator(.le.)
      module procedure f2
   end interface operator(<=)

   interface operator(<)
      module procedure f1
   end interface operator(.lt.)
   interface operator(.lt.)
      module procedure f2
   end interface operator(<)

   interface operator(>=)
      module procedure f1
   end interface operator(.ge.)
   interface operator(.ge.)
      module procedure f2
   end interface operator(>=)

   interface operator(>)
      module procedure f1
   end interface operator(.gt.)
   interface operator(.gt.)
      module procedure f2
   end interface operator(>)

   contains

      function f2(x,y)
         logical f2
         type(a), intent(in) :: x, y
      end function f2

      function f1(x,y)
         logical f1
         type(b), intent(in) :: x, y
      end function f1

end module op