1! { dg-do compile }
2! Tests a number of error messages relating to derived type objects
3! in common blocks.  Originally due to PR 33198
4
5subroutine one
6type a
7   sequence
8   integer :: i = 1
9end type a
10type(a) :: t ! { dg-error "Derived type variable .t. in COMMON at ... may not have default initializer" }
11common /c/ t
12end
13
14subroutine first
15type a
16   integer :: i
17   integer :: j
18end type a
19type(a) :: t  ! { dg-error "Derived type variable .t. in COMMON at ... has neither the SEQUENCE nor the BIND.C. attribute" }
20common /c/ t
21end
22
23subroutine prime
24type a
25   sequence
26   integer, allocatable :: i(:)
27   integer :: j
28end type a
29type(a) :: t  ! { dg-error "Derived type variable .t. in COMMON at ... has an ultimate component that is allocatable" }
30common /c/ t
31end
32
33subroutine source
34parameter(x=0.) ! { dg-error "COMMON block .x. at ... is used as PARAMETER at ..." }
35common /x/ i  ! { dg-error "COMMON block .x. at ... is used as PARAMETER at ..." }
36intrinsic sin
37common /sin/ j ! { dg-error "COMMON block .sin. at ... is also an intrinsic procedure" }
38end subroutine source
39