summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/der_io_1.f90
blob: 4cbbf772cf60f3fe0bad26c0ed7de22ab895c784 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do compile }
! PR 16404 Nr. 8
! IO of derived types containing pointers is not allowed
program der_io_1
  type t
    integer, pointer :: p
  end type
  integer, target :: i
  type (t) v
  character(4) :: s

  v%p => i
  i = 42
  write (unit=s, fmt='(I2)') v ! { dg-error "POINTER components" "" }
  if (s .ne. '42') call abort ()
end program