2 ! Test the extension of intrinsic operators
10 interface operator(.or.)
14 interface operator(//)
20 function f1(a,b) result (c)
21 integer, dimension(2,2), intent(in) :: a
22 integer, dimension(2), intent(in) :: b
23 integer, dimension(2) :: c
26 function f2(a,b) result (c)
27 real, dimension(2,2), intent(in) :: a
28 real, dimension(2), intent(in) :: b
29 real, dimension(2) :: c
32 function f3(a,b) result (c)
33 complex, dimension(2,2), intent(in) :: a
34 complex, dimension(2), intent(in) :: b
35 complex, dimension(2) :: c
39 elemental function g1(a,b) result (c)
40 integer, intent(in) :: a, b
50 integer, dimension(2,2) :: ai
51 integer, dimension(2) :: bi, ci
52 real, dimension(2,2) :: ar
53 real, dimension(2) :: br, cr
54 complex, dimension(2,2) :: ac
55 complex, dimension(2) :: bc, cc
57 ai = reshape((/-2,-4,7,8/),(/2,2/)) ; bi = 3
58 if (any((ai*bi) /= matmul(ai,bi))) call abort()
59 if (any((ai .or. ai) /= ai+ai)) call abort()
60 if (any((ai // ai) /= ai+ai)) call abort()
62 ar = reshape((/-2,-4,7,8/),(/2,2/)) ; br = 3
63 if (any((ar*br) /= matmul(ar,br))) call abort()
65 ac = reshape((/-2,-4,7,8/),(/2,2/)) ; bc = 3
66 if (any((ac*bc) /= matmul(ac,bc))) call abort()
69 ! { dg-final { cleanup-modules "m1" } }