brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · d384e96 Raw
39 lines · plain
1!RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s2 3!CHECK-LABEL: func.func @_QPhostnm_only4!CHECK-SAME:    %[[dummyHn:.*]]: !fir.boxchar<1> {fir.bindc_name = "hn"}) {5subroutine hostnm_only(hn)6  CHARACTER(len=255) :: hn7 8  ! Check that _FortranAHostnm is called with boxed char 255, some other char9  ! string of variable length (source file path) and some integer (source line)10  !CHECK-DAG:     %[[line:.*]] = arith.constant {{.*}} : i3211  !CHECK-DAG:     %[[hn:.*]] = fir.convert {{.*}} (!fir.box<!fir.char<1,255>>) -> !fir.box<none>12  !CHECK-DAG:     %[[src_path:.*]] = fir.convert {{.*}} (!fir.ref<!fir.char<1,{{.*}} -> !fir.ref<i8>13  !CHECK: fir.call @_FortranAHostnm(%[[hn]], %[[src_path]], %[[line]])14  !CHECK-SAME:    -> i3215  call hostnm(hn)16end subroutine hostnm_only17 18!CHECK-LABEL: func.func @_QPall_arguments19!CHECK-SAME:    %[[dummyHn:.*]]: !fir.boxchar<1> {fir.bindc_name = "hn"},20!CHECK-SAME:    %[[dummyStat:.*]]: !fir.ref<i32> {fir.bindc_name = "status"}) {21subroutine all_arguments(hn, status)22  CHARACTER(len=255) :: hn23  INTEGER :: status24 25  ! Check that _FortranAHostnm is called with boxed char 255, some other char26  ! string of variable length (source file path) and some integer (source line)27  !CHECK-DAG: %[[line:.*]] = arith.constant {{.*}} : i3228  !CHECK-DAG: %[[hn:.*]] = fir.convert {{.*}} (!fir.box<!fir.char<1,255>>) -> !fir.box<none>29  !CHECK-DAG: %[[src_path:.*]] = fir.convert {{.*}} (!fir.ref<!fir.char<1,{{.*}} -> !fir.ref<i8>30  !CHECK:     %[[hn_result:.*]] = fir.call @_FortranAHostnm(%[[hn]], %[[src_path]], %[[line]])31  !CHECK-SAME:    -> i3232 33  ! Check _FortranAHostnm result code handling34  !CHECK-DAG: %[[c0_i64:.*]] = arith.constant 0 : i6435  !CHECK-DAG: %[[cmp_result:.*]] = arith.cmpi ne, {{.*}}, %[[c0_i64]] : i6436  !CHECK:     fir.store %[[hn_result]] {{.*}} !fir.ref<i32>37  call hostnm(hn, status)38end subroutine all_arguments39