[libcxx-commits] [PATCH] D102048: [libc++] Run `substitutes-in-compile-flags.sh.cpp` test on Windows.

Vlad Vereschaka via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 7 16:48:56 PDT 2021


vvereschaka updated this revision to Diff 343784.
vvereschaka added a comment.

@ldionne, @curdeius thank you for review.
Updated diff accordingly

- reworded comment
- %t.grep => %t.escaped.grep
- do not remove temporary file in the test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102048/new/

https://reviews.llvm.org/D102048

Files:
  libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp


Index: libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
===================================================================
--- libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102048.343784.patch
Type: text/x-patch
Size: 1229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210507/bb9313d8/attachment.bin>


More information about the libcxx-commits mailing list