brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 9f469b2 Raw
21 lines · plain
1! Test lowering of OPEN statment options2! RUN: bbc %s -emit-fir -hlfir=false -o - | FileCheck %s3 4! CHECK-LABEL: func.func @_QPtest_convert_specifier(5subroutine test_convert_specifier(unit)6  integer :: unit7  ! CHECK: %[[cookie:.*]] = fir.call @_FortranAioBeginOpenUnit(%{{.*}}, %{{.*}}, %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>8  ! CHECK: %[[be_str:.*]] = fir.address_of(@[[be_str_name:.*]]) : !fir.ref<!fir.char<1,10>>9  ! CHECK: %[[len:.*]] = arith.constant 10 : index10  ! CHECK: %[[be_str_conv:.*]] = fir.convert %[[be_str]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>11  ! CHECK: %[[len_conv:.*]] = fir.convert %[[len]] : (index) -> i6412  ! CHECK: %{{.*}} = fir.call @_FortranAioSetConvert(%[[cookie]], %[[be_str_conv]], %[[len_conv]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i113  ! CHECK: %{{.*}} = fir.call @_FortranAioEndIoStatement(%[[cookie]]) {{.*}}: (!fir.ref<i8>) -> i3214  open(unit, form="UNFORMATTED", convert="BIG_ENDIAN")15  close(unit)16end subroutine17 18! CHECK: fir.global linkonce @[[be_str_name]] constant : !fir.char<1,10> {19! CHECK: %[[be_str_lit:.*]] = fir.string_lit "BIG_ENDIAN"(10) : !fir.char<1,10>20! CHECK: fir.has_value %[[be_str_lit]] : !fir.char<1,10>21