[flang-commits] [flang] [Flang] Fix a test case that depends on stderr output of nullptr. (PR #73349)

Daniel Chen via flang-commits flang-commits at lists.llvm.org
Fri Nov 24 08:45:33 PST 2023


https://github.com/DanielCChen created https://github.com/llvm/llvm-project/pull/73349

This test case depends on the stderr output of a `nullptr` being "(null)". However, it is empty string on AIX.
This PR is to initialize the `sourceFileName_` to be a specific string to avoid that.



>From a168b48368c47f700078987551f1484a10de70ea Mon Sep 17 00:00:00 2001
From: cdchen-ca <cdchen at ca.ibm.com>
Date: Fri, 24 Nov 2023 11:38:45 -0500
Subject: [PATCH] [Flang] Fix a test case that depends on stderr output of
 nullptr.

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

diff --git a/flang/unittests/Runtime/RuntimeCrashTest.cpp b/flang/unittests/Runtime/RuntimeCrashTest.cpp
index 34a8ff6d371131f..0f25cc0ee8035ba 100644
--- a/flang/unittests/Runtime/RuntimeCrashTest.cpp
+++ b/flang/unittests/Runtime/RuntimeCrashTest.cpp
@@ -43,9 +43,9 @@ TEST(TestTerminator, CheckFailedLocationTest) {
 }
 
 TEST(TestTerminator, CheckFailedTest) {
-  static Fortran::runtime::Terminator t;
+  static Fortran::runtime::Terminator t("someFileName");
   ASSERT_DEATH(t.CheckFailed("predicate"),
-      "RUNTIME_CHECK\\(predicate\\) failed at \\(null\\)\\(0\\)");
+      "RUNTIME_CHECK\\(predicate\\) failed at someFileName\\(0\\)");
 }
 
 //------------------------------------------------------------------------------



More information about the flang-commits mailing list