From: Hubert Tong Date: Thu, 4 Jan 2018 22:58:30 +0000 (+0000) Subject: Use backslash escape, replacing xargs -0 in test macro-multiline.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad873abf290935de90629c17781f847d3a176432;p=clang Use backslash escape, replacing xargs -0 in test macro-multiline.c Summary: xargs supports escaping of newline characters with backslash. xargs -0 is neither part of POSIX nor the LSB. This patch removes the -0 option and adjusts the input to xargs accordingly; that is, the input is a text file not ending in an incomplete line, and the newline of interest is preceded by a backslash. Note: The treatment of escaped newline characters is not as clearly specified by POSIX as for escaped blank characters; however, the same can be said for escaped backslashes. It is slightly more clear for the case where the -I option is used; however, -I is also of limited portability. Reviewers: bruno Reviewed By: bruno Subscribers: bruno, rcraik, cfe-commits Differential Revision: https://reviews.llvm.org/D41544 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321828 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Preprocessor/macro-multiline.c b/test/Preprocessor/macro-multiline.c index 72a5d20e52..664c37cd02 100644 --- a/test/Preprocessor/macro-multiline.c +++ b/test/Preprocessor/macro-multiline.c @@ -1,4 +1,4 @@ -// RUN: printf -- "-DX=A\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT" | xargs -0 %clang -E %s | FileCheck -strict-whitespace %s +// RUN: printf -- "-DX=A\\\\\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT\n" | xargs %clang -E %s | FileCheck -strict-whitespace %s // Per GCC -D semantics, \n and anything that follows is ignored.