]> granicus.if.org Git - clang/commitdiff
Formatter: Add a test for bitfields.
authorNico Weber <nicolasweber@gmx.de>
Mon, 14 Jan 2013 05:49:49 +0000 (05:49 +0000)
committerNico Weber <nicolasweber@gmx.de>
Mon, 14 Jan 2013 05:49:49 +0000 (05:49 +0000)
They work fine, but this fifth use of colons (after labels, in ?:,
in initalizer lists in constructors, in objc method expressions, and in
bitfields) wasn't covered by tests yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172377 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Format/FormatTest.cpp

index a8417f1efdc96ece6cab0bdf78d6e9ba6422e662..b05d19c6529b72a50372e4f9c57bbb1749bc540a 100644 (file)
@@ -369,6 +369,13 @@ TEST_F(FormatTest, FormatsEnum) {
                "};");
 }
 
+TEST_F(FormatTest, FormatsBitfields) {
+  verifyFormat("struct Bitfields {\n"
+               "  unsigned sClass : 8;\n"
+               "  unsigned ValueKind : 2;\n"
+               "};");
+}
+
 TEST_F(FormatTest, FormatsNamespaces) {
   verifyFormat("namespace some_namespace {\n"
                "class A {};\n"