https://gcc.gnu.org/g:60890e502d26d0ffbe92cf6b4d96e8f469931efc
commit 60890e502d26d0ffbe92cf6b4d96e8f469931efc Author: Mikael Morin <mik...@gcc.gnu.org> Date: Thu Jul 24 09:44:15 2025 +0200 Ajout test pr121185 Correction test Correction test pr121185 Correction test 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..72cdbf3f170d --- /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 + ! print *, y% x + if (any(y%x /= [2., 4.])) error stop 11 + y% x = y% x / trace ! not OK + ! print *, y% x + if (any(y%x /= [1., 2.])) error stop 12 + end subroutine norm +end