[flang-commits] [flang] [flang] Match the length size in comparison (NFC) (PR #78302)

via flang-commits flang-commits at lists.llvm.org
Tue Jan 16 07:57:29 PST 2024


https://github.com/madanial0 created https://github.com/llvm/llvm-project/pull/78302

The template function call CheckDescriptorEqInt((exitStat.get(), 127) is deduced to have INT_T equal to std::int32_t instead of std::int64_t, but the length descriptor points to a 64-byte storage. The comparison does not work in a big endian.

>From 065798a82afe60bb7881284527a68deff7dd288d Mon Sep 17 00:00:00 2001
From: Mark Danial <madanial at dixon.rtp.raleigh.ibm.com>
Date: Tue, 16 Jan 2024 10:40:31 -0500
Subject: [PATCH] [flang] Match the length size in comparison (NFC)

---
 flang/unittests/Runtime/CommandTest.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/flang/unittests/Runtime/CommandTest.cpp b/flang/unittests/Runtime/CommandTest.cpp
index 5ae0f1c72f92c3..4fbc4e02b64c96 100644
--- a/flang/unittests/Runtime/CommandTest.cpp
+++ b/flang/unittests/Runtime/CommandTest.cpp
@@ -351,9 +351,9 @@ TEST_F(ZeroArguments, ECLInvalidCommandErrorSync) {
 #ifdef _WIN32
   CheckDescriptorEqInt(exitStat.get(), 1);
 #else
-  CheckDescriptorEqInt(exitStat.get(), 127);
+  CheckDescriptorEqInt<std::int64_t>(exitStat.get(), 127);
 #endif
-  CheckDescriptorEqInt(cmdStat.get(), 3);
+  CheckDescriptorEqInt<std::int64_t>(cmdStat.get(), 3);
   CheckDescriptorEqStr(cmdMsg.get(), "Invalid command lineXXXX");
 }
 



More information about the flang-commits mailing list