Skip to content

[flang] Run real 10 test on x86 only (NFC) #73911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flang/test/Evaluate/fold-nearest.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ module m1
logical, parameter :: test_6 = nearest(-inf, -1.) == -inf
logical, parameter :: test_7 = nearest(1.9999999, 1.) == 2.
logical, parameter :: test_8 = nearest(2., -1.) == 1.9999999
#if __x86_64__
logical, parameter :: test_9 = nearest(1.9999999999999999999_10, 1.) == 2._10
#endif
logical, parameter :: test_10 = nearest(-1., 1.) == -.99999994
logical, parameter :: test_11 = nearest(-1., -2.) == -1.0000001
real, parameter :: negZero = sign(0., -1.)
Expand Down Expand Up @@ -42,7 +44,9 @@ module m2
logical, parameter :: test_8 = ieee_next_after(-inf, -1.) == -inf
logical, parameter :: test_9 = ieee_next_after(1.9999999, 3.) == 2.
logical, parameter :: test_10 = ieee_next_after(2., 1.) == 1.9999999
#if __x86_64__
logical, parameter :: test_11 = ieee_next_after(1.9999999999999999999_10, 3.) == 2._10
#endif
logical, parameter :: test_12 = ieee_next_after(1., 1.) == 1.
!WARN: warning: invalid argument on division
real, parameter :: nan = 0. / 0.
Expand Down
12 changes: 8 additions & 4 deletions flang/test/Lower/assignment.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! RUN: bbc %s -o "-" -emit-fir -hlfir=false | FileCheck %s
! RUN: %flang_fc1 %s -o "-" -emit-fir -cpp -flang-deprecated-no-hlfir | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-X86-64%}

subroutine sub1(a)
integer :: a
Expand Down Expand Up @@ -264,28 +264,32 @@ subroutine real_constant()
real(2) :: a
real(4) :: b
real(8) :: c
#if __x86_64__
real(10) :: d
#endif
real(16) :: e
a = 2.0_2
b = 4.0_4
c = 8.0_8
#if __x86_64__
d = 10.0_10
#endif
e = 16.0_16
end

! CHECK: %[[A:.*]] = fir.alloca f16
! CHECK: %[[B:.*]] = fir.alloca f32
! CHECK: %[[C:.*]] = fir.alloca f64
! CHECK: %[[D:.*]] = fir.alloca f80
! CHECK-X86-64: %[[D:.*]] = fir.alloca f80
! CHECK: %[[E:.*]] = fir.alloca f128
! CHECK: %[[C2:.*]] = arith.constant 2.000000e+00 : f16
! CHECK: fir.store %[[C2]] to %[[A]] : !fir.ref<f16>
! CHECK: %[[C4:.*]] = arith.constant 4.000000e+00 : f32
! CHECK: fir.store %[[C4]] to %[[B]] : !fir.ref<f32>
! CHECK: %[[C8:.*]] = arith.constant 8.000000e+00 : f64
! CHECK: fir.store %[[C8]] to %[[C]] : !fir.ref<f64>
! CHECK: %[[C10:.*]] = arith.constant 1.000000e+01 : f80
! CHECK: fir.store %[[C10]] to %[[D]] : !fir.ref<f80>
! CHECK-X86-64: %[[C10:.*]] = arith.constant 1.000000e+01 : f80
! CHECK-X86-64: fir.store %[[C10]] to %[[D]] : !fir.ref<f80>
! CHECK: %[[C16:.*]] = arith.constant 1.600000e+01 : f128
! CHECK: fir.store %[[C16]] to %[[E]] : !fir.ref<f128>

Expand Down
4 changes: 4 additions & 0 deletions flang/unittests/Evaluate/real.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ using Real2 = Scalar<Type<TypeCategory::Real, 2>>;
using Real3 = Scalar<Type<TypeCategory::Real, 3>>;
using Real4 = Scalar<Type<TypeCategory::Real, 4>>;
using Real8 = Scalar<Type<TypeCategory::Real, 8>>;
#ifdef __x86_64__
using Real10 = Scalar<Type<TypeCategory::Real, 10>>;
#endif
using Real16 = Scalar<Type<TypeCategory::Real, 16>>;
using Integer4 = Scalar<Type<TypeCategory::Integer, 4>>;
using Integer8 = Scalar<Type<TypeCategory::Integer, 8>>;
Expand Down Expand Up @@ -538,7 +540,9 @@ void roundTest(int rm, Rounding rounding, std::uint32_t opds) {
basicTests<Real3>(rm, rounding);
basicTests<Real4>(rm, rounding);
basicTests<Real8>(rm, rounding);
#ifdef __x86_64__
basicTests<Real10>(rm, rounding);
#endif
basicTests<Real16>(rm, rounding);
ScopedHostFloatingPointEnvironment::SetRounding(rounding);
subsetTests<std::uint32_t, float, Real4>(rm, rounding, opds);
Expand Down