[flang-commits] [flang] [flang] Fix test on ppc64le & aarch64 (PR #105439)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Aug 20 15:01:04 PDT 2024


https://github.com/klausler created https://github.com/llvm/llvm-project/pull/105439

Don't try to fold x87 extended precision operations in a test unless it's targeting x86-64.

>From 4e2eab7f4f1f156c1960440c63240a55bd699f9b Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Tue, 20 Aug 2024 14:59:38 -0700
Subject: [PATCH] [flang] Fix test on ppc64le & aarch64

Don't try to fold x87 extended precision operations in a test
unless it's targeting x86-64.
---
 flang/test/Evaluate/fold-nearest.f90 | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/flang/test/Evaluate/fold-nearest.f90 b/flang/test/Evaluate/fold-nearest.f90
index b20c831c67414..48b9ef37840e3 100644
--- a/flang/test/Evaluate/fold-nearest.f90
+++ b/flang/test/Evaluate/fold-nearest.f90
@@ -92,20 +92,23 @@ module m3
   logical, parameter :: test_14 = .not. (x14 == x14)
 end module
 
-#if 0
-! Currently failing on ppc64le and aarch64, debugging...
 module m4
+  use ieee_arithmetic
+  real(2), parameter :: neg_inf_2 = real(z'fc00',2)
+  real(2), parameter :: neg_huge_2 = real(z'fbff',2)
+  real(3), parameter :: neg_huge_3 = real(z'ff7f',3)
+  logical, parameter :: test_1 = ieee_next_after(neg_inf_2, neg_huge_3) == neg_huge_2
+end module
+
+#if __x86_64__
+module m5
   use ieee_arithmetic
   real(8), parameter :: neg_inf_8  = real(z'fff0000000000000',8)
   real(8), parameter :: neg_huge_8 = real(z'ffefffffffffffff',8)
   real(10), parameter :: neg_one_10 = real(z'bfff8000000000000000',10)
   real(10), parameter :: neg_inf_10 = real(z'ffff8000000000000000',10)
-  real(2), parameter :: neg_inf_2 = real(z'fc00',2)
-  real(2), parameter :: neg_huge_2 = real(z'fbff',2)
-  real(3), parameter :: neg_huge_3 = real(z'ff7f',3)
-  logical, parameter :: test_1 = ieee_next_after(neg_inf_8,neg_one_10) == neg_huge_8
-  logical, parameter :: test_2 = ieee_next_after(neg_inf_2, neg_huge_3) == neg_huge_2
-  logical, parameter :: test_3 = ieee_next_after(neg_one_10, neg_inf_10) == &
+  logical, parameter :: test_1 = ieee_next_after(neg_inf_8, neg_one_10) == neg_huge_8
+  logical, parameter :: test_2 = ieee_next_after(neg_one_10, neg_inf_10) == &
                                  real(z'bfff8000000000000001', 10)
 end module
 #endif



More information about the flang-commits mailing list