1 ! PR 17711 : Verify error message text meets operator in source
13 INTERFACE OPERATOR(/=)
21 INTERFACE OPERATOR(>=)
29 INTERFACE OPERATOR(<=)
34 LOGICAL FUNCTION t_eq(this, other)
35 TYPE(t), INTENT(in) :: this, other
36 t_eq = (this%x == other%x)
39 LOGICAL FUNCTION t_ne(this, other)
40 TYPE(t), INTENT(in) :: this, other
41 t_ne = (this%x /= other%x)
44 LOGICAL FUNCTION t_gt(this, other)
45 TYPE(t), INTENT(in) :: this, other
46 t_gt = (this%x > other%x)
49 LOGICAL FUNCTION t_ge(this, other)
50 TYPE(t), INTENT(in) :: this, other
51 t_ge = (this%x >= other%x)
54 LOGICAL FUNCTION t_lt(this, other)
55 TYPE(t), INTENT(in) :: this, other
56 t_lt = (this%x < other%x)
59 LOGICAL FUNCTION t_le(this, other)
60 TYPE(t), INTENT(in) :: this, other
61 t_le = (this%x <= other%x)
72 A = (A == B) ! { dg-error "comparison operator '=='" }
73 A = (A.EQ.B) ! { dg-error "comparison operator '.eq.'" }
74 A = (A /= B) ! { dg-error "comparison operator '/='" }
75 A = (A.NE.B) ! { dg-error "comparison operator '.ne.'" }
76 A = (A <= B) ! { dg-error "comparison operator '<='" }
77 A = (A.LE.B) ! { dg-error "comparison operator '.le.'" }
78 A = (A < B) ! { dg-error "comparison operator '<'" }
79 A = (A.LT.B) ! { dg-error "comparison operator '.lt.'" }
80 A = (A >= B) ! { dg-error "comparison operator '>='" }
81 A = (A.GE.B) ! { dg-error "comparison operator '.ge.'" }
82 A = (A > B) ! { dg-error "comparison operator '>'" }
83 A = (A.GT.B) ! { dg-error "comparison operator '.gt.'" }
85 ! this should also work with user defined operators
86 A = (A == C) ! { dg-error "comparison operator '=='" }
87 A = (A.EQ.C) ! { dg-error "comparison operator '.eq.'" }
88 A = (A /= C) ! { dg-error "comparison operator '/='" }
89 A = (A.NE.C) ! { dg-error "comparison operator '.ne.'" }
90 A = (A <= C) ! { dg-error "comparison operator '<='" }
91 A = (A.LE.C) ! { dg-error "comparison operator '.le.'" }
92 A = (A < C) ! { dg-error "comparison operator '<'" }
93 A = (A.LT.C) ! { dg-error "comparison operator '.lt.'" }
94 A = (A >= C) ! { dg-error "comparison operator '>='" }
95 A = (A.GE.C) ! { dg-error "comparison operator '.ge.'" }
96 A = (A > C) ! { dg-error "comparison operator '>'" }
97 A = (A.GT.C) ! { dg-error "comparison operator '.gt.'" }
100 ! { dg-final { cleanup-modules "mod_t" } }