1! { dg-do compile }
2!
3! PR 43388: [F2008][OOP] ALLOCATE with MOLD=
4!
5! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7type :: t
8end type
9
10type :: u
11end type
12
13class(t),allocatable :: x
14type(t) :: z1,z2
15type(u) :: z3
16
17allocate(x,MOLD=z1,MOLD=z2)    ! { dg-error "Redundant MOLD tag" }
18allocate(x,SOURCE=z1,MOLD=z2)  ! { dg-error "conflicts with SOURCE tag" }
19allocate(t::x,MOLD=z1)         ! { dg-error "conflicts with the typespec" }
20
21allocate(x,MOLD=z3)            ! { dg-error "is type incompatible" }
22
23end
24