[compiler-rt] 9d09982 - [test][asan] Replace tr with sed

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 17:52:48 PST 2022


Author: Vitaly Buka
Date: 2022-11-21T17:52:39-08:00
New Revision: 9d09982641fa7bb436bf86de33ecb26a8ed63865

URL: https://github.com/llvm/llvm-project/commit/9d09982641fa7bb436bf86de33ecb26a8ed63865
DIFF: https://github.com/llvm/llvm-project/commit/9d09982641fa7bb436bf86de33ecb26a8ed63865.diff

LOG: [test][asan] Replace tr with sed

tr is not available on Windows bot.

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp
    compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp b/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp
index 8723fe041a9a..0f7407cffda8 100644
--- a/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp
@@ -13,12 +13,12 @@
 // RUN:  | sed -e "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \
 // RUN:  > %t.exports
 //
-// RUN:  cat %t.asan_interface.inc                                                 \
+// RUN:  sed ':a;N;$!ba;s/[\n ]//g;s/)/)\n/g'                                      \
+// RUN:  %t.asan_interface.inc                                                     \
 // RUN:  %p/../../../../lib/ubsan/ubsan_interface.inc                              \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc        \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface_posix.inc  \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc      \
-// RUN:  | tr '\n' ' ' | sed "s/ //g" | sed "s/)/)\n/g"                            \
 // RUN:  | grep -e "INTERFACE_\(WEAK_\)\?FUNCTION"                                 \
 // RUN:  | grep -v "__sanitizer_weak_hook"                                         \
 // RUN:  | sed -e "s/.*(//" -e "s/).*//" > %t.imports

diff  --git a/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp b/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
index dcf5b1b9fb06..562675732b81 100644
--- a/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
@@ -15,21 +15,19 @@
 // [BEWARE: be really careful with the sed commands, as this test can be run
 //  from 
diff erent environments with 
diff erent shells and seds]
 //
-// RUN: cat                                                                    \
+// RUN: sed ':a;N;$!ba;s/[\n ]//g;s/)/)\n/g'                                   \
 // RUN:  %p/../../../../lib/asan/asan_interface.inc                            \
 // RUN:  %p/../../../../lib/ubsan/ubsan_interface.inc                          \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc    \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc  \
-// RUN:  | tr '\n' ' ' | sed "s/ //g" | sed "s/)/)\n/g"                        \
 // RUN:  | grep -e "^INTERFACE_FUNCTION"                                       \
 // RUN:  | sed -e "s/.*(//" -e "s/).*//" > %t.imports1
 //
-// RUN: cat                                                                    \
+// RUN: sed ':a;N;$!ba;s/[\n ]//g;s/)/)\n/g'                                   \
 // RUN:  %p/../../../../lib/asan/asan_interface.inc                            \
 // RUN:  %p/../../../../lib/ubsan/ubsan_interface.inc                          \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc    \
 // RUN:  %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc  \
-// RUN:  | tr '\n' ' ' | sed "s/ //g" | sed "s/)/)\n/g"                        \
 // RUN:  | grep -e "^INTERFACE_WEAK_FUNCTION"                                  \
 // RUN:  | sed -e "s/.*(//" -e "s/).*/__dll/" > %t.imports2
 //


        


More information about the llvm-commits mailing list