[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / Intrinsics / anint.f90
blobfe479a07681eec80965d23f0441c655a297cb5f6
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 ! CHECK-LABEL: func.func @_QPanint_test(
4 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f32> {fir.bindc_name = "a"},
5 ! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f32> {fir.bindc_name = "b"}) {
6 ! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f32>
7 ! CHECK: %[[VAL_3:.*]] = llvm.intr.round(%[[VAL_2]]) : (f32) -> f32
8 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f32>
9 ! CHECK: return
10 ! CHECK: }
12 subroutine anint_test(a, b)
13 real :: a, b
14 b = anint(a)
15 end subroutine
17 ! CHECK-LABEL: func.func @_QPanint_test_real8(
18 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f64> {fir.bindc_name = "a"},
19 ! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f64> {fir.bindc_name = "b"}) {
20 ! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f64>
21 ! CHECK: %[[VAL_3:.*]] = llvm.intr.round(%[[VAL_2]]) : (f64) -> f64
22 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f64>
23 ! CHECK: return
24 ! CHECK: }
26 subroutine anint_test_real8(a, b)
27 real(8) :: a, b
28 b = anint(a)
29 end subroutine
31 ! CHECK-LABEL: func.func @_QPanint_test_real10(
32 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f80> {fir.bindc_name = "a"},
33 ! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f80> {fir.bindc_name = "b"}) {
34 ! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f80>
35 ! CHECK: %[[VAL_3:.*]] = llvm.intr.round(%[[VAL_2]]) : (f80) -> f80
36 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f80>
37 ! CHECK: return
38 ! CHECK: }
40 subroutine anint_test_real10(a, b)
41 real(10) :: a, b
42 b = anint(a)
43 end subroutine
45 ! TODO: wait until fp128 is supported well in llvm.round
46 !subroutine anint_test_real16(a, b)
47 ! real(16) :: a, b
48 ! b = anint(a)
49 !end subroutine