diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-08-03 00:04:13 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-08-03 00:04:13 +0000 |
commit | b3bfd84ebb6657be47c0294de459f1ff02d3a9c6 (patch) | |
tree | 59634af8a1bfd38227c7b35b167b094018566761 /clang/test/Preprocessor/comment_save_if.c | |
parent | d41f032a450b71c33dce5f37f08ee92e2a1b8e4f (diff) | |
download | bcm5719-llvm-b3bfd84ebb6657be47c0294de459f1ff02d3a9c6.tar.gz bcm5719-llvm-b3bfd84ebb6657be47c0294de459f1ff02d3a9c6.zip |
A couple fixes for preprocessor expressions:
1. Be more tolerant of comments in -CC (comment-preserving) mode. We were missing a few cases.
2. Make sure to expand the second FOO in "#if defined FOO FOO". (See also
r97253, which addressed the case of "#if defined(FOO FOO".)
Fixes PR10286.
llvm-svn: 136748
Diffstat (limited to 'clang/test/Preprocessor/comment_save_if.c')
-rw-r--r-- | clang/test/Preprocessor/comment_save_if.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/Preprocessor/comment_save_if.c b/clang/test/Preprocessor/comment_save_if.c index 2f35bcb9e8c..4946122a3f0 100644 --- a/clang/test/Preprocessor/comment_save_if.c +++ b/clang/test/Preprocessor/comment_save_if.c @@ -1,6 +1,11 @@ -// RUN: %clang_cc1 %s -E -CC -pedantic 2>&1 | grep -v '^/' | not grep warning +// RUN: %clang_cc1 %s -E -CC -pedantic -verify #if 1 /*bar */ #endif /*foo*/ +#if /*foo*/ defined /*foo*/ FOO /*foo*/ +#if /*foo*/ defined /*foo*/ ( /*foo*/ FOO /*foo*/ ) /*foo*/ +#endif +#endif + |