1! { dg-do compile }
2!
3! PR 57639: [OOP] ICE with polymorphism (and illegal code)
4!
5! Contributed by Walter Spector <w6ws@earthlink.net>
6
7  implicit none
8
9  class(*) :: t1, t2      ! { dg-error "must be dummy, allocatable or pointer" }
10
11  print *, 'main: compare = ', compare (t1, t2)
12  print *, SAME_TYPE_AS (t1, t2)
13
14contains
15
16 logical function compare (a, b)
17    class(*), intent(in), allocatable :: a, b
18  end function
19
20end
21