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

via flang-commits flang-commits at lists.llvm.org
Fri Nov 24 19:54:06 PST 2023


Author: Daniel Chen
Date: 2023-11-24T22:54:01-05:00
New Revision: 024718313b526a4530d7cd58886fcc157247e0ff

URL: https://github.com/llvm/llvm-project/commit/024718313b526a4530d7cd58886fcc157247e0ff
DIFF: https://github.com/llvm/llvm-project/commit/024718313b526a4530d7cd58886fcc157247e0ff.diff

LOG: [Flang] Fix a test case that depends on stderr output of nullptr. (#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.

Added: 
    

Modified: 
    flang/unittests/Runtime/RuntimeCrashTest.cpp

Removed: 
    


################################################################################
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