Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flang/test/Driver/compiler-options.f90
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
! RUN: %flang -S -emit-llvm -flang-deprecated-no-hlfir -o - %s | FileCheck %s
! RUN: %flang -S -emit-llvm -o - %s | FileCheck %s
! Test communication of COMPILER_OPTIONS from flang to flang -fc1.
! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang{{(\.exe)?}} {{.*}}-S -emit-llvm -flang-deprecated-no-hlfir -o - {{.*}}compiler-options.f90"
! CHECK: [[OPTSVAR:@_QQclX[0-9a-f]+]] = {{[a-z]+}} constant [[[OPTSLEN:[0-9]+]] x i8] c"{{.*}}flang{{(\.exe)?}} {{.*}}-S -emit-llvm -o - {{.*}}compiler-options.f90"
program main
use ISO_FORTRAN_ENV, only: compiler_options
implicit none
character (len = :), allocatable :: v
! CHECK: call void @llvm.memmove.p0.p0.i64(ptr %{{[0-9]+}}, ptr [[OPTSVAR]], i64 [[OPTSLEN]], i1 false)
! CHECK: store { ptr, i64, i32, i8, i8, i8, i8 } { ptr [[OPTSVAR]], i64 [[OPTSLEN]],
v = compiler_options()
print *, v
deallocate(v)
Expand Down
2 changes: 0 additions & 2 deletions flang/test/Driver/frontend-forwarding.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
! RUN: -fpass-plugin=Bye%pluginext \
! RUN: -fversion-loops-for-stride \
! RUN: -flang-experimental-hlfir \
! RUN: -flang-deprecated-no-hlfir \
! RUN: -fno-ppc-native-vector-element-order \
! RUN: -fppc-native-vector-element-order \
! RUN: -mllvm -print-before-all \
Expand Down Expand Up @@ -50,7 +49,6 @@
! CHECK: "-fpass-plugin=Bye
! CHECK: "-fversion-loops-for-stride"
! CHECK: "-flang-experimental-hlfir"
! CHECK: "-flang-deprecated-no-hlfir"
! CHECK: "-fno-ppc-native-vector-element-order"
! CHECK: "-fppc-native-vector-element-order"
! CHECK: "-Rpass"
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Driver/optimization-remark.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
! and -Rpass-analysis)
! loop-delete isn't enabled at O0 so we use at least O1

! DEFINE: %{output} = -emit-llvm -flang-deprecated-no-hlfir -o /dev/null 2>&1
! DEFINE: %{output} = -emit-llvm -o /dev/null 2>&1

! Check fc1 can handle -Rpass
! RUN: %flang_fc1 %s -O1 -vectorize-loops -Rpass %{output} 2>&1 | FileCheck %s --check-prefix=REMARKS
Expand Down
18 changes: 5 additions & 13 deletions flang/test/HLFIR/hlfir-flags.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
! RUN: %flang_fc1 -emit-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 --check-prefix FIR --check-prefix ALL %s
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -o - %s | FileCheck %s --check-prefix NO-HLFIR --check-prefix ALL
! RUN: %flang_fc1 -emit-fir -flang-experimental-hlfir -o - %s | FileCheck %s --check-prefix FIR --check-prefix ALL
! RUN: bbc -emit-fir -o - %s | FileCheck --check-prefix FIR --check-prefix ALL %s
! RUN: bbc -emit-fir -hlfir=false -o - %s | FileCheck %s --check-prefix NO-HLFIR --check-prefix ALL

! | Action | -flang-deprecated-no-hlfir | Result |
! | | / -hlfir=false? | |
! | =========== | =========================== | =============================== |
! | -emit-hlfir | N | Outputs HLFIR |
! | -emit-hlfir | Y | Outputs HLFIR |
! | -emit-fir | N | Outputs FIR, lowering via HLFIR |
! | -emit-fir | Y | Outputs FIR, using old lowering |
! | Action | Result |
! | | |
! | =========== | =============================== |
! | -emit-hlfir | Outputs HLFIR |
! | -emit-fir | Outputs FIR, lowering via HLFIR |

