coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_dummy_5.f90
blob8da19af1ee6574d00c14e600b2949c068609f277
1 ! { dg-do compile }
3 ! PR 54756: [OOP] [F08] Should reject CLASS, intent(out) in PURE procedures
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
7 module m
8 type t
9 contains
10 final :: fnl ! impure finalizer
11 end type t
12 contains
13 impure subroutine fnl(x)
14 type(t) :: x
15 print *,"finalized!"
16 end subroutine
17 end
19 program test
20 use m
21 type(t) :: x
22 call foo(x)
23 contains
24 pure subroutine foo(x) ! { dg-error "may not be polymorphic" }
25 ! pure subroutine would call impure finalizer
26 class(t), intent(out) :: x
27 end subroutine
28 end
30 ! { dg-final { cleanup-modules "m" } }