Skip to content

Commit 58b5149

Browse files
authored
[flang] Run real 10 test on x86 only (NFC) (#73911)
Remove real 10 tests for powerpc --------- Co-authored-by: Mark Danial <[email protected]>
1 parent 71809cf commit 58b5149

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

flang/test/Evaluate/fold-nearest.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ module m1
1414
logical, parameter :: test_6 = nearest(-inf, -1.) == -inf
1515
logical, parameter :: test_7 = nearest(1.9999999, 1.) == 2.
1616
logical, parameter :: test_8 = nearest(2., -1.) == 1.9999999
17+
#if __x86_64__
1718
logical, parameter :: test_9 = nearest(1.9999999999999999999_10, 1.) == 2._10
19+
#endif
1820
logical, parameter :: test_10 = nearest(-1., 1.) == -.99999994
1921
logical, parameter :: test_11 = nearest(-1., -2.) == -1.0000001
2022
real, parameter :: negZero = sign(0., -1.)
@@ -42,7 +44,9 @@ module m2
4244
logical, parameter :: test_8 = ieee_next_after(-inf, -1.) == -inf
4345
logical, parameter :: test_9 = ieee_next_after(1.9999999, 3.) == 2.
4446
logical, parameter :: test_10 = ieee_next_after(2., 1.) == 1.9999999
47+
#if __x86_64__
4548
logical, parameter :: test_11 = ieee_next_after(1.9999999999999999999_10, 3.) == 2._10
49+
#endif
4650
logical, parameter :: test_12 = ieee_next_after(1., 1.) == 1.
4751
!WARN: warning: invalid argument on division
4852
real, parameter :: nan = 0. / 0.

flang/test/Lower/assignment.f90

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! RUN: bbc %s -o "-" -emit-fir -hlfir=false | FileCheck %s
1+
! RUN: %flang_fc1 %s -o "-" -emit-fir -cpp -flang-deprecated-no-hlfir | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-X86-64%}
22

33
subroutine sub1(a)
44
integer :: a
@@ -264,28 +264,32 @@ subroutine real_constant()
264264
real(2) :: a
265265
real(4) :: b
266266
real(8) :: c
267+
#if __x86_64__
267268
real(10) :: d
269+
#endif
268270
real(16) :: e
269271
a = 2.0_2
270272
b = 4.0_4
271273
c = 8.0_8
274+
#if __x86_64__
272275
d = 10.0_10
276+
#endif
273277
e = 16.0_16
274278
end
275279

276280
! CHECK: %[[A:.*]] = fir.alloca f16
277281
! CHECK: %[[B:.*]] = fir.alloca f32
278282
! CHECK: %[[C:.*]] = fir.alloca f64
279-
! CHECK: %[[D:.*]] = fir.alloca f80
283+
! CHECK-X86-64: %[[D:.*]] = fir.alloca f80
280284
! CHECK: %[[E:.*]] = fir.alloca f128
281285
! CHECK: %[[C2:.*]] = arith.constant 2.000000e+00 : f16
282286
! CHECK: fir.store %[[C2]] to %[[A]] : !fir.ref<f16>
283287
! CHECK: %[[C4:.*]] = arith.constant 4.000000e+00 : f32
284288
! CHECK: fir.store %[[C4]] to %[[B]] : !fir.ref<f32>
285289
! CHECK: %[[C8:.*]] = arith.constant 8.000000e+00 : f64
286290
! CHECK: fir.store %[[C8]] to %[[C]] : !fir.ref<f64>
287-
! CHECK: %[[C10:.*]] = arith.constant 1.000000e+01 : f80
288-
! CHECK: fir.store %[[C10]] to %[[D]] : !fir.ref<f80>
291+
! CHECK-X86-64: %[[C10:.*]] = arith.constant 1.000000e+01 : f80
292+
! CHECK-X86-64: fir.store %[[C10]] to %[[D]] : !fir.ref<f80>
289293
! CHECK: %[[C16:.*]] = arith.constant 1.600000e+01 : f128
290294
! CHECK: fir.store %[[C16]] to %[[E]] : !fir.ref<f128>
291295

flang/unittests/Evaluate/real.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ using Real2 = Scalar<Type<TypeCategory::Real, 2>>;
1414
using Real3 = Scalar<Type<TypeCategory::Real, 3>>;
1515
using Real4 = Scalar<Type<TypeCategory::Real, 4>>;
1616
using Real8 = Scalar<Type<TypeCategory::Real, 8>>;
17+
#ifdef __x86_64__
1718
using Real10 = Scalar<Type<TypeCategory::Real, 10>>;
19+
#endif
1820
using Real16 = Scalar<Type<TypeCategory::Real, 16>>;
1921
using Integer4 = Scalar<Type<TypeCategory::Integer, 4>>;
2022
using Integer8 = Scalar<Type<TypeCategory::Integer, 8>>;
@@ -538,7 +540,9 @@ void roundTest(int rm, Rounding rounding, std::uint32_t opds) {
538540
basicTests<Real3>(rm, rounding);
539541
basicTests<Real4>(rm, rounding);
540542
basicTests<Real8>(rm, rounding);
543+
#ifdef __x86_64__
541544
basicTests<Real10>(rm, rounding);
545+
#endif
542546
basicTests<Real16>(rm, rounding);
543547
ScopedHostFloatingPointEnvironment::SetRounding(rounding);
544548
subsetTests<std::uint32_t, float, Real4>(rm, rounding, opds);

0 commit comments

Comments
 (0)