2 ! { dg-options "-Os -fsanitize=signed-integer-overflow" }
4 ! Test the fix for PR35824, in which the interface assignment and
5 ! negation did not work correctly.
7 ! Contributed by Rolf Roth <everyo@gmx.net>
12 double precision,allocatable
:: b(:)
14 interface assignment(=)
15 module procedure at_from_at
18 module procedure neg_at
21 subroutine at_from_at(b
,a
)
22 type(alltype
), intent(in
) :: a
23 type(alltype
), intent(out
) :: b
27 end subroutine at_from_at
28 function neg_at(a
) result(b
)
29 type(alltype
), intent(in
) :: a
37 type(alltype
) t1
,t2
,t3
43 if (t2
%a
.ne
. -0.5d0) STOP 1
44 if (any(t2
%b
.ne
. [-1d0, -2d0])) STOP 2
47 if (t1
%a
.ne
. -0.5d0) STOP 3
48 if (any(t1
%b
.ne
. [-1d0, -2d0])) STOP 4