]> granicus.if.org Git - clang/commitdiff
Fix and restore the macro-multiline.c test
authorAlp Toker <alp@nuanti.com>
Sat, 19 Apr 2014 21:40:58 +0000 (21:40 +0000)
committerAlp Toker <alp@nuanti.com>
Sat, 19 Apr 2014 21:40:58 +0000 (21:40 +0000)
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

test/Preprocessor/macro-multiline.c [new file with mode: 0644]
test/Preprocessor/macro-multiline.c.ignoreme [deleted file]

diff --git a/test/Preprocessor/macro-multiline.c b/test/Preprocessor/macro-multiline.c
new file mode 100644 (file)
index 0000000..5261928
--- /dev/null
@@ -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 (file)
index df7c40a..0000000
+++ /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
-