[PATCH] Avoid false positive/negative test results from line directive interference
Geoff Berry
gberry at codeaurora.org
Thu Jun 18 08:23:48 PDT 2015
FileCheck-ize and use strings with spaces to reduce likelihood of line directive conflict.
http://reviews.llvm.org/D10443
Files:
test/Preprocessor/cxx_true.cpp
Index: test/Preprocessor/cxx_true.cpp
===================================================================
--- test/Preprocessor/cxx_true.cpp
+++ test/Preprocessor/cxx_true.cpp
@@ -1,15 +1,18 @@
-/* RUN: %clang_cc1 -E %s -x c++ | grep block_1
- RUN: %clang_cc1 -E %s -x c++ | not grep block_2
- RUN: %clang_cc1 -E %s -x c | not grep block
+/* RUN: %clang_cc1 -E %s -x c++ | FileCheck -check-prefix CPP %s
+ RUN: %clang_cc1 -E %s -x c | FileCheck -check-prefix C %s
RUN: %clang_cc1 -E %s -x c++ -verify -Wundef
*/
// expected-no-diagnostics
#if true
-block_1
+// CPP: test block_1
+// C-NOT: test block_1
+test block_1
#endif
#if false
-block_2
+// CPP-NOT: test block_2
+// C-NOT: test block_2
+test block_2
#endif
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10443.27937.patch
Type: text/x-patch
Size: 736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150618/e7d36802/attachment.bin>
More information about the cfe-commits
mailing list