Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / arguments.f90
blobf54fa6868d554b4c1730bc62f6691897e0048838
1 ! RUN: bbc %s -o "-" -emit-fir | FileCheck %s
3 subroutine sub1(a, b)
4 integer, intent(in) :: a
5 logical :: b
6 end
8 ! Check that arguments are correctly set and no local allocation is happening.
9 ! CHECK-LABEL: func @_QPsub1(
10 ! CHECK-SAME: %{{.*}}: !fir.ref<i32> {fir.bindc_name = "a"}, %{{.*}}: !fir.ref<!fir.logical<4>> {fir.bindc_name = "b"})
11 ! CHECK-NOT: fir.alloc
12 ! CHECK: return
14 subroutine sub2(i)
15 integer :: i(2, 5)
16 end
18 ! CHECK-LABEL: func @_QPsub2(
19 ! CHECK-SAME: %{{.*}}: !fir.ref<!fir.array<2x5xi32>>{{.*}})
21 subroutine sub3(i)
22 real :: i(2)
23 end
25 ! CHECK-LABEL: func @_QPsub3(
26 ! CHECK-SAME: %{{.*}}: !fir.ref<!fir.array<2xf32>>{{.*}})
28 integer function fct1(a, b)
29 integer, intent(in) :: a
30 logical :: b
31 end
33 ! CHECK-LABEL: func @_QPfct1(
34 ! CHECK-SAME: %{{.*}}: !fir.ref<i32> {fir.bindc_name = "a"}, %{{.*}}: !fir.ref<!fir.logical<4>> {fir.bindc_name = "b"}) -> i32
36 real function fct2(i)
37 integer :: i(2, 5)
38 end
40 ! CHECK-LABEL: func @_QPfct2(
41 ! CHECK-SAME: %{{.*}}: !fir.ref<!fir.array<2x5xi32>> {fir.bindc_name = "i"}) -> f32
43 function fct3(i)
44 real :: i(2)
45 end
47 ! CHECK-LABEL: func @_QPfct3(
48 ! CHECK-SAME: %{{.*}}: !fir.ref<!fir.array<2xf32>> {fir.bindc_name = "i"}) -> f32
50 subroutine allocatable_real(x)
51 real, allocatable :: x
52 end
54 ! CHECK-LABEL: func @_QPallocatable_real(
55 ! CHECK-SAME: %{{.*}}: !fir.ref<!fir.box<!fir.heap<f32>>> {fir.bindc_name = "x"}) {