2 ! { dg-options "-finit-derived -finit-integer=1" }
4 ! Make sure -finit-derived works on class variables.
5 ! Based on class_result_1.f03
18 subroutine print( point )
19 class(point2i) :: point
20 write(*,'(2i4)') point%x, point%y
23 subroutine set_vector( point, rx, ry )
24 class(point2i) :: point
30 function add_vector( point, vector )
31 class(point2i), intent(in) :: point, vector
32 class(point2i), allocatable :: add_vector
33 allocate( add_vector )
34 add_vector%x = point%x + vector%x
35 add_vector%y = point%y + vector%y
46 type(point2i), target :: point_2i, vector_2i
47 class(point2i), pointer :: point, vector
51 point => point_2i ! = (1, 1) due to -finit-integer
53 call set_vector(vector, 2, 2)
54 vsum = add_vector(point, vector)
60 if (vsum%x .ne. 3 .or. vsum%y .ne. 3) then