xref: /llvm-project/flang/test/Lower/memory-alloc.f90 (revision f35f863a88f83332bef9605ef4cfe4f05c066efb)
1! RUN: bbc -hlfir=false -o - %s | FileCheck %s
2
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>>>
7
8Module w0b
9  Integer,Parameter :: a(*,*) = Reshape( [ 1,2,3,4 ], [ 2,2 ])
10contains
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
19End Module
20