[PATCH] Disable preprocessor line directives to avoid false positive/negative test results

Geoff Berry gberry at codeaurora.org
Mon Jun 15 08:40:04 PDT 2015


Disable preprocessor line directives in case the string block or block_1 or block_2 appears in the path to the test file, which would cause it to appear in the line directive, causing the test to fail.

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,7 +1,7 @@
-/* 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++ -verify -Wundef
+/* RUN: %clang_cc1 -E -P %s -x c++ | grep block_1
+   RUN: %clang_cc1 -E -P %s -x c++ | not grep block_2
+   RUN: %clang_cc1 -E -P %s -x c | not grep block
+   RUN: %clang_cc1 -E -P %s -x c++ -verify -Wundef
 */
 // expected-no-diagnostics

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10443.27676.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150615/439bec63/attachment.bin>


More information about the cfe-commits mailing list