PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_assignment_5.f03
blobf176b841fc0c8d1234947f939bf038136ab86a2e
1 ! { dg-do run }
2 ! { dg-options "-fdump-tree-original" }
4 ! PR fortran/49074
5 ! ICE on defined assignment with class arrays.
7       module foo
8         type bar
9           integer :: i
11           contains
13           generic :: assignment (=) => assgn_bar
14           procedure, private :: assgn_bar
15         end type bar
17         contains
19         elemental subroutine assgn_bar (a, b)
20           class (bar), intent (inout) :: a
21           class (bar), intent (in) :: b
23           select type (b)
24           type is (bar)
25             a%i = b%i
26           end select
28           return
29         end subroutine assgn_bar
30       end module foo
32       program main
33         use foo
35         type (bar), allocatable :: foobar(:)
37         allocate (foobar(2))
38         foobar = [bar(1), bar(2)]
39         if (any(foobar%i /= [1, 2])) STOP 1
40       end program
42 ! { dg-final { scan-tree-dump-not "_gfortran_internal_pack" "original" } }
43 ! { dg-final { scan-tree-dump-not "_gfortran_internal_unpack" "original" } }