diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-06-21 22:04:37 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-06-21 22:04:37 +0000 |
commit | 923074016b351405fd86dffdb66bed2646b4ba1f (patch) | |
tree | f933b6cc9a3cbbe3d37bbb1fd8e2456d436a7534 /clang/test/Index/annotate-comments-preprocessor.c | |
parent | c457f620337db407de143681dd00931ff0b97502 (diff) | |
download | bcm5719-llvm-923074016b351405fd86dffdb66bed2646b4ba1f.tar.gz bcm5719-llvm-923074016b351405fd86dffdb66bed2646b4ba1f.zip |
Handle include directive with comments. It turns out that in this case comments are not coming in source order. Instead of trying to std::sort() comments (which can be costly), just remove comments that are not in order.
llvm-svn: 158940
Diffstat (limited to 'clang/test/Index/annotate-comments-preprocessor.c')
-rw-r--r-- | clang/test/Index/annotate-comments-preprocessor.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/clang/test/Index/annotate-comments-preprocessor.c b/clang/test/Index/annotate-comments-preprocessor.c new file mode 100644 index 00000000000..202847ff9c9 --- /dev/null +++ b/clang/test/Index/annotate-comments-preprocessor.c @@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs %s + +// As long as none of this crashes, we don't care about comments in +// preprocessor directives. + +#include "annotate-comments-preprocessor.h" /* Aaa. */ /* Bbb. */ +#include "annotate-comments-preprocessor.h" /* Aaa. */ +#include "annotate-comments-preprocessor.h" /** Aaa. */ +#include "annotate-comments-preprocessor.h" /**< Aaa. */ +#include "annotate-comments-preprocessor.h" // Aaa. +#include "annotate-comments-preprocessor.h" /// Aaa. +#include "annotate-comments-preprocessor.h" ///< Aaa. + +#define A0 0 +#define A1 1 /* Aaa. */ +#define A2 1 /** Aaa. */ +#define A3 1 /**< Aaa. */ +#define A4 1 // Aaa. +#define A5 1 /// Aaa. +#define A6 1 ///< Aaa. + +int A[] = { A0, A1, A2, A3, A4, A5, A6 }; + +#if A0 /** Aaa. */ +int f(int a1[A1], int a2[A2], int a3[A3], int a4[A4], int a5[A5], int a6[A6]); +#endif /** Aaa. */ + +#if A1 /** Aaa. */ +int g(int a1[A1], int a2[A2], int a3[A3], int a4[A4], int a5[A5], int a6[A6]); +#endif /* Aaa. */ + +#pragma once /** Aaa. */ + +#define FOO \ + do { \ + /* Aaa. */ \ + /** Aaa. */ \ + /**< Aaa. */ \ + ; \ + } while(0) + +void h(void) { + FOO; +} + |