Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / Intrinsics / is_iostat_value.f90
blob933dca1dcf1935c548449904058178fe3e50b856
1 ! RUN: bbc -emit-fir -o - %s | FileCheck %s
3 ! CHECK-LABEL: func @_QQmain
4 ! CHECK: %[[V_0:[0-9]+]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFEi"}
5 ! CHECK: fir.do_loop
6 do i=-20,20
7 ! CHECK: %[[V_5:[0-9]+]] = fir.load %[[V_0]] : !fir.ref<i32>
8 ! CHECK: %[[V_6:[0-9]+]] = arith.cmpi eq, %[[V_5]], %c-1{{.*}} : i32
9 ! CHECK: fir.if %[[V_6]] {
10 ! CHECK: %[[V_20:[0-9]+]] = fir.load %[[V_0]] : !fir.ref<i32>
11 ! CHECK: %[[V_21:[0-9]+]] = fir.call @_FortranAioOutputInteger32(%{{.*}} %[[V_20]]) fastmath<contract> : (!fir.ref<i8>, i32) -> i1
12 ! CHECK: }
13 if (is_iostat_end(i)) print*, "iostat_end =", i
14 ! CHECK: %[[V_7:[0-9]+]] = fir.load %[[V_0]] : !fir.ref<i32>
15 ! CHECK: %[[V_8:[0-9]+]] = arith.cmpi eq, %[[V_7]], %c-2{{.*}} : i32
16 ! CHECK: fir.if %[[V_8]] {
17 ! CHECK: %[[V_20:[0-9]+]] = fir.load %[[V_0]] : !fir.ref<i32>
18 ! CHECK: %[[V_21:[0-9]+]] = fir.call @_FortranAioOutputInteger32(%{{.*}} %[[V_20]]) fastmath<contract> : (!fir.ref<i8>, i32) -> i1
19 ! CHECK: }
20 if (is_iostat_eor(i)) print*, "iostat_eor =", i
21 ! CHECK: }
22 enddo
23 end