[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_64.f90
blob059ebaa8a01c733a4c1dd147c1f451237896d5d5
1 ! { dg-do compile }
2 ! { dg-options "-fdump-tree-original" }
4 ! Test the fix for PR80850 in which the _len field was not being
5 ! set for 'arg' in the call to 'foo'.
7 type :: mytype
8 integer :: i
9 end type
10 class (mytype), pointer :: c
12 allocate (c, source = mytype (99_8))
14 call foo(c)
15 call bar(c)
17 deallocate (c)
19 contains
21 subroutine foo (arg)
22 class(*) :: arg
23 select type (arg)
24 type is (mytype)
25 if (arg%i .ne. 99_8) call abort
26 end select
27 end subroutine
29 subroutine bar (arg)
30 class(mytype) :: arg
31 select type (arg)
32 type is (mytype)
33 if (arg%i .ne. 99_8) call abort
34 end select
35 end subroutine
37 end
38 ! { dg-final { scan-tree-dump-times "arg.*._len" 1 "original" } }