[Transforms] Silence a warning in SROA.cpp (NFC)
[llvm-project.git] / flang / test / Lower / Intrinsics / achar.f90
blob32cf30dde9ab2263271242f8151b891e74e736bf
1 ! RUN: bbc -emit-fir -hlfir=false %s -o - | fir-opt --canonicalize | FileCheck %s
2 ! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir %s -o - | fir-opt --canonicalize | FileCheck %s
5 ! CHECK-LABEL: func.func @_QPtest1(
6 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<i32> {fir.bindc_name = "x"},
7 ! CHECK-SAME: %[[VAL_1:.*]]: !fir.boxchar<1> {fir.bindc_name = "c"}) {
8 ! CHECK: %[[VAL_2:.*]] = fir.alloca !fir.char<1> {adapt.valuebyref}
9 ! CHECK: %[[VAL_3:.*]]:2 = fir.unboxchar %[[VAL_1]] : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
10 ! CHECK: %[[VAL_4:.*]] = fir.convert %[[VAL_3]]#0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.char<1>>
11 ! CHECK: %[[VAL_5:.*]] = fir.load %[[VAL_0]] : !fir.ref<i32>
12 ! CHECK: %[[VAL_6:.*]] = fir.convert %[[VAL_5]] : (i32) -> i8
13 ! CHECK: %[[VAL_7:.*]] = fir.undefined !fir.char<1>
14 ! CHECK: %[[VAL_8:.*]] = fir.insert_value %[[VAL_7]], %[[VAL_6]], [0 : index] : (!fir.char<1>, i8) -> !fir.char<1>
15 ! CHECK: fir.store %[[VAL_8]] to %[[VAL_2]] : !fir.ref<!fir.char<1>>
16 ! CHECK: %[[VAL_9:.*]] = fir.load %[[VAL_2]] : !fir.ref<!fir.char<1>>
17 ! CHECK: fir.store %[[VAL_9]] to %[[VAL_4]] : !fir.ref<!fir.char<1>>
18 ! CHECK: return
19 ! CHECK: }
20 subroutine test1(x, c)
21 integer :: x
22 character :: c
23 c = achar(x)
24 end subroutine