r206703 - Fix and restore the macro-multiline.c test

Alp Toker alp at nuanti.com
Sat Apr 19 14:40:58 PDT 2014


Author: alp
Date: Sat Apr 19 16:40:58 2014
New Revision: 206703

URL: http://llvm.org/viewvc/llvm-project?rev=206703&view=rev
Log:
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.

Added:
    cfe/trunk/test/Preprocessor/macro-multiline.c
Removed:
    cfe/trunk/test/Preprocessor/macro-multiline.c.ignoreme

Added: cfe/trunk/test/Preprocessor/macro-multiline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/macro-multiline.c?rev=206703&view=auto
==============================================================================
--- cfe/trunk/test/Preprocessor/macro-multiline.c (added)
+++ cfe/trunk/test/Preprocessor/macro-multiline.c Sat Apr 19 16:40:58 2014
@@ -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

Removed: cfe/trunk/test/Preprocessor/macro-multiline.c.ignoreme
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/macro-multiline.c.ignoreme?rev=206702&view=auto
==============================================================================
--- cfe/trunk/test/Preprocessor/macro-multiline.c.ignoreme (original)
+++ cfe/trunk/test/Preprocessor/macro-multiline.c.ignoreme (removed)
@@ -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
-





More information about the cfe-commits mailing list