summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/warning_tests.c
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-07-11 19:58:23 +0000
committerJordan Rose <jordan_rose@apple.com>2012-07-11 19:58:23 +0000
commitb13eb8dca5df6424abeedfdbfd1a96fbb7a97565 (patch)
treeefb68eaf0148997978dad14c5b4ca83be180aac4 /clang/test/Preprocessor/warning_tests.c
parent20dced4dbb44780dbdb4eb460b0717fa6a4f0ba3 (diff)
downloadbcm5719-llvm-b13eb8dca5df6424abeedfdbfd1a96fbb7a97565.tar.gz
bcm5719-llvm-b13eb8dca5df6424abeedfdbfd1a96fbb7a97565.zip
Allow -verify directives to be filtered by preprocessing.
This is accomplished by making VerifyDiagnosticsConsumer a CommentHandler, which then only reads the -verify directives that are actually in live blocks of code. It also makes it simpler to handle -verify directives that appear in header files, though we still have to manually reparse some files depending on how they are generated. This requires some test changes. In particular, all PCH tests now have their -verify directives outside the "header" portion of the file, using the @line syntax added in r159978. Other tests have been modified mostly to make it clear what is being tested, and to prevent polluting the expected output with the directives themselves. Patch by Andy Gibbs! (with slight modifications) The new Frontend/verify-* tests exercise the functionality of this commit, as well as r159978, r159979, and r160053 (Andy's other -verify enhancements). llvm-svn: 160068
Diffstat (limited to 'clang/test/Preprocessor/warning_tests.c')
-rw-r--r--clang/test/Preprocessor/warning_tests.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/test/Preprocessor/warning_tests.c b/clang/test/Preprocessor/warning_tests.c
index 96b96efc7e6..3f2865cdb47 100644
--- a/clang/test/Preprocessor/warning_tests.c
+++ b/clang/test/Preprocessor/warning_tests.c
@@ -6,14 +6,16 @@
#if __has_warning("not valid") // expected-warning {{__has_warning expected option name}}
#endif
+// expected-warning@+2 {{Should have -Wparentheses}}
#if __has_warning("-Wparentheses")
-#warning Should have -Wparentheses // expected-warning {{Should have -Wparentheses}}
+#warning Should have -Wparentheses
#endif
#if __has_warning(-Wfoo) // expected-error {{builtin warning check macro requires a parenthesized string}}
#endif
+// expected-warning@+3 {{Not a valid warning flag}}
#if __has_warning("-Wnot-a-valid-warning-flag-at-all")
#else
-#warning Not a valid warning flag // expected-warning {{Not a valid warning flag}}
-#endif \ No newline at end of file
+#warning Not a valid warning flag
+#endif
OpenPOWER on IntegriCloud