[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / Intrinsics / spacing.f90
blob0259522dd575d9a4f3e25d7797a4bb9309c4ce9b
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 ! CHECK-SAME: %[[x:[^:]+]]: !fir.ref<f32>{{.*}}) -> f32
6 real*4 function spacing_test(x)
7 real*4 :: x
8 spacing_test = spacing(x)
9 ! CHECK: %[[a1:.*]] = fir.load %[[x]] : !fir.ref<f32>
10 ! CHECK: %{{.*}} = fir.call @_FortranASpacing4(%[[a1]]) {{.*}}: (f32) -> f32
11 end function
13 ! CHECK-LABEL: func @_QPspacing_test2(
14 ! CHECK-SAME: %[[x:[^:]+]]: !fir.ref<f80>{{.*}}) -> f80
15 real*10 function spacing_test2(x)
16 real*10 :: x
17 spacing_test2 = spacing(x)
18 ! CHECK: %[[a1:.*]] = fir.load %[[x]] : !fir.ref<f80>
19 ! CHECK: %{{.*}} = fir.call @_FortranASpacing10(%[[a1]]) {{.*}}: (f80) -> f80
20 end function