aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/init_flag_16.f03
blob: a39df63d7723c1c8070c1545ad848d2b05de8b7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! { dg-do compile }
! { dg-options "-finit-derived" }
!
! PR fortran/82886
!
! Test a regression which caused an ICE when -finit-derived was given without
! other -finit-* flags, especially for derived-type components with potentially
! hidden basic integer components.
!

program pr82886

  use, intrinsic :: iso_c_binding, only: c_ptr, c_null_ptr
  type t
    type(c_ptr) :: my_c_ptr
  end type

contains

  subroutine sub0() bind(c)
    type(t), target :: my_f90_type
    my_f90_type%my_c_ptr = c_null_ptr
  end subroutine

end