subroutine test(a, res)
real :: a(:), res
Expand All @@ -27,18 +23,14 @@ subroutine test(a, res)
! ALL: %[[RES:.*]]: !fir.ref<f32>

! HLFIR: %[[A_VAR:.*]]:2 = hlfir.declare %[[A]]
! fir.declare is only generated via the hlfir -> fir lowering
! FIR: %[[A_VAR:.*]] = fir.declare %[[A]]
! NO-HLFIR-NOT: fir.declare

! HLFIR-DAG: %[[RES_VAR:.*]]:2 = hlfir.declare %[[RES]]
! FIR: %[[RES_VAR:.*]] = fir.declare %[[RES]]
! NO-HLFIR-NOT: fir.declare

! HLFIR-NEXT: %[[SUM_RES:.*]] = hlfir.sum %[[A_VAR]]#0
! HLFIR-NEXT: hlfir.assign %[[SUM_RES]] to %[[RES_VAR]]#0
! FIR-NOT: hlfir.
! NO-HLFIR-NOT: hlfir.

! ALL: return
! ALL-NEXT: }
Expand Down
15 changes: 9 additions & 6 deletions flang/test/Lower/achar.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
! RUN: bbc -emit-fir %s -o - | FileCheck %s

! Tests ACHAR lowering (converting an INTEGER to a CHARACTER (singleton, LEN=1)
! along with conversion of CHARACTER to another KIND.
Expand All @@ -13,12 +13,15 @@ end subroutine achar_test1

! CHECK-LABEL: func @_QPachar_test1(
! CHECK-SAME: %[[arg:.*]]: !fir.ref<i32> {fir.bindc_name = "a"}) {
! CHECK: %[[VAL_0:.*]] = fir.alloca !fir.char<1>
! CHECK: %[[VAL_1:.*]] = fir.alloca !fir.char<2> {bindc_name = "ch", uniq_name = "_QFachar_test1Ech"}
! CHECK: %[[VAL_2:.*]] = fir.load %[[arg]] : !fir.ref<i32>
! CHECK: %[[VAL_TMP_ALLOCA:.*]] = fir.alloca !fir.char<2> {bindc_name = ".tmp"}
! CHECK: %[[VAL_1_ALLOCA:.*]] = fir.alloca !fir.char<1>
! CHECK: %[[VAL_DUMMY_SCOPE:.*]] = fir.dummy_scope : !fir.dscope
! CHECK: %[[VAL_DECLARE:.*]] = fir.declare %[[arg]] dummy_scope %[[VAL_DUMMY_SCOPE]] arg 1 {fortran_attrs = #fir.var_attrs<intent_in>, uniq_name = "_QFachar_test1Ea"} : (!fir.ref<i32>, !fir.dscope) -> !fir.ref<i32>
! CHECK: %[[VAL_CH_ALLOCA:.*]] = fir.alloca !fir.char<2> {bindc_name = "ch", uniq_name = "_QFachar_test1Ech"}
! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_DECLARE]] : !fir.ref<i32>
! CHECK: %[[VAL_5:.*]] = fir.undefined !fir.char<1>
! CHECK: %[[VAL_6:.*]] = fir.insert_value %[[VAL_5]], %{{.*}}, [0 : index] : (!fir.char<1>, i8) -> !fir.char<1>
! CHECK: fir.store %[[VAL_6]] to %[[VAL_0]] : !fir.ref<!fir.char<1>>
! CHECK: fir.store %[[VAL_6]] to %[[VAL_1_ALLOCA]] : !fir.ref<!fir.char<1>>
! CHECK: %[[VAL_7:.*]] = fir.alloca !fir.char<2,?>(%{{.*}} : index)
! CHECK: fir.char_convert %[[VAL_0]] for %{{.*}} to %[[VAL_7]] : !fir.ref<!fir.char<1>>, index, !fir.ref<!fir.char<2,?>>
! CHECK: fir.char_convert %[[VAL_1_ALLOCA]] for %{{.*}} to %[[VAL_7]] : !fir.ref<!fir.char<1>>, index, !fir.ref<!fir.char<2,?>>
! CHECK: fir.call @_QPachar_test1_foo(%{{.*}}) {{.*}}: (!fir.boxchar<2>) -> ()