diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-21 16:42:44 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-21 16:42:44 +0000 |
commit | 2f1ac41a6d8d202dcc39ab8eb56ccea823dc062e (patch) | |
tree | 15aa018329f4bfa549afae261dd2da2dedd0b8b6 /test | |
parent | 9cfdc03fe7abab2f413bb7fdc59e9be15c382a74 (diff) |
Fixes formatting of empty blocks.
We now only put empty blocks into a single line, if all of:
- all tokens of the structural element fit into a single line
- we're not in a control flow statement
Note that we usually don't put record definitions into a single line, as
there's usually at least one more token (the semicolon) after the
closing brace. This doesn't hold when we are in a context where there is
no semicolon, like "enum E {}".
There were some missing tests around joining lines around the corner
cases of the allowed number of columns, so this patch adds some.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Index/comment-c-decls.c | 2 | ||||
-rw-r--r-- | test/Index/comment-to-html-xml-conversion.cpp | 4 | ||||
-rw-r--r-- | test/Index/format-comment-cdecls.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/test/Index/comment-c-decls.c b/test/Index/comment-c-decls.c index 879f9a265a..371e453bef 100644 --- a/test/Index/comment-c-decls.c +++ b/test/Index/comment-c-decls.c @@ -88,7 +88,7 @@ enum e { Two, Three }; -// CHECK: <Declaration>enum e {\n}</Declaration> +// CHECK: <Declaration>enum e {}</Declaration> // CHECK: <Declaration>Two</Declaration> /** diff --git a/test/Index/comment-to-html-xml-conversion.cpp b/test/Index/comment-to-html-xml-conversion.cpp index c1ec08e282..0577eb0854 100644 --- a/test/Index/comment-to-html-xml-conversion.cpp +++ b/test/Index/comment-to-html-xml-conversion.cpp @@ -713,7 +713,7 @@ namespace comment_to_xml_conversion_13 { /// Aaa. enum comment_to_xml_conversion_15 { -// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: EnumDecl=comment_to_xml_conversion_15:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_15</Name><USR>c:@E@comment_to_xml_conversion_15</USR><Declaration>enum comment_to_xml_conversion_15{{( : int)?}} {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: EnumDecl=comment_to_xml_conversion_15:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_15</Name><USR>c:@E@comment_to_xml_conversion_15</USR><Declaration>enum comment_to_xml_conversion_15{{( : int)?}} {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] /// Aaa. comment_to_xml_conversion_16 @@ -722,7 +722,7 @@ enum comment_to_xml_conversion_15 { /// Aaa. enum class comment_to_xml_conversion_17 { -// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:12: EnumDecl=comment_to_xml_conversion_17:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="12"><Name>comment_to_xml_conversion_17</Name><USR>c:@E@comment_to_xml_conversion_17</USR><Declaration>enum class comment_to_xml_conversion_17 : int {\n}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:12: EnumDecl=comment_to_xml_conversion_17:{{.*}} FullCommentAsXML=[<Enum file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="12"><Name>comment_to_xml_conversion_17</Name><USR>c:@E@comment_to_xml_conversion_17</USR><Declaration>enum class comment_to_xml_conversion_17 : int {}</Declaration><Abstract><Para> Aaa.</Para></Abstract></Enum>] /// Aaa. comment_to_xml_conversion_18 diff --git a/test/Index/format-comment-cdecls.c b/test/Index/format-comment-cdecls.c index 861bba2f20..471be2baf2 100644 --- a/test/Index/format-comment-cdecls.c +++ b/test/Index/format-comment-cdecls.c @@ -83,7 +83,7 @@ enum e { Two, Three }; -// CHECK: <Declaration>enum e {\n}</Declaration> +// CHECK: <Declaration>enum e {}</Declaration> // CHECK: <Declaration>Two</Declaration> /** |