From: Alp Toker Date: Sat, 19 Apr 2014 21:40:58 +0000 (+0000) Subject: Fix and restore the macro-multiline.c test X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93f93a33958adc07a3bf2adb213ebc25e620e5f6;p=clang Fix and restore the macro-multiline.c test This test didn't work as intended and was ultimately disabled some years ago in r169458. Indeed it's not clear if the '\n' was ever passed through to the driver correctly given that lit would insert '&& {' at the newline. Test rewritten to use printf/xargs to insert '\n' in a more reliable manner and to use FileCheck for verification. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206703 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Preprocessor/macro-multiline.c b/test/Preprocessor/macro-multiline.c new file mode 100644 index 0000000000..526192860c --- /dev/null +++ b/test/Preprocessor/macro-multiline.c @@ -0,0 +1,7 @@ +// RUN: printf -- "-DX=A\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT" | xargs -0 %clang -E %s | FileCheck -strict-whitespace %s +// REQUIRES: shell + +// Per GCC -D semantics, \n and anything that follows is ignored. + +// CHECK: {{^START A END$}} +START X END diff --git a/test/Preprocessor/macro-multiline.c.ignoreme b/test/Preprocessor/macro-multiline.c.ignoreme deleted file mode 100644 index df7c40a954..0000000000 --- a/test/Preprocessor/macro-multiline.c.ignoreme +++ /dev/null @@ -1,8 +0,0 @@ -// RUN: %clang -E %s "-DX=A -// RUN: THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT" > %t -// RUN: grep "GOOD: A" %t -// RUN: not grep THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT %t -// rdar://6762183 - -GOOD: X -