brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 413024d Raw
38 lines · plain
1! RUN: bbc -emit-fir %s -o - | FileCheck %s2 3! Test propagation of Fortran attributes to FIR.4 5 6! CHECK-LABEL: func @_QPfoo1(7! CHECK-SAME: %arg0: !fir.ref<f32> {fir.bindc_name = "x", fir.optional},8! CHECK-SAME: %arg1: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "y", fir.optional},9! CHECK-SAME: %arg2: !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>> {fir.bindc_name = "i", fir.optional},10! CHECK-SAME: %arg3: !fir.boxchar<1> {fir.bindc_name = "c", fir.optional}11subroutine foo1(x, y, i, c)12  real, optional :: x, y(:)13  integer, allocatable, optional :: i(:)14  character, optional :: c15end subroutine16 17! CHECK-LABEL: func @_QPfoo2(18! CHECK-SAME: %arg0: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "x", fir.contiguous},19! CHECK-SAME: %arg1: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>> {fir.bindc_name = "i", fir.contiguous}20subroutine foo2(x, i)21  real, contiguous :: x(:)22  integer, pointer, contiguous :: i(:)23end subroutine24 25! CHECK-LABEL: func @_QPfoo326! CHECK-SAME: %arg0: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "x", fir.contiguous, fir.optional}27subroutine foo3(x)28  real, optional, contiguous :: x(:)29end subroutine30 31! CHECK-LABEL: func @_QPfoo432! CHECK-SAME: %arg0: !fir.ref<f32> {fir.bindc_name = "x", fir.target}33! CHECK-SAME: %arg1: !fir.ref<f32> {fir.asynchronous, fir.bindc_name = "y"}34subroutine foo4(x, y)35  real, target :: x36  real, asynchronous :: y37end subroutine38