xref: /llvm-project/flang/test/Lower/dense-attributed-array.f90 (revision f35f863a88f83332bef9605ef4cfe4f05c066efb)
1*f35f863aSjeanPerier! RUN: bbc --emit-fir -hlfir=false %s -o - | FileCheck %s
2b914efc5SValentin Clement
3b914efc5SValentin Clement! Test generation of dense attributed global array. Also, make sure there are
4b914efc5SValentin Clement! no dead ssa assignments.
5b914efc5SValentin Clementmodule mm
6b914efc5SValentin Clement  integer, parameter :: qq(3) = [(i,i=51,53)]
7b914efc5SValentin Clementend
8b914efc5SValentin Clementsubroutine ss
9b914efc5SValentin Clement  use mm
10b914efc5SValentin Clement  n = qq(3)
11b914efc5SValentin Clementend
12b914efc5SValentin Clement!CHECK-NOT: %{{.*}} = fir.undefined !fir.array<3xi32>
13b914efc5SValentin Clement!CHECK-NOT: %{{.*}} = arith.constant %{{.*}} : index
14b914efc5SValentin Clement!CHECK-NOT: %{{.*}} = arith.constant %{{.*}} : i32
15b914efc5SValentin Clement!CHECK-NOT: %{{.*}} = fir.insert_value %{{.*}}, %{{.*}}, [%{{.*}} : index] : (!fir.array<3xi32>, i32) -> !fir.array<3xi32>
16b914efc5SValentin Clement!CHECK: fir.global @_QMmmECqq(dense<[51, 52, 53]> : tensor<3xi32>) constant : !fir.array<3xi32>
17b914efc5SValentin Clement!CHECK: func @_QPss() {
18b914efc5SValentin Clement!CHECK:  %[[a0:.*]] = fir.alloca i32 {bindc_name = "n", uniq_name = "_QFssEn"}
19b914efc5SValentin Clement!CHECK:  %[[c0:.*]] = arith.constant 53 : i32
20b914efc5SValentin Clement!CHECK:  fir.store %[[c0]] to %[[a0]] : !fir.ref<i32>
21b914efc5SValentin Clement!CHECK:  return
22b914efc5SValentin Clement!CHECK: }
23