[libcxx-commits] [libcxx] 384dd9d - [libc++] Run `substitutes-in-compile-flags.sh.cpp` test on Windows.
Vladimir Vereschaka via libcxx-commits
libcxx-commits at lists.llvm.org
Tue May 11 11:42:37 PDT 2021
Author: Vladimir Vereschaka
Date: 2021-05-11T11:42:13-07:00
New Revision: 384dd9ddaf616a1563ee1c1a8a1347b7658e7a70
URL: https://github.com/llvm/llvm-project/commit/384dd9ddaf616a1563ee1c1a8a1347b7658e7a70
DIFF: https://github.com/llvm/llvm-project/commit/384dd9ddaf616a1563ee1c1a8a1347b7658e7a70.diff
LOG: [libc++] Run `substitutes-in-compile-flags.sh.cpp` test on Windows.
Fix for substitutes-in-compile-flags.sh.cpp to run it properly on Windows platform.
Differential Revision: https://reviews.llvm.org/D102048
Added:
Modified:
libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
Removed:
################################################################################
diff --git a/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp b/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
index ba7458b5a280e..499d8da97cea9 100644
--- a/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
+++ b/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
@@ -7,12 +7,12 @@
//===----------------------------------------------------------------------===//
// This test greps for %t, which is expanded to a path with backslashes. When
-// that is passed to grep, those backslashes would have to be escaped, which we
-// don't do right now.
-// UNSUPPORTED: windows
+// that is passed to grep, those backslashes must be escaped. We escape those
+// within the pattern into a file and use this file with 'grep'.
// Make sure that substitutions are performed inside additional compiler flags.
// ADDITIONAL_COMPILE_FLAGS: -I %t.1
// ADDITIONAL_COMPILE_FLAGS: -isystem %t.2 , -isysroot %t.3
-// RUN: echo "%{compile_flags}" | grep -e '-I %t.1 -isystem %t.2 -isysroot %t.3'
+// RUN: echo "-I %t.1 -isystem %t.2 -isysroot %t.3" | sed "s/\\\/\\\\\\\/g" > %t.escaped.grep
+// RUN: echo "%{compile_flags}" | grep -e -f %t.escaped.grep
More information about the libcxx-commits
mailing list