1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 ! CHECK-LABEL: func @_QPaint_test(
4 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f32>{{.*}}, %[[VAL_1:.*]]: !fir.ref<f32>{{.*}}) {
5 subroutine aint_test(a
, b
)
6 ! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f32>
7 ! CHECK: %[[VAL_3:.*]] = fir.call @llvm.trunc.f32(%[[VAL_2]]) {{.*}}: (f32) -> f32
8 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f32>
14 ! CHECK-LABEL: func.func @_QPaint_test_real8(
15 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f64> {fir.bindc_name = "a"},
16 ! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f64> {fir.bindc_name = "b"}) {
17 ! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f64>
18 ! CHECK: %[[VAL_3:.*]] = fir.call @llvm.trunc.f64(%[[VAL_2]]) {{.*}}: (f64) -> f64
19 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f64>
23 subroutine aint_test_real8(a
, b
)
28 ! CHECK-LABEL: func.func @_QPaint_test_real10(
29 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f80> {fir.bindc_name = "a"},
30 ! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref<f80> {fir.bindc_name = "b"}) {
31 ! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f80>
32 ! CHECK: %[[VAL_3:.*]] = fir.call @llvm.trunc.f80(%[[VAL_2]]) {{.*}}: (f80) -> f80
33 ! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f80>
37 subroutine aint_test_real10(a
, b
)
42 ! TODO: wait until fp128 is supported well in llvm.trunc
43 !subroutine aint_test_real16(a, b)