2 ! Modified program from http://groups.google.com/group/\
3 ! comp.lang.fortran/browse_frm/thread/423e4392dc965ab7#
7 function dadd(arg1
,arg2
)
9 integer, intent(in
) :: arg1(2), arg2(2)
10 dadd(1)=arg1(1)+arg2(1)
11 dadd(2)=arg1(2)+arg2(2)
15 program test_interface
21 interface operator (.myadd
.)
25 integer input1(2), input2(2), mysum(2)
29 mysum
= input1
.myadd
. input2
30 if (mysum(1) /= 3 .and
. mysum(2) /= 4) call abort
32 call test_sub(input1
, input2
)
34 end program test_interface
36 subroutine test_sub(input1
, input2
)
42 interface operator (.myadd
.)
46 integer, intent(in
) :: input1(2), input2(2)
49 mysum
= input1
.myadd
. input2
50 if (mysum(1) /= 3 .and
. mysum(2) /= 4) call abort
52 end subroutine test_sub
53 ! { dg-final { cleanup-modules "myoperator" } }