diff options
| author | Jordan Rose <jordan_rose@apple.com> | 2013-03-05 23:54:55 +0000 |
|---|---|---|
| committer | Jordan Rose <jordan_rose@apple.com> | 2013-03-05 23:54:55 +0000 |
| commit | 67b66231a836f37d4d2242b746ef74d8d3f47dc7 (patch) | |
| tree | 1e3663629a8902bded409abdeb1250c434ea0db3 /clang/test | |
| parent | 3e067534088a1671619f1d6c701ce92e217be96c (diff) | |
| download | bcm5719-llvm-67b66231a836f37d4d2242b746ef74d8d3f47dc7.tar.gz bcm5719-llvm-67b66231a836f37d4d2242b746ef74d8d3f47dc7.zip | |
Preprocessor: don't keep comments under -traditional-cpp.
This patch is designed for minimal intrusion into normal preprocessing
and compilation; under -E -traditional-cpp, the lexer will still
generate tok::comment nodes since it is preserving all whitespace, but
the output printer will then throw it away.
<rdar://problem/13338680>
llvm-svn: 176534
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Preprocessor/traditional-cpp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/traditional-cpp.c b/clang/test/Preprocessor/traditional-cpp.c index 0396c9b126c..4c4633e0392 100644 --- a/clang/test/Preprocessor/traditional-cpp.c +++ b/clang/test/Preprocessor/traditional-cpp.c @@ -5,8 +5,14 @@ /* RUN: %clang_cc1 -traditional-cpp %s -E -o %t RUN: FileCheck -strict-whitespace < %t %s + RUN: %clang_cc1 -traditional-cpp %s -E -C | FileCheck -check-prefix=CHECK-COMMENTS %s */ +/* -traditional-cpp should eliminate all C89 comments. */ +/* CHECK-NOT: /* + * CHECK-COMMENTS: {{^}}/* -traditional-cpp should eliminate all C89 comments. *{{/$}} + */ + /* CHECK: {{^}}foo // bar{{$}} */ foo // bar |

