https://gcc.gnu.org/g:414068d9f97068428f1c3c131f5574673d41b1f1
commit 414068d9f97068428f1c3c131f5574673d41b1f1 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Thu Jul 24 09:44:15 2025 +0200 Ajout test pr121185 Diff: --- gcc/testsuite/gfortran.dg/pr121185_comment_23.f90 | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gcc/testsuite/gfortran.dg/pr121185_comment_23.f90 b/gcc/testsuite/gfortran.dg/pr121185_comment_23.f90 new file mode 100644 index 000000000000..b9730ddfb95b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr121185_comment_23.f90 @@ -0,0 +1,30 @@ +! { dg-do run } + +program p + implicit none + type t + complex, allocatable :: x(:) + end type t + type, extends (t) :: t2 + end type t2 + real :: trace = 2. + type(t2) :: z + z% x = [1,2] * trace + ! print *, z% x + if (any(z%x /= [2., 4.])) error stop 1 + z% x = z% x / trace ! OK + !print *, z% x + if (any(z%x /= [1., 2.])) error stop 2 + !print * + z% x = [1,2] * trace + call norm (z) +contains + subroutine norm (y) + class(t2) :: y + if (any(z%x /= [1., 2.])) error stop 11 + ! print *, y% x + y% x = y% x / trace ! not OK + if (any(z%x /= [2., 4.])) error stop 12 + ! print *, y% x + end subroutine norm +end