1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
2 ! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
4 ! CHECK-LABEL: func @_QPspacing_test(
5 real*4 function spacing_test(x
)
7 spacing_test
= spacing(x
)
8 ! CHECK: %[[a1:.*]] = fir.load %{{.*}} : !fir.ref<f32>
9 ! CHECK: %{{.*}} = fir.call @_FortranASpacing4(%[[a1]]) {{.*}}: (f32) -> f32
12 ! CHECK-LABEL: func @_QPspacing_test2(
13 real*10 function spacing_test2(x
)
15 spacing_test2
= spacing(x
)
16 ! CHECK: %[[a1:.*]] = fir.load %{{.*}} : !fir.ref<f80>
17 ! CHECK: %{{.*}} = fir.call @_FortranASpacing10(%[[a1]]) {{.*}}: (f80) -> f80
20 ! CHECK-LABEL: test_real2
21 subroutine test_real2(x
, y
)
24 ! CHECK: %[[CAST_ARG:.*]] = fir.convert %{{.*}} : (f16) -> f32
25 ! CHECK: %[[RT_RES:.*]] = fir.call @_FortranASpacing2By4(%[[CAST_ARG]]){{.*}}: (f32) -> f32
26 ! CHECK: fir.convert %[[RT_RES]] : (f32) -> f16
29 ! CHECK-LABEL: test_real3
30 subroutine test_real3(x
, y
)
33 ! CHECK: %[[CAST_ARG:.*]] = fir.convert %{{.*}} : (bf16) -> f32
34 ! CHECK: %[[RT_RES:.*]] = fir.call @_FortranASpacing3By4(%[[CAST_ARG]]){{.*}}: (f32) -> f32
35 ! CHECK: fir.convert %[[RT_RES]] : (f32) -> bf16