[flang-commits] [flang] [flang] Disabling REAL kinds must also disable their COMPLEX (PR #131353)
via flang-commits
flang-commits at lists.llvm.org
Fri Mar 14 13:41:04 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-semantics
Author: Peter Klausler (klausler)
<details>
<summary>Changes</summary>
When disabling kinds of REAL in the TargetCharacteristics, one must also disable the corresponding kinds of COMPLEX.
Fixes https://github.com/llvm/llvm-project/issues/131088.
---
Full diff: https://github.com/llvm/llvm-project/pull/131353.diff
23 Files Affected:
- (modified) flang/include/flang/Tools/TargetSetup.h (+9-2)
- (modified) flang/test/Integration/debug-complex-1.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/acos_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/acosh_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/asin_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/asinh_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/atan_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/atanh_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/cos_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/cosh_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/exp_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/log_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/pow_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/pow_complex16i.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/pow_complex16k.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/sin_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/sinh_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/sqrt_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/tan_complex16.f90 (+1)
- (modified) flang/test/Lower/Intrinsics/tanh_complex16.f90 (+1)
- (modified) flang/test/Semantics/data05.f90 (+1)
- (modified) flang/test/Semantics/intrinsics01.f90 (+1)
- (modified) flang/test/Semantics/modfile12.f90 (+1)
``````````diff
diff --git a/flang/include/flang/Tools/TargetSetup.h b/flang/include/flang/Tools/TargetSetup.h
index ee05d891db353..e582215048250 100644
--- a/flang/include/flang/Tools/TargetSetup.h
+++ b/flang/include/flang/Tools/TargetSetup.h
@@ -49,6 +49,8 @@ namespace Fortran::tools {
default:
targetCharacteristics.DisableType(
Fortran::common::TypeCategory::Real, /*kind=*/10);
+ targetCharacteristics.DisableType(
+ Fortran::common::TypeCategory::Complex, /*kind=*/10);
break;
}
@@ -62,11 +64,16 @@ namespace Fortran::tools {
constexpr bool f128Support = false;
#endif
- if constexpr (!f128Support)
+ if constexpr (!f128Support) {
targetCharacteristics.DisableType(Fortran::common::TypeCategory::Real, 16);
+ targetCharacteristics.DisableType(
+ Fortran::common::TypeCategory::Complex, 16);
+ }
- for (auto realKind : targetOptions.disabledRealKinds)
+ for (auto realKind : targetOptions.disabledRealKinds) {
targetCharacteristics.DisableType(common::TypeCategory::Real, realKind);
+ targetCharacteristics.DisableType(common::TypeCategory::Complex, realKind);
+ }
for (auto intKind : targetOptions.disabledIntegerKinds)
targetCharacteristics.DisableType(common::TypeCategory::Integer, intKind);
diff --git a/flang/test/Integration/debug-complex-1.f90 b/flang/test/Integration/debug-complex-1.f90
index c8d0da4c4baa2..1ec4b7fe33990 100644
--- a/flang/test/Integration/debug-complex-1.f90
+++ b/flang/test/Integration/debug-complex-1.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
program mn
diff --git a/flang/test/Lower/Intrinsics/acos_complex16.f90 b/flang/test/Lower/Intrinsics/acos_complex16.f90
index 761a8661645e2..9e9d4f1487d56 100644
--- a/flang/test/Lower/Intrinsics/acos_complex16.f90
+++ b/flang/test/Lower/Intrinsics/acos_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acosh_complex16.f90 b/flang/test/Lower/Intrinsics/acosh_complex16.f90
index 72944ed55bb7e..69a23fb0f8410 100644
--- a/flang/test/Lower/Intrinsics/acosh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/acosh_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asin_complex16.f90 b/flang/test/Lower/Intrinsics/asin_complex16.f90
index e78107de8aec1..43aea8bd3c4c0 100644
--- a/flang/test/Lower/Intrinsics/asin_complex16.f90
+++ b/flang/test/Lower/Intrinsics/asin_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asinh_complex16.f90 b/flang/test/Lower/Intrinsics/asinh_complex16.f90
index 97424753ee3fc..6826a27406f90 100644
--- a/flang/test/Lower/Intrinsics/asinh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/asinh_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atan_complex16.f90 b/flang/test/Lower/Intrinsics/atan_complex16.f90
index 7a1e53523cf61..08cd16025e5e2 100644
--- a/flang/test/Lower/Intrinsics/atan_complex16.f90
+++ b/flang/test/Lower/Intrinsics/atan_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atanh_complex16.f90 b/flang/test/Lower/Intrinsics/atanh_complex16.f90
index 0777fa7263d05..bc57bdf58c2c8 100644
--- a/flang/test/Lower/Intrinsics/atanh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/atanh_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cos_complex16.f90 b/flang/test/Lower/Intrinsics/cos_complex16.f90
index 05b046deb73df..d5e1249745e00 100644
--- a/flang/test/Lower/Intrinsics/cos_complex16.f90
+++ b/flang/test/Lower/Intrinsics/cos_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cosh_complex16.f90 b/flang/test/Lower/Intrinsics/cosh_complex16.f90
index 8756672f72b3a..f2f170d9ba277 100644
--- a/flang/test/Lower/Intrinsics/cosh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/cosh_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/exp_complex16.f90 b/flang/test/Lower/Intrinsics/exp_complex16.f90
index 40a91b1beb8a5..e40207815ab7c 100644
--- a/flang/test/Lower/Intrinsics/exp_complex16.f90
+++ b/flang/test/Lower/Intrinsics/exp_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/log_complex16.f90 b/flang/test/Lower/Intrinsics/log_complex16.f90
index 2425f5bc5ab6e..600d7f9b7dc47 100644
--- a/flang/test/Lower/Intrinsics/log_complex16.f90
+++ b/flang/test/Lower/Intrinsics/log_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_complex16.f90 b/flang/test/Lower/Intrinsics/pow_complex16.f90
index b96a8b0f2665e..7467986832479 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_complex16i.f90 b/flang/test/Lower/Intrinsics/pow_complex16i.f90
index c93600b588fbf..6f8684d9a663a 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16i.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16i.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_complex16k.f90 b/flang/test/Lower/Intrinsics/pow_complex16k.f90
index 618501fdc3a78..d3765050640ae 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16k.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16k.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sin_complex16.f90 b/flang/test/Lower/Intrinsics/sin_complex16.f90
index c56791d78da3b..d170e6303192f 100644
--- a/flang/test/Lower/Intrinsics/sin_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sin_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sinh_complex16.f90 b/flang/test/Lower/Intrinsics/sinh_complex16.f90
index 62110388938ae..ff2bd3420ea14 100644
--- a/flang/test/Lower/Intrinsics/sinh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sinh_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sqrt_complex16.f90 b/flang/test/Lower/Intrinsics/sqrt_complex16.f90
index ebe0cf007cdef..7f30befe9cb87 100644
--- a/flang/test/Lower/Intrinsics/sqrt_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sqrt_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tan_complex16.f90 b/flang/test/Lower/Intrinsics/tan_complex16.f90
index 396b4353658d7..b6ed0bb4515b5 100644
--- a/flang/test/Lower/Intrinsics/tan_complex16.f90
+++ b/flang/test/Lower/Intrinsics/tan_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tanh_complex16.f90 b/flang/test/Lower/Intrinsics/tanh_complex16.f90
index b0a2847b004b4..22e5b85bb3c09 100644
--- a/flang/test/Lower/Intrinsics/tanh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/tanh_complex16.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Semantics/data05.f90 b/flang/test/Semantics/data05.f90
index f9fc858c8d543..c3591c1c5da8a 100644
--- a/flang/test/Semantics/data05.f90
+++ b/flang/test/Semantics/data05.f90
@@ -1,3 +1,4 @@
+!REQUIRES: flang-supports-f128-math
!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
module m
interface
diff --git a/flang/test/Semantics/intrinsics01.f90 b/flang/test/Semantics/intrinsics01.f90
index 28808f8e766ba..74778914fc7e5 100644
--- a/flang/test/Semantics/intrinsics01.f90
+++ b/flang/test/Semantics/intrinsics01.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_errors.py %s %flang_fc1
! Check for semantic errors for DREAL, DIMAG, DCONJG intrinsics
diff --git a/flang/test/Semantics/modfile12.f90 b/flang/test/Semantics/modfile12.f90
index 41ab300e00f67..8bb6a2c413d8e 100644
--- a/flang/test/Semantics/modfile12.f90
+++ b/flang/test/Semantics/modfile12.f90
@@ -1,3 +1,4 @@
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_modfile.py %s %flang_fc1
module m
integer(8), parameter :: a = 1, b = 2_8
``````````
</details>
https://github.com/llvm/llvm-project/pull/131353
More information about the flang-commits
mailing list