Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / HLFIR / expr-value.f90
blob2beb9749ad79c3d51d3f9ab189395f2b469f2272
1 ! Test lowering of of expressions as values
2 ! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s
4 ! CHECK-LABEL: func.func @_QPfoo()
5 subroutine foo()
6 print *, 42
7 ! CHECK: %[[c42:.*]] = arith.constant 42 : i32
8 ! CHECK: fir.call @_FortranAioOutputInteger32(%{{.*}}, %[[c42]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
9 end subroutine
11 ! CHECK-LABEL: func.func @_QPfoo_designator(
12 ! CHECK-SAME: %[[arg0:.*]]: !fir.ref<i32>
13 subroutine foo_designator(n)
14 !CHECK: %[[n:.*]]:2 = hlfir.declare %[[arg0]] {uniq_name = "_QFfoo_designatorEn"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
15 print *, n
16 ! CHECK: %[[nval:.*]] = fir.load %[[n]]#1 : !fir.ref<i32>
17 ! CHECK: fir.call @_FortranAioOutputInteger32(%{{.*}}, %[[nval]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
18 end subroutine