AArch64: correct constraint on Upl early clobber alternatives
[official-gcc.git] / gcc / testsuite / gfortran.dg / select_type_42.f90
blobff73e6c78583acf35df5ffdc304375014623e8fe
1 ! { dg-do run }
3 ! Tests the fix for PR82275.
4 ! Associating a name with a reduced-dimension section of a
5 ! multidimensional array precluded subsequent use of the name
6 ! with the appropriately reduced dimensionality and instead
7 ! required use of the (invalid) full set of original dimensions.
9 ! Contributed by Damian Rouson <damian@sourceryinstitute.org>
11 type component
12 integer :: i
13 end type
14 type container
15 class(component), allocatable :: component_array(:,:)
16 end type
17 type(container) bag
18 type(component) section_copy
19 allocate(bag%component_array, source = reshape ([component(10), component (100)], [1,2]))
20 select type(associate_name=>bag%component_array(1,:))
21 type is (component)
22 section_copy = associate_name(2) ! gfortran rejected valid
23 ! section_copy = associate_name(1,1)! gfortran accepted invalid
24 end select
25 if (section_copy%i .ne. 100) stop 1
26 end