diff --git a/flang/test/HLFIR/boxchar_emboxing.f90 b/flang/test/HLFIR/boxchar_emboxing.f90 --- a/flang/test/HLFIR/boxchar_emboxing.f90 +++ b/flang/test/HLFIR/boxchar_emboxing.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -polymorphic-type -emit-fir -hlfir %s -o - | FileCheck %s +! RUN: bbc -polymorphic-type -emit-hlfir %s -o - | FileCheck %s ! CHECK-LABEL: func.func @_QPtest1( ! CHECK-SAME: %[[VAL_0:.*]]: !fir.class {fir.bindc_name = "x"}) { diff --git a/flang/test/HLFIR/c_ptr_byvalue.f90 b/flang/test/HLFIR/c_ptr_byvalue.f90 --- a/flang/test/HLFIR/c_ptr_byvalue.f90 +++ b/flang/test/HLFIR/c_ptr_byvalue.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -emit-fir -hlfir %s -o - | FileCheck %s +! RUN: bbc -emit-hlfir %s -o - | FileCheck %s ! CHECK-LABEL: func.func @_QPtest1() { ! CHECK: %[[VAL_110:.*]]:3 = hlfir.associate %{{.*}} {uniq_name = "adapt.cptrbyval"} : (!hlfir.expr>) -> (!fir.ref>, !fir.ref>, i1) diff --git a/flang/test/HLFIR/call_with_poly_dummy.f90 b/flang/test/HLFIR/call_with_poly_dummy.f90 --- a/flang/test/HLFIR/call_with_poly_dummy.f90 +++ b/flang/test/HLFIR/call_with_poly_dummy.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -polymorphic-type -emit-fir -hlfir %s -o - | FileCheck %s +! RUN: bbc -polymorphic-type -emit-hlfir %s -o - | FileCheck %s ! Test passing arguments to subprograms with polymorphic dummy arguments. diff --git a/flang/test/HLFIR/extents-of-shape-of.f90 b/flang/test/HLFIR/extents-of-shape-of.f90 --- a/flang/test/HLFIR/extents-of-shape-of.f90 +++ b/flang/test/HLFIR/extents-of-shape-of.f90 @@ -1,5 +1,5 @@ -! RUN: bbc -emit-fir -hlfir %s -o - | FileCheck --check-prefix CHECK-ALL --check-prefix CHECK-HLFIR %s -! RUN: bbc -emit-fir -hlfir %s -o - | fir-opt --lower-hlfir-intrinsics | fir-opt --bufferize-hlfir | fir-opt --convert-hlfir-to-fir | FileCheck --check-prefix CHECK-ALL --check-prefix CHECK-FIR %s +! RUN: bbc -emit-hlfir %s -o - | FileCheck --check-prefix CHECK-ALL --check-prefix CHECK-HLFIR %s +! RUN: bbc -emit-hlfir %s -o - | fir-opt --lower-hlfir-intrinsics | fir-opt --bufferize-hlfir | fir-opt --convert-hlfir-to-fir | FileCheck --check-prefix CHECK-ALL --check-prefix CHECK-FIR %s subroutine foo(a, b) real :: a(2, 2), b(:, :) interface diff --git a/flang/test/HLFIR/flang-experimental-hlfir-flag.f90 b/flang/test/HLFIR/hlfir-flags.f90 rename from flang/test/HLFIR/flang-experimental-hlfir-flag.f90 rename to flang/test/HLFIR/hlfir-flags.f90 --- a/flang/test/HLFIR/flang-experimental-hlfir-flag.f90 +++ b/flang/test/HLFIR/hlfir-flags.f90 @@ -1,15 +1,19 @@ -! Test -flang-experimental-hlfir, -emit-hlfir, -emit-fir flags +! Test -flang-experimental-hlfir (flang-new), -hlfir (bbc), -emit-hlfir, -emit-fir flags ! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s ! RUN: %flang_fc1 -emit-hlfir -flang-experimental-hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s +! RUN: bbc -emit-hlfir -hlfir -o - %s | FileCheck --check-prefix HLFIR --check-prefix ALL %s ! RUN: %flang_fc1 -emit-fir -o - %s | FileCheck %s --check-prefix NO-HLFIR --check-prefix ALL +! RUN: bbc -emit-fir -o - %s | FileCheck %s --check-prefix NO-HLFIR --check-prefix ALL ! RUN: %flang_fc1 -emit-fir -flang-experimental-hlfir -o - %s | FileCheck --check-prefix FIR --check-prefix ALL %s +! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck --check-prefix FIR --check-prefix ALL %s -! | Action | -flang-experimental-hlfir? | Result | -! | =========== | ========================== | =============================== | -! | -emit-hlfir | N | Outputs HLFIR | -! | -emit-hlfir | Y | Outputs HLFIR | -! | -emit-fir | N | Outputs FIR, using old lowering | -! | -emit-fir | Y | Outputs FIR, lowering via HLFIR | +! | Action | -flang-experimental-hlfir / -hlfir? | Result | +! | =========== | =================================== | =============================== | +! | -emit-hlfir | N | Outputs HLFIR | +! | -emit-hlfir | Y | Outputs HLFIR | +! | -emit-fir | N | Outputs FIR, using old lowering | +! | -emit-fir | Y | Outputs FIR, lowering via HLFIR | subroutine test(a, res) real :: a(:), res diff --git a/flang/test/HLFIR/mul_transpose.f90 b/flang/test/HLFIR/mul_transpose.f90 --- a/flang/test/HLFIR/mul_transpose.f90 +++ b/flang/test/HLFIR/mul_transpose.f90 @@ -1,8 +1,8 @@ -! RUN: bbc -emit-fir -hlfir %s -o - | FileCheck --check-prefix CHECK-BASE --check-prefix CHECK-ALL %s -! RUN: bbc -emit-fir -hlfir %s -o - | fir-opt --canonicalize | FileCheck --check-prefix CHECK-CANONICAL --check-prefix CHECK-ALL %s -! RUN: bbc -emit-fir -hlfir %s -o - | fir-opt --lower-hlfir-intrinsics | FileCheck --check-prefix CHECK-LOWERING --check-prefix CHECK-ALL %s -! RUN: bbc -emit-fir -hlfir %s -o - | fir-opt --canonicalize | fir-opt --lower-hlfir-intrinsics | FileCheck --check-prefix CHECK-LOWERING-OPT --check-prefix CHECK-ALL %s -! RUN: bbc -emit-fir -hlfir %s -o - | fir-opt --lower-hlfir-intrinsics | fir-opt --bufferize-hlfir | FileCheck --check-prefix CHECK-BUFFERING --check-prefix CHECK-ALL %s +! RUN: bbc -emit-hlfir %s -o - | FileCheck --check-prefix CHECK-BASE --check-prefix CHECK-ALL %s +! RUN: bbc -emit-hlfir %s -o - | fir-opt --canonicalize | FileCheck --check-prefix CHECK-CANONICAL --check-prefix CHECK-ALL %s +! RUN: bbc -emit-hlfir %s -o - | fir-opt --lower-hlfir-intrinsics | FileCheck --check-prefix CHECK-LOWERING --check-prefix CHECK-ALL %s +! RUN: bbc -emit-hlfir %s -o - | fir-opt --canonicalize | fir-opt --lower-hlfir-intrinsics | FileCheck --check-prefix CHECK-LOWERING-OPT --check-prefix CHECK-ALL %s +! RUN: bbc -emit-hlfir %s -o - | fir-opt --lower-hlfir-intrinsics | fir-opt --bufferize-hlfir | FileCheck --check-prefix CHECK-BUFFERING --check-prefix CHECK-ALL %s ! Test passing a hlfir.expr from one intrinsic to another subroutine mul_transpose(a, b, res) diff --git a/flang/test/HLFIR/optional_dummy.f90 b/flang/test/HLFIR/optional_dummy.f90 --- a/flang/test/HLFIR/optional_dummy.f90 +++ b/flang/test/HLFIR/optional_dummy.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -emit-fir -hlfir %s -o - | FileCheck %s +! RUN: bbc -emit-hlfir %s -o - | FileCheck %s ! Check that the lowering does not generate fir.box_addr for ! the optional box. It will cause segfault during execution. diff --git a/flang/test/Lower/HLFIR/all.f90 b/flang/test/Lower/HLFIR/all.f90 --- a/flang/test/Lower/HLFIR/all.f90 +++ b/flang/test/Lower/HLFIR/all.f90 @@ -1,5 +1,5 @@ ! Test lowering of ALL intrinsic to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! simple 1 argument ALL subroutine all1(a, s) diff --git a/flang/test/Lower/HLFIR/allocatable-and-pointer-components.f90 b/flang/test/Lower/HLFIR/allocatable-and-pointer-components.f90 --- a/flang/test/Lower/HLFIR/allocatable-and-pointer-components.f90 +++ b/flang/test/Lower/HLFIR/allocatable-and-pointer-components.f90 @@ -1,5 +1,5 @@ ! Test lowering of whole allocatable and pointer components to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s -I nw | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s -I nw | FileCheck %s module def_test_types type t1 diff --git a/flang/test/Lower/HLFIR/allocatable-and-pointer-status-change.f90 b/flang/test/Lower/HLFIR/allocatable-and-pointer-status-change.f90 --- a/flang/test/Lower/HLFIR/allocatable-and-pointer-status-change.f90 +++ b/flang/test/Lower/HLFIR/allocatable-and-pointer-status-change.f90 @@ -1,6 +1,6 @@ ! Test lowering of allocate, deallocate and pointer assignment statements to ! HLFIR. -! RUN: bbc -emit-fir -hlfir -o - %s -I nw | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s -I nw | FileCheck %s subroutine allocation(x) character(*), allocatable :: x(:) diff --git a/flang/test/Lower/HLFIR/allocatable-and-pointer-subparts.f90 b/flang/test/Lower/HLFIR/allocatable-and-pointer-subparts.f90 --- a/flang/test/Lower/HLFIR/allocatable-and-pointer-subparts.f90 +++ b/flang/test/Lower/HLFIR/allocatable-and-pointer-subparts.f90 @@ -3,7 +3,7 @@ ! be inserted and addressed in a following hlfir.designate to address ! the sub-part. -! RUN: bbc -emit-fir -hlfir -o - %s -I nw | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s -I nw | FileCheck %s module m type t1 diff --git a/flang/test/Lower/HLFIR/allocatables-and-pointers.f90 b/flang/test/Lower/HLFIR/allocatables-and-pointers.f90 --- a/flang/test/Lower/HLFIR/allocatables-and-pointers.f90 +++ b/flang/test/Lower/HLFIR/allocatables-and-pointers.f90 @@ -1,5 +1,5 @@ ! Test lowering of whole allocatable and pointers to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine passing_allocatable(x) interface diff --git a/flang/test/Lower/HLFIR/any.f90 b/flang/test/Lower/HLFIR/any.f90 --- a/flang/test/Lower/HLFIR/any.f90 +++ b/flang/test/Lower/HLFIR/any.f90 @@ -1,5 +1,5 @@ ! Test lowering of ANY intrinsic to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! simple 1 argument ANY subroutine any1(a, s) logical :: a(:), s diff --git a/flang/test/Lower/HLFIR/array-ctor-as-elemental-nested.f90 b/flang/test/Lower/HLFIR/array-ctor-as-elemental-nested.f90 --- a/flang/test/Lower/HLFIR/array-ctor-as-elemental-nested.f90 +++ b/flang/test/Lower/HLFIR/array-ctor-as-elemental-nested.f90 @@ -1,5 +1,5 @@ ! Test lowering of nested array constructors as hlfir.elemental. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s ! hlfir.end_associate and hlfir.destroy used to be generated ! after hlfir.yield_element for the outermost hlfir.elemental. diff --git a/flang/test/Lower/HLFIR/array-ctor-as-elemental.f90 b/flang/test/Lower/HLFIR/array-ctor-as-elemental.f90 --- a/flang/test/Lower/HLFIR/array-ctor-as-elemental.f90 +++ b/flang/test/Lower/HLFIR/array-ctor-as-elemental.f90 @@ -1,5 +1,5 @@ ! Test lowering of array constructors as hlfir.elemental. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test_as_simple_elemental(n) integer :: n diff --git a/flang/test/Lower/HLFIR/array-ctor-as-inlined-temp.f90 b/flang/test/Lower/HLFIR/array-ctor-as-inlined-temp.f90 --- a/flang/test/Lower/HLFIR/array-ctor-as-inlined-temp.f90 +++ b/flang/test/Lower/HLFIR/array-ctor-as-inlined-temp.f90 @@ -1,5 +1,5 @@ ! Test lowering of array constructors as inlined temporary. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test_simple(i) call takes_int([42, i]) diff --git a/flang/test/Lower/HLFIR/array-ctor-as-runtime-temp.f90 b/flang/test/Lower/HLFIR/array-ctor-as-runtime-temp.f90 --- a/flang/test/Lower/HLFIR/array-ctor-as-runtime-temp.f90 +++ b/flang/test/Lower/HLFIR/array-ctor-as-runtime-temp.f90 @@ -1,5 +1,5 @@ ! Test lowering of array constructors requiring runtime library help to HLFIR. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s module arrayctor contains diff --git a/flang/test/Lower/HLFIR/array-ctor-character.f90 b/flang/test/Lower/HLFIR/array-ctor-character.f90 --- a/flang/test/Lower/HLFIR/array-ctor-character.f90 +++ b/flang/test/Lower/HLFIR/array-ctor-character.f90 @@ -1,5 +1,5 @@ ! Test lowering of character array constructors to HLFIR. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s module chararrayctor character(3), target :: ctarg1 = "abc" diff --git a/flang/test/Lower/HLFIR/array-ctor-derived.f90 b/flang/test/Lower/HLFIR/array-ctor-derived.f90 --- a/flang/test/Lower/HLFIR/array-ctor-derived.f90 +++ b/flang/test/Lower/HLFIR/array-ctor-derived.f90 @@ -1,5 +1,5 @@ ! Test lowering of derived type array constructors to HLFIR. -! RUN: bbc -emit-fir -hlfir --polymorphic-type -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir --polymorphic-type -o - %s | FileCheck %s module types type simple diff --git a/flang/test/Lower/HLFIR/array-ctor-index.f90 b/flang/test/Lower/HLFIR/array-ctor-index.f90 --- a/flang/test/Lower/HLFIR/array-ctor-index.f90 +++ b/flang/test/Lower/HLFIR/array-ctor-index.f90 @@ -1,5 +1,5 @@ ! Check that the implied-do index value is converted to proper type. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s function test1(k) integer*1 :: k diff --git a/flang/test/Lower/HLFIR/assignment-intrinsics.f90 b/flang/test/Lower/HLFIR/assignment-intrinsics.f90 --- a/flang/test/Lower/HLFIR/assignment-intrinsics.f90 +++ b/flang/test/Lower/HLFIR/assignment-intrinsics.f90 @@ -1,5 +1,5 @@ ! Test lowering of intrinsic assignments to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! ----------------------------------------------------------------------------- ! Test assignments with scalar variable LHS and RHS diff --git a/flang/test/Lower/HLFIR/associate-construct.f90 b/flang/test/Lower/HLFIR/associate-construct.f90 --- a/flang/test/Lower/HLFIR/associate-construct.f90 +++ b/flang/test/Lower/HLFIR/associate-construct.f90 @@ -1,5 +1,5 @@ ! Test lowering of associate construct to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine associate_expr(x) integer :: x(:) diff --git a/flang/test/Lower/HLFIR/binary-ops.f90 b/flang/test/Lower/HLFIR/binary-ops.f90 --- a/flang/test/Lower/HLFIR/binary-ops.f90 +++ b/flang/test/Lower/HLFIR/binary-ops.f90 @@ -1,5 +1,5 @@ ! Test lowering of binary intrinsic operations to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine int_add(x, y, z) integer :: x, y, z diff --git a/flang/test/Lower/HLFIR/c_ptr-constant-init.f90 b/flang/test/Lower/HLFIR/c_ptr-constant-init.f90 --- a/flang/test/Lower/HLFIR/c_ptr-constant-init.f90 +++ b/flang/test/Lower/HLFIR/c_ptr-constant-init.f90 @@ -1,5 +1,5 @@ ! Test creation of outlined literal array with c_ptr/c_funptr elements. -! RUN: bbc -hlfir -emit-fir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test use, intrinsic :: iso_c_binding diff --git a/flang/test/Lower/HLFIR/calls-assumed-shape.f90 b/flang/test/Lower/HLFIR/calls-assumed-shape.f90 --- a/flang/test/Lower/HLFIR/calls-assumed-shape.f90 +++ b/flang/test/Lower/HLFIR/calls-assumed-shape.f90 @@ -1,6 +1,6 @@ ! Test lowering of calls involving assumed shape arrays or arrays with ! VALUE attribute. -! RUN: bbc -emit-fir -hlfir -polymorphic-type -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -polymorphic-type -o - %s | FileCheck %s subroutine test_assumed_to_assumed(x) interface diff --git a/flang/test/Lower/HLFIR/calls-character-singleton-result.f90 b/flang/test/Lower/HLFIR/calls-character-singleton-result.f90 --- a/flang/test/Lower/HLFIR/calls-character-singleton-result.f90 +++ b/flang/test/Lower/HLFIR/calls-character-singleton-result.f90 @@ -2,7 +2,7 @@ ! This is a special case because characters are always returned ! or handled in memory otherwise. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine scalar_char(c, i) character(1) :: c diff --git a/flang/test/Lower/HLFIR/calls-constant-expr-arg-polymorphic.f90 b/flang/test/Lower/HLFIR/calls-constant-expr-arg-polymorphic.f90 --- a/flang/test/Lower/HLFIR/calls-constant-expr-arg-polymorphic.f90 +++ b/flang/test/Lower/HLFIR/calls-constant-expr-arg-polymorphic.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -emit-fir -hlfir --polymorphic-type -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir --polymorphic-type -o - %s | FileCheck %s ! Test when constant argument are copied in memory ! and passed to polymorphic arguments. diff --git a/flang/test/Lower/HLFIR/calls-constant-expr-arg.f90 b/flang/test/Lower/HLFIR/calls-constant-expr-arg.f90 --- a/flang/test/Lower/HLFIR/calls-constant-expr-arg.f90 +++ b/flang/test/Lower/HLFIR/calls-constant-expr-arg.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s ! Test that the constant array expression actual argument ! is placed into a temporary inside 'test' subroutine before diff --git a/flang/test/Lower/HLFIR/calls-f77.f90 b/flang/test/Lower/HLFIR/calls-f77.f90 --- a/flang/test/Lower/HLFIR/calls-f77.f90 +++ b/flang/test/Lower/HLFIR/calls-f77.f90 @@ -1,5 +1,5 @@ ! Test lowering of F77 calls to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! ----------------------------------------------------------------------------- ! Test lowering of F77 procedure reference arguments diff --git a/flang/test/Lower/HLFIR/calls-optional.f90 b/flang/test/Lower/HLFIR/calls-optional.f90 --- a/flang/test/Lower/HLFIR/calls-optional.f90 +++ b/flang/test/Lower/HLFIR/calls-optional.f90 @@ -2,7 +2,7 @@ ! that is syntactically present, but may be absent at runtime (is ! an optional or a pointer/allocatable). ! -! RUN: bbc -emit-fir -hlfir -polymorphic-type -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -polymorphic-type -o - %s | FileCheck %s subroutine optional_copy_in_out(x) interface diff --git a/flang/test/Lower/HLFIR/concat.f90 b/flang/test/Lower/HLFIR/concat.f90 --- a/flang/test/Lower/HLFIR/concat.f90 +++ b/flang/test/Lower/HLFIR/concat.f90 @@ -1,5 +1,5 @@ ! Test lowering of character concatenation to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine concat(c1, c2, c3) character(*) :: c1, c2, c3 diff --git a/flang/test/Lower/HLFIR/constant-derived.f90 b/flang/test/Lower/HLFIR/constant-derived.f90 --- a/flang/test/Lower/HLFIR/constant-derived.f90 +++ b/flang/test/Lower/HLFIR/constant-derived.f90 @@ -1,5 +1,5 @@ ! Test lowering of Constant. -! RUN: bbc -hlfir -emit-fir -o - -I nowhere %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - -I nowhere %s 2>&1 | FileCheck %s subroutine test_constant_scalar() type myderived diff --git a/flang/test/Lower/HLFIR/constant.f90 b/flang/test/Lower/HLFIR/constant.f90 --- a/flang/test/Lower/HLFIR/constant.f90 +++ b/flang/test/Lower/HLFIR/constant.f90 @@ -1,5 +1,5 @@ ! Test lowering of Constant. -! RUN: bbc -hlfir -emit-fir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! CHECK-LABEL: func.func @_QPtest_constant_scalar() subroutine test_constant_scalar() diff --git a/flang/test/Lower/HLFIR/conversion-ops.f90 b/flang/test/Lower/HLFIR/conversion-ops.f90 --- a/flang/test/Lower/HLFIR/conversion-ops.f90 +++ b/flang/test/Lower/HLFIR/conversion-ops.f90 @@ -1,5 +1,5 @@ ! Test lowering of intrinsic conversions to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine test integer(4) :: i4 diff --git a/flang/test/Lower/HLFIR/convert-variable.f90 b/flang/test/Lower/HLFIR/convert-variable.f90 --- a/flang/test/Lower/HLFIR/convert-variable.f90 +++ b/flang/test/Lower/HLFIR/convert-variable.f90 @@ -1,5 +1,5 @@ ! Test lowering of variables to fir.declare -! RUN: bbc -emit-fir -hlfir %s -o - | FileCheck %s +! RUN: bbc -emit-hlfir %s -o - | FileCheck %s subroutine scalar_numeric(x) integer :: x diff --git a/flang/test/Lower/HLFIR/descriptor-inquiries.f90 b/flang/test/Lower/HLFIR/descriptor-inquiries.f90 --- a/flang/test/Lower/HLFIR/descriptor-inquiries.f90 +++ b/flang/test/Lower/HLFIR/descriptor-inquiries.f90 @@ -1,7 +1,7 @@ ! Test lowering of extent and lower bound inquires that ! come in lowering as evaluate::DescriptorInquiry. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test_assumed_shape(x, r) integer(8) :: r diff --git a/flang/test/Lower/HLFIR/designators-component-ref.f90 b/flang/test/Lower/HLFIR/designators-component-ref.f90 --- a/flang/test/Lower/HLFIR/designators-component-ref.f90 +++ b/flang/test/Lower/HLFIR/designators-component-ref.f90 @@ -1,5 +1,5 @@ ! Test lowering of component reference to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s module comp_ref type t1 integer :: scalar_i diff --git a/flang/test/Lower/HLFIR/designators.f90 b/flang/test/Lower/HLFIR/designators.f90 --- a/flang/test/Lower/HLFIR/designators.f90 +++ b/flang/test/Lower/HLFIR/designators.f90 @@ -1,5 +1,5 @@ ! Test lowering of designators to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine array_ref(x, n) real :: x(:) diff --git a/flang/test/Lower/HLFIR/dummy-argument-optional.f90 b/flang/test/Lower/HLFIR/dummy-argument-optional.f90 --- a/flang/test/Lower/HLFIR/dummy-argument-optional.f90 +++ b/flang/test/Lower/HLFIR/dummy-argument-optional.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s ! Test OPTIONAL lowering on caller/callee module opt diff --git a/flang/test/Lower/HLFIR/elemental-array-ops.f90 b/flang/test/Lower/HLFIR/elemental-array-ops.f90 --- a/flang/test/Lower/HLFIR/elemental-array-ops.f90 +++ b/flang/test/Lower/HLFIR/elemental-array-ops.f90 @@ -1,5 +1,5 @@ ! Test lowering of elemental intrinsic operations with array arguments to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine binary(x, y) integer :: x(100), y(100) diff --git a/flang/test/Lower/HLFIR/elemental-intrinsics.f90 b/flang/test/Lower/HLFIR/elemental-intrinsics.f90 --- a/flang/test/Lower/HLFIR/elemental-intrinsics.f90 +++ b/flang/test/Lower/HLFIR/elemental-intrinsics.f90 @@ -2,7 +2,7 @@ ! The goal here is not to test every intrinsics, it is to test the ! lowering framework for elemental intrinsics. This test various ! intrinsics that have different number or arguments and argument types. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine simple_elemental(x,y) real :: x(100), y(100) diff --git a/flang/test/Lower/HLFIR/elemental-user-procedure-ref-polymorphic.f90 b/flang/test/Lower/HLFIR/elemental-user-procedure-ref-polymorphic.f90 --- a/flang/test/Lower/HLFIR/elemental-user-procedure-ref-polymorphic.f90 +++ b/flang/test/Lower/HLFIR/elemental-user-procedure-ref-polymorphic.f90 @@ -1,6 +1,6 @@ ! Test lowering of user defined elemental procedure reference to HLFIR ! With polymorphic arguments. -! RUN: bbc -emit-fir -hlfir -I nw -polymorphic-type -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -I nw -polymorphic-type -o - %s 2>&1 | FileCheck %s module def_some_types type :: t integer :: i diff --git a/flang/test/Lower/HLFIR/elemental-user-procedure-ref.f90 b/flang/test/Lower/HLFIR/elemental-user-procedure-ref.f90 --- a/flang/test/Lower/HLFIR/elemental-user-procedure-ref.f90 +++ b/flang/test/Lower/HLFIR/elemental-user-procedure-ref.f90 @@ -1,5 +1,5 @@ ! Test lowering of user defined elemental procedure reference to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine by_addr(x, y) integer :: x diff --git a/flang/test/Lower/HLFIR/expr-addr.f90 b/flang/test/Lower/HLFIR/expr-addr.f90 --- a/flang/test/Lower/HLFIR/expr-addr.f90 +++ b/flang/test/Lower/HLFIR/expr-addr.f90 @@ -1,5 +1,5 @@ ! Test lowering of of expressions as address -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! CHECK-LABEL: func.func @_QPfoo( ! CHECK-SAME: %[[arg0:.*]]: !fir.ref diff --git a/flang/test/Lower/HLFIR/expr-as-inquired.f90 b/flang/test/Lower/HLFIR/expr-as-inquired.f90 --- a/flang/test/Lower/HLFIR/expr-as-inquired.f90 +++ b/flang/test/Lower/HLFIR/expr-as-inquired.f90 @@ -1,7 +1,7 @@ ! Test lowering to HLFIR of the intrinsic lowering framework ! "asInquired" option. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test_isAllocated(x, l) logical :: l diff --git a/flang/test/Lower/HLFIR/expr-value.f90 b/flang/test/Lower/HLFIR/expr-value.f90 --- a/flang/test/Lower/HLFIR/expr-value.f90 +++ b/flang/test/Lower/HLFIR/expr-value.f90 @@ -1,5 +1,5 @@ ! Test lowering of of expressions as values -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! CHECK-LABEL: func.func @_QPfoo() subroutine foo() diff --git a/flang/test/Lower/HLFIR/function-return.f90 b/flang/test/Lower/HLFIR/function-return.f90 --- a/flang/test/Lower/HLFIR/function-return.f90 +++ b/flang/test/Lower/HLFIR/function-return.f90 @@ -1,5 +1,5 @@ ! Test lowering of function return to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s integer function simple_return() simple_return = 42 diff --git a/flang/test/Lower/HLFIR/ignore-rank-unlimited-polymorphic.f90 b/flang/test/Lower/HLFIR/ignore-rank-unlimited-polymorphic.f90 --- a/flang/test/Lower/HLFIR/ignore-rank-unlimited-polymorphic.f90 +++ b/flang/test/Lower/HLFIR/ignore-rank-unlimited-polymorphic.f90 @@ -1,6 +1,6 @@ ! Test passing mismatching rank arguments to unlimited polymorphic ! dummy with IGNORE_TKR(R). -! RUN: bbc -hlfir -emit-fir -polymorphic-type -o - -I nowhere %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -polymorphic-type -o - -I nowhere %s 2>&1 | FileCheck %s module m interface diff --git a/flang/test/Lower/HLFIR/implicit-call-mismatch.f90 b/flang/test/Lower/HLFIR/implicit-call-mismatch.f90 --- a/flang/test/Lower/HLFIR/implicit-call-mismatch.f90 +++ b/flang/test/Lower/HLFIR/implicit-call-mismatch.f90 @@ -2,7 +2,7 @@ ! Lowering must close the eyes and do as if it did not know ! about the function definition since semantic lets these ! programs through with a warning. -! RUN: bbc -emit-fir -hlfir %s -o - | FileCheck %s +! RUN: bbc -emit-hlfir %s -o - | FileCheck %s subroutine takes_char(c) character(8) :: c diff --git a/flang/test/Lower/HLFIR/implicit-type-conversion.f90 b/flang/test/Lower/HLFIR/implicit-type-conversion.f90 --- a/flang/test/Lower/HLFIR/implicit-type-conversion.f90 +++ b/flang/test/Lower/HLFIR/implicit-type-conversion.f90 @@ -1,4 +1,4 @@ -! RUN: bbc -emit-fir -hlfir %s -o - | FileCheck %s +! RUN: bbc -emit-hlfir %s -o - | FileCheck %s ! CHECK-LABEL: func.func @_QPtest1( ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref {fir.bindc_name = "x"}, diff --git a/flang/test/Lower/HLFIR/internal-procedures.f90 b/flang/test/Lower/HLFIR/internal-procedures.f90 --- a/flang/test/Lower/HLFIR/internal-procedures.f90 +++ b/flang/test/Lower/HLFIR/internal-procedures.f90 @@ -1,6 +1,6 @@ ! Test captured variables instantiation inside internal procedures ! when lowering to HLFIR. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test_explicit_shape_array(x, n) integer(8) :: n real :: x(n) diff --git a/flang/test/Lower/HLFIR/intrinsic-assumed-type.f90 b/flang/test/Lower/HLFIR/intrinsic-assumed-type.f90 --- a/flang/test/Lower/HLFIR/intrinsic-assumed-type.f90 +++ b/flang/test/Lower/HLFIR/intrinsic-assumed-type.f90 @@ -2,7 +2,7 @@ ! arguments. These are a bit special because semantics do not represent ! assumed types actual arguments with an evaluate::Expr like for usual ! arguments. -! RUN: bbc -emit-fir -hlfir --polymorphic-type -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir --polymorphic-type -o - %s | FileCheck %s subroutine assumed_type_to_intrinsic(a) type(*) :: a(:) diff --git a/flang/test/Lower/HLFIR/intrinsic-module-procedures.f90 b/flang/test/Lower/HLFIR/intrinsic-module-procedures.f90 --- a/flang/test/Lower/HLFIR/intrinsic-module-procedures.f90 +++ b/flang/test/Lower/HLFIR/intrinsic-module-procedures.f90 @@ -3,7 +3,7 @@ ! it only tests that the HFLIR procedure reference lowering ! infrastructure properly detects and dispatches intrinsic module ! procedure calls. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine foo(cptr, x) use iso_c_binding, only : c_ptr, c_loc diff --git a/flang/test/Lower/HLFIR/intrinsic-subroutines.f90 b/flang/test/Lower/HLFIR/intrinsic-subroutines.f90 --- a/flang/test/Lower/HLFIR/intrinsic-subroutines.f90 +++ b/flang/test/Lower/HLFIR/intrinsic-subroutines.f90 @@ -1,7 +1,7 @@ ! Test lowering of intrinsic subroutines to HLFIR what matters here ! is not to test each subroutine, but to check how their ! lowering interfaces with the rest of lowering. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test_subroutine(x) real :: x diff --git a/flang/test/Lower/HLFIR/matmul.f90 b/flang/test/Lower/HLFIR/matmul.f90 --- a/flang/test/Lower/HLFIR/matmul.f90 +++ b/flang/test/Lower/HLFIR/matmul.f90 @@ -1,5 +1,5 @@ ! Test lowering of MATMUL intrinsic to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine matmul1(lhs, rhs, res) integer :: lhs(:,:), rhs(:,:), res(:,:) diff --git a/flang/test/Lower/HLFIR/null.f90 b/flang/test/Lower/HLFIR/null.f90 --- a/flang/test/Lower/HLFIR/null.f90 +++ b/flang/test/Lower/HLFIR/null.f90 @@ -1,5 +1,5 @@ ! Test lowering of NULL(MOLD) to HLFIR. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test1(mold) integer, pointer :: mold(:) interface diff --git a/flang/test/Lower/HLFIR/parent-component-ref.f90 b/flang/test/Lower/HLFIR/parent-component-ref.f90 --- a/flang/test/Lower/HLFIR/parent-component-ref.f90 +++ b/flang/test/Lower/HLFIR/parent-component-ref.f90 @@ -1,5 +1,5 @@ ! Test lowering of parent component references to HLFIR. -! RUN: bbc -emit-fir -hlfir -polymorphic-type -o - %s -I nw | FileCheck %s +! RUN: bbc -emit-hlfir -polymorphic-type -o - %s -I nw | FileCheck %s module pc_types type t diff --git a/flang/test/Lower/HLFIR/procedure-designators.f90 b/flang/test/Lower/HLFIR/procedure-designators.f90 --- a/flang/test/Lower/HLFIR/procedure-designators.f90 +++ b/flang/test/Lower/HLFIR/procedure-designators.f90 @@ -1,5 +1,5 @@ ! Test lowering of procedure designators to HLFIR. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s module test_proc_designator interface diff --git a/flang/test/Lower/HLFIR/product.f90 b/flang/test/Lower/HLFIR/product.f90 --- a/flang/test/Lower/HLFIR/product.f90 +++ b/flang/test/Lower/HLFIR/product.f90 @@ -1,5 +1,5 @@ ! Test lowering of PRODUCT intrinsic to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! simple 1 argument PRODUCT subroutine product1(a, s) diff --git a/flang/test/Lower/HLFIR/statement-functions.f90 b/flang/test/Lower/HLFIR/statement-functions.f90 --- a/flang/test/Lower/HLFIR/statement-functions.f90 +++ b/flang/test/Lower/HLFIR/statement-functions.f90 @@ -1,5 +1,5 @@ ! Test lowering of statement functions to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine numeric_test(x) integer :: x(:), i, stmt_func diff --git a/flang/test/Lower/HLFIR/structure-constructor.f90 b/flang/test/Lower/HLFIR/structure-constructor.f90 --- a/flang/test/Lower/HLFIR/structure-constructor.f90 +++ b/flang/test/Lower/HLFIR/structure-constructor.f90 @@ -1,5 +1,5 @@ ! Test lowering of StructureConstructor. -! RUN: bbc -hlfir -emit-fir -o - -I nowhere %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - -I nowhere %s 2>&1 | FileCheck %s module types type t1 diff --git a/flang/test/Lower/HLFIR/substrings.f90 b/flang/test/Lower/HLFIR/substrings.f90 --- a/flang/test/Lower/HLFIR/substrings.f90 +++ b/flang/test/Lower/HLFIR/substrings.f90 @@ -1,7 +1,7 @@ ! Test lowering of substrings to HLFIR ! Note: cse is run to make the expected output more readable by sharing ! the boilerplate between the different susbtring cases. -! RUN: bbc -emit-fir -hlfir -o - %s | fir-opt -cse -o - | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | fir-opt -cse -o - | FileCheck %s ! CHECK-LABEL: func.func @_QPcst_len( subroutine cst_len(array, scalar) diff --git a/flang/test/Lower/HLFIR/sum.f90 b/flang/test/Lower/HLFIR/sum.f90 --- a/flang/test/Lower/HLFIR/sum.f90 +++ b/flang/test/Lower/HLFIR/sum.f90 @@ -1,5 +1,5 @@ ! Test lowering of SUM intrinsic to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s ! simple 1 argument SUM subroutine sum1(a, s) diff --git a/flang/test/Lower/HLFIR/transformational.f90 b/flang/test/Lower/HLFIR/transformational.f90 --- a/flang/test/Lower/HLFIR/transformational.f90 +++ b/flang/test/Lower/HLFIR/transformational.f90 @@ -1,7 +1,7 @@ ! Test lowering of transformational intrinsic to HLFIR what matters here ! is not to test each transformational, but to check how their ! lowering interfaces with the rest of lowering. -! RUN: bbc -emit-fir -hlfir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s subroutine test_transformational_implemented_with_runtime_allocation(x) real :: x(10, 10) diff --git a/flang/test/Lower/HLFIR/transpose.f90 b/flang/test/Lower/HLFIR/transpose.f90 --- a/flang/test/Lower/HLFIR/transpose.f90 +++ b/flang/test/Lower/HLFIR/transpose.f90 @@ -1,5 +1,5 @@ ! Test lowering of TRANSPOSE intrinsic to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine transpose1(m, res) integer :: m(1,2), res(2, 1) diff --git a/flang/test/Lower/HLFIR/unary-ops.f90 b/flang/test/Lower/HLFIR/unary-ops.f90 --- a/flang/test/Lower/HLFIR/unary-ops.f90 +++ b/flang/test/Lower/HLFIR/unary-ops.f90 @@ -1,5 +1,5 @@ ! Test lowering of unary intrinsic operations to HLFIR -! RUN: bbc -emit-fir -hlfir -o - %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s 2>&1 | FileCheck %s subroutine parentheses_numeric_var(x) integer :: x diff --git a/flang/test/Lower/HLFIR/vector-subscript-as-value.f90 b/flang/test/Lower/HLFIR/vector-subscript-as-value.f90 --- a/flang/test/Lower/HLFIR/vector-subscript-as-value.f90 +++ b/flang/test/Lower/HLFIR/vector-subscript-as-value.f90 @@ -1,6 +1,6 @@ ! Test lowering of vector subscript designators outside of the ! assignment left-and side and input IO context. -! RUN: bbc -emit-fir -hlfir -o - -I nw %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - -I nw %s 2>&1 | FileCheck %s subroutine foo(x, y) integer :: x(100) diff --git a/flang/test/Lower/HLFIR/vector-subscript-lhs.f90 b/flang/test/Lower/HLFIR/vector-subscript-lhs.f90 --- a/flang/test/Lower/HLFIR/vector-subscript-lhs.f90 +++ b/flang/test/Lower/HLFIR/vector-subscript-lhs.f90 @@ -1,6 +1,6 @@ ! Test lowering of vector subscripted designators in assignment ! left-hand sides. -! RUN: bbc -emit-fir -hlfir -o - -I nw %s 2>&1 | FileCheck %s +! RUN: bbc -emit-hlfir -o - -I nw %s 2>&1 | FileCheck %s subroutine test_simple(x, vector) integer(8) :: vector(10) diff --git a/flang/test/Lower/HLFIR/where.f90 b/flang/test/Lower/HLFIR/where.f90 --- a/flang/test/Lower/HLFIR/where.f90 +++ b/flang/test/Lower/HLFIR/where.f90 @@ -1,5 +1,5 @@ ! Test lowering of WHERE construct and statements to HLFIR. -! RUN: bbc --hlfir -emit-fir -o - %s | FileCheck %s +! RUN: bbc -emit-hlfir -o - %s | FileCheck %s module where_defs logical :: mask(10) diff --git a/flang/tools/bbc/bbc.cpp b/flang/tools/bbc/bbc.cpp --- a/flang/tools/bbc/bbc.cpp +++ b/flang/tools/bbc/bbc.cpp @@ -103,6 +103,11 @@ llvm::cl::desc("Dump the FIR created by lowering and exit"), llvm::cl::init(false)); +static llvm::cl::opt + emitHLFIR("emit-hlfir", + llvm::cl::desc("Dump the HLFIR created by lowering and exit"), + llvm::cl::init(false)); + static llvm::cl::opt warnStdViolation("Mstandard", llvm::cl::desc("emit warnings"), llvm::cl::init(false)); @@ -274,7 +279,7 @@ // Use default lowering options for bbc. Fortran::lower::LoweringOptions loweringOptions{}; loweringOptions.setPolymorphicTypeImpl(enablePolymorphic); - loweringOptions.setLowerToHighLevelFIR(useHLFIR); + loweringOptions.setLowerToHighLevelFIR(useHLFIR || emitHLFIR); auto burnside = Fortran::lower::LoweringBridge::create( ctx, semanticsContext, defKinds, semanticsContext.intrinsics(), semanticsContext.targetCharacteristics(), parsing.allCooked(), "", @@ -311,7 +316,7 @@ mlir::emitError(mlir::UnknownLoc::get(&ctx)) << msg; return mlir::failure(); }); - } else if (emitFIR) { + } else if (emitFIR || emitHLFIR) { // --emit-fir: Build the IR, verify it, and dump the IR if the IR passes // verification. Use --dump-module-on-failure to dump invalid IR. pm.addPass(std::make_unique()); @@ -319,6 +324,16 @@ llvm::errs() << "FATAL: verification of lowering to FIR failed"; return mlir::failure(); } + + if (emitFIR && useHLFIR) { + // lower HLFIR to FIR + fir::createHLFIRToFIRPassPipeline(pm, llvm::OptimizationLevel::O2); + if (mlir::failed(pm.run(mlirModule))) { + llvm::errs() << "FATAL: lowering from HLFIR to FIR failed"; + return mlir::failure(); + } + } + printModule(mlirModule, out); return mlir::success(); } else {