1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 ! CHECK-LABEL: func.func @_QPtest_is_contiguous(
4 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "a"}) {
5 ! CHECK: %[[VAL_1:.*]] = fir.alloca !fir.logical<4> {adapt.valuebyref}
6 ! CHECK: %[[VAL_2:.*]] = fir.alloca !fir.logical<4> {adapt.valuebyref}
7 ! CHECK: %[[VAL_5:.*]] = fir.alloca !fir.box<!fir.ptr<!fir.array<?xf32>>> {bindc_name = "p", uniq_name = "_QFtest_is_contiguousEp"}
8 ! CHECK: %[[VAL_42:.*]] = fir.convert %[[VAL_0]] : (!fir.box<!fir.array<?xf32>>) -> !fir.box<none>
9 ! CHECK: %[[VAL_43:.*]] = fir.call @_FortranAIsContiguous(%[[VAL_42]]) {{.*}} : (!fir.box<none>) -> i1
10 ! CHECK: %[[VAL_44:.*]] = fir.convert %[[VAL_43]] : (i1) -> !fir.logical<4>
11 ! CHECK: fir.store %[[VAL_44]] to %[[VAL_2]] : !fir.ref<!fir.logical<4>>
12 ! CHECK: fir.call @_QPfoo1(%[[VAL_2]]) {{.*}} : (!fir.ref<!fir.logical<4>>) -> ()
13 ! CHECK: %[[VAL_45:.*]] = fir.load %[[VAL_5]] : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>
14 ! CHECK: %[[VAL_46:.*]] = fir.convert %[[VAL_45]] : (!fir.box<!fir.ptr<!fir.array<?xf32>>>) -> !fir.box<none>
15 ! CHECK: %[[VAL_47:.*]] = fir.call @_FortranAIsContiguous(%[[VAL_46]]) {{.*}} : (!fir.box<none>) -> i1
16 ! CHECK: %[[VAL_48:.*]] = fir.convert %[[VAL_47]] : (i1) -> !fir.logical<4>
17 ! CHECK: fir.store %[[VAL_48]] to %[[VAL_1]] : !fir.ref<!fir.logical<4>>
18 ! CHECK: fir.call @_QPfoo2(%[[VAL_1]]) {{.*}} : (!fir.ref<!fir.logical<4>>) -> ()
22 subroutine test_is_contiguous(a
)
28 call foo1(is_contiguous(a
))
29 call foo2(is_contiguous(p
))