1! { dg-do compile }
2! This tests the fix for PR29565, which failed in the gimplifier
3! with the third call to has_read_key because this lost the first
4! temporary array declaration from the current context.
5!
6! Contributed by William Mitchell  <william.mitchell@nist.gov>
7!
8  type element_t
9    integer :: gid
10  end type element_t
11
12  type(element_t) :: element(1)
13   call hash_read_key(element%gid)
14   call hash_read_key(element%gid)
15   call hash_read_key(element%gid)
16contains
17  subroutine hash_read_key(key)
18    integer, intent(out) :: key(1)
19  end subroutine hash_read_key
20end
21