diff options
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 7869cc568ae..f1a1160fa14 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -1408,6 +1408,30 @@ TEST_F(FormatTest, FormatsLabels) { "test_label:;\n" " int i = 0;\n" "}"); + FormatStyle Style = getLLVMStyle(); + Style.IndentGotoLabels = false; + verifyFormat("void f() {\n" + " some_code();\n" + "test_label:\n" + " some_other_code();\n" + " {\n" + " some_more_code();\n" + "another_label:\n" + " some_more_code();\n" + " }\n" + "}", + Style); + verifyFormat("{\n" + " some_code();\n" + "test_label:\n" + " some_other_code();\n" + "}", + Style); + verifyFormat("{\n" + " some_code();\n" + "test_label:;\n" + " int i = 0;\n" + "}"); } //===----------------------------------------------------------------------===// @@ -11779,6 +11803,7 @@ TEST_F(FormatTest, ParsesConfigurationBools) { CHECK_PARSE_BOOL_FIELD(DerivePointerAlignment, "DerivePointerBinding"); CHECK_PARSE_BOOL(DisableFormat); CHECK_PARSE_BOOL(IndentCaseLabels); + CHECK_PARSE_BOOL(IndentGotoLabels); CHECK_PARSE_BOOL(IndentWrappedFunctionNames); CHECK_PARSE_BOOL(KeepEmptyLinesAtTheStartOfBlocks); CHECK_PARSE_BOOL(ObjCSpaceAfterProperty); |