Skip to content

Commit 9f284e1

Browse files
authored
[flang] Disabling REAL kinds must also disable their COMPLEX (llvm#131353)
When disabling kinds of REAL in the TargetCharacteristics, one must also disable the corresponding kinds of COMPLEX. Fixes llvm#131088.
1 parent 329bfa9 commit 9f284e1

24 files changed

+32
-2
lines changed

flang/include/flang/Tools/TargetSetup.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ namespace Fortran::tools {
4949
default:
5050
targetCharacteristics.DisableType(
5151
Fortran::common::TypeCategory::Real, /*kind=*/10);
52+
targetCharacteristics.DisableType(
53+
Fortran::common::TypeCategory::Complex, /*kind=*/10);
5254
break;
5355
}
5456

@@ -62,11 +64,16 @@ namespace Fortran::tools {
6264
constexpr bool f128Support = false;
6365
#endif
6466

65-
if constexpr (!f128Support)
67+
if constexpr (!f128Support) {
6668
targetCharacteristics.DisableType(Fortran::common::TypeCategory::Real, 16);
69+
targetCharacteristics.DisableType(
70+
Fortran::common::TypeCategory::Complex, 16);
71+
}
6772

68-
for (auto realKind : targetOptions.disabledRealKinds)
73+
for (auto realKind : targetOptions.disabledRealKinds) {
6974
targetCharacteristics.DisableType(common::TypeCategory::Real, realKind);
75+
targetCharacteristics.DisableType(common::TypeCategory::Complex, realKind);
76+
}
7077

7178
for (auto intKind : targetOptions.disabledIntegerKinds)
7279
targetCharacteristics.DisableType(common::TypeCategory::Integer, intKind);

flang/test/Integration/debug-complex-1.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
23

34
program mn

flang/test/Lower/Intrinsics/acos_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/acosh_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/asin_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/asinh_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/atan_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/atanh_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/cos_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/cosh_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/exp_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/log_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/pow_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/pow_complex16i.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/pow_complex16k.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/sin_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/sinh_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/sqrt_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/tan_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/Intrinsics/tanh_complex16.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -emit-fir %s -o - | FileCheck %s
23
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
34
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s

flang/test/Lower/complex-operations.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: bbc -hlfir=false %s -o - | FileCheck %s
23

34
! CHECK-LABEL: @_QPadd_test

flang/test/Semantics/data05.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
!REQUIRES: flang-supports-f128-math
12
!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
23
module m
34
interface

flang/test/Semantics/intrinsics01.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: %python %S/test_errors.py %s %flang_fc1
23
! Check for semantic errors for DREAL, DIMAG, DCONJG intrinsics
34

flang/test/Semantics/modfile12.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
! REQUIRES: flang-supports-f128-math
12
! RUN: %python %S/test_modfile.py %s %flang_fc1
23
module m
34
integer(8), parameter :: a = 1, b = 2_8

0 commit comments

Comments
 (0)