[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / memory-alloc.f90
blob3b7b8f01e7250e57b0c4dd294f6bc47a9ced2124
1 ! RUN: bbc -o - %s | FileCheck %s
3 ! CHECK-LABEL: func @_QMw0bPtest1(
4 ! CHECK: %[[TWO:.*]] = arith.constant 2 : index
5 ! CHECK: %[[HEAP:.*]] = fir.allocmem !fir.array<?x!fir.logical<4>>, %[[TWO]] {uniq_name = ".array.expr"}
6 ! CHECK: fir.freemem %[[HEAP]] : !fir.heap<!fir.array<?x!fir.logical<4>>>
8 Module w0b
9 Integer,Parameter :: a(*,*) = Reshape( [ 1,2,3,4 ], [ 2,2 ])
10 contains
11 Subroutine test1(i,expect)
12 Integer,Intent(In) :: i,expect(:)
13 Logical :: ok = .True.
14 If (Any(a(:,i)/=expect)) Then
15 !Print *,'FAIL 1:',a(:,i),'/=',expect
16 ok = .False.
17 End If
18 End Subroutine
19 End Module