37 lines · plain
1! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}2 3! CHECK-LABEL: func @_QPaint_test(4! CHECK-SAME: %[[VAL_0_b:.*]]: !fir.ref<f32>{{.*}}, %[[VAL_1_b:.*]]: !fir.ref<f32>{{.*}}) {5subroutine aint_test(a, b)6! CHECK: %[[VAL_0:.*]]:2 = hlfir.declare %[[VAL_0_b]]7! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_1_b]]8! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]]#0 : !fir.ref<f32>9! CHECK: %[[VAL_3:.*]] = fir.call @llvm.trunc.f32(%[[VAL_2]]) {{.*}}: (f32) -> f3210! CHECK: hlfir.assign %[[VAL_3]] to %[[VAL_1]]#0 : f32, !fir.ref<f32>11! CHECK: return12 real :: a, b13 b = aint(a)14end subroutine15 16! CHECK-LABEL: func.func @_QPaint_test_real8(17! CHECK: fir.call @llvm.trunc.f64({{.*}}) {{.*}}: (f64) -> f6418 19subroutine aint_test_real8(a, b)20 real(8) :: a, b21 b = aint(a)22end subroutine23 24! CHECK-KIND10-LABEL: func.func @_QPaint_test_real10(25! CHECK-KIND10: fir.call @llvm.trunc.f80({{.*}}) {{.*}}: (f80) -> f8026subroutine aint_test_real10(a, b)27 integer, parameter :: kind10 = merge(10, 4, selected_real_kind(p=18).eq.10)28 real(kind10) :: a, b29 b = aint(a)30end subroutine31 32! TODO: wait until fp128 is supported well in llvm.trunc33!subroutine aint_test_real16(a, b)34! real(16) :: a, b35! b = aint(a)36!end subroutine37