LAA: improve code in getStrideFromPointer (NFC) (#124780)
[llvm-project.git] / flang / test / Evaluate / bug115923.f90
blobccddab02f5a11b294da30fc997a01be9a9d45f1d
1 ! RUN: %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s
2 ! Ensure that EOSHIFT's ARRAY= argument and result can be CLASS(*).
3 ! CHECK-NOT: error:
4 ! CHECK: warning: Source of TRANSFER is polymorphic
5 ! CHECK: warning: Mold of TRANSFER is polymorphic
6 program p
7 type base
8 integer j
9 end type
10 type, extends(base) :: extended
11 integer k
12 end type
13 class(base), allocatable :: polyArray(:,:,:)
14 class(*), allocatable :: unlimited(:)
15 allocate(polyArray, source=reshape([(extended(n,n-1),n=1,8)],[2,2,2]))
16 allocate(unlimited, source=[(base(9),n=1,16)])
17 select type (x => eoshift(transfer(polyArray, unlimited), -4, base(-1)))
18 type is (base); print *, 'base', x
19 type is (extended); print *, 'extended?', x
20 class default; print *, 'class default??'
21 end select
22 end