view gcc/testsuite/gfortran.dg/dec_union_10.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
! { dg-options "-fdec-structure" }
!
! Check for regression where gfc_compare_union_types wasn't properly guarded
! against empty unions.
!

subroutine sub1(r)
  structure /s/
    union
    end union
  end structure
  record /s/ r
end subroutine

subroutine sub2()
  structure /s/
    union
    end union
  end structure
  record /s/ r
  call sub1(r)
end subroutine

call sub2()

end