|
1 | | -! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s --check-prefixes="CHECK,CMPLX,CMPLX-PRECISE" |
| 1 | +! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s --check-prefixes=CHECK,CMPLX,CMPLX-PRECISE,%if flang-supports-f128-math %{F128%} %else %{F64%} |
2 | 2 | ! RUN: bbc -emit-fir -hlfir=false --math-runtime=precise %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-PRECISE" |
3 | 3 | ! RUN: bbc --force-mlir-complex -emit-fir -hlfir=false %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-FAST" |
4 | | -! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CMPLX,CMPLX-PRECISE" |
| 4 | +! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,CMPLX,CMPLX-PRECISE,%if flang-supports-f128-math %{F128%} %else %{F64%} |
5 | 5 | ! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -mllvm --math-runtime=precise %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-PRECISE" |
6 | 6 | ! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -mllvm --force-mlir-complex %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-FAST" |
7 | 7 | ! RUN: %flang_fc1 -fapprox-func -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-APPROX" |
@@ -85,13 +85,18 @@ subroutine abs_testd(a, b) |
85 | 85 | end subroutine |
86 | 86 |
|
87 | 87 | ! CHECK-LABEL: func @_QPabs_testr16( |
88 | | -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<f128>{{.*}}, %[[VAL_1:.*]]: !fir.ref<f128>{{.*}}) { |
| 88 | +! F128-SAME: %[[VAL_0:.*]]: !fir.ref<f128>{{.*}}, %[[VAL_1:.*]]: !fir.ref<f128>{{.*}}) { |
| 89 | +! F64-SAME: %[[VAL_0:.*]]: !fir.ref<f64>{{.*}}, %[[VAL_1:.*]]: !fir.ref<f64>{{.*}}) { |
89 | 90 | subroutine abs_testr16(a, b) |
90 | | -! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f128> |
91 | | -! CHECK: %[[VAL_3:.*]] = math.absf %[[VAL_2]] {{.*}}: f128 |
92 | | -! CHECK: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f128> |
| 91 | +! F128: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f128> |
| 92 | +! F64: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<f64> |
| 93 | +! F128: %[[VAL_3:.*]] = math.absf %[[VAL_2]] {{.*}}: f128 |
| 94 | +! F64: %[[VAL_3:.*]] = math.absf %[[VAL_2]] {{.*}}: f64 |
| 95 | +! F128: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f128> |
| 96 | +! F64: fir.store %[[VAL_3]] to %[[VAL_1]] : !fir.ref<f64> |
93 | 97 | ! CHECK: return |
94 | | - real(kind=16) :: a, b |
| 98 | + integer, parameter :: rk = merge(16, 8, selected_real_kind(33, 4931)==16) |
| 99 | + real(kind=rk) :: a, b |
95 | 100 | b = abs(a) |
96 | 101 | end subroutine |
97 | 102 |
|
|
0 commit comments