[clang] [AIX] fix unsupported diff flag on AIX (-strip-trailing-cr) (PR #120276)
Mark Danial via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 17 09:50:05 PST 2024
https://github.com/madanial0 created https://github.com/llvm/llvm-project/pull/120276
https://github.com/llvm/llvm-project/pull/119666 adds the `-strip-trailing-cr` flag to diff which is not supported on AIX switch to use the python implementation of diff instead
>From 1fb12758908b0cfeb8ff738c8c8f6378d6fbf8ea Mon Sep 17 00:00:00 2001
From: Mark Danial <madanial at dixon.rtp.raleigh.ibm.com>
Date: Tue, 17 Dec 2024 12:47:20 -0500
Subject: [PATCH] fix unsupported diff flag on AIX (-strip-trailing-cr)
---
clang/test/Format/lit.local.cfg | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/clang/test/Format/lit.local.cfg b/clang/test/Format/lit.local.cfg
index 8acf02725d701b..b060c79226cbda 100644
--- a/clang/test/Format/lit.local.cfg
+++ b/clang/test/Format/lit.local.cfg
@@ -1,3 +1,6 @@
+import platform
+import lit.formats
+
# Suffixes supported by clang-format.
config.suffixes = [
".c",
@@ -19,3 +22,8 @@ config.suffixes = [
".td",
".test"
]
+
+# AIX 'diff' command doesn't support --strip-trailing-cr, but the internal
+# python implementation does, so use that for cross platform compatibility
+if platform.system() == "AIX":
+ config.test_format = lit.formats.ShTest()
More information about the cfe-commits
mailing list