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 | cf2c2e9588a12a716615850cc5bfacd9b20f68ef (patch) | |
tree | 3f72b10220ce36f108cb7adf0e2a7a494cb3654b /test/Preprocessor | |
parent | 46a2290c030597e26022fe2b535c8e4b0d30a765 (diff) |
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>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor')
-rw-r--r-- | test/Preprocessor/traditional-cpp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Preprocessor/traditional-cpp.c b/test/Preprocessor/traditional-cpp.c index 0396c9b126..4c4633e039 100644 --- a/test/Preprocessor/traditional-cpp.c +++ b/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 |