aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-14 05:49:49 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-14 05:49:49 +0000
commitefaddc0705cfc7c36b76da9ebc33b69843e31996 (patch)
treee3757300ff15e2d7eed6f1c6675d79e2c08e3a0c /unittests/Format/FormatTest.cpp
parent21c8fa87a3517d835072193a59a955ec7f6bf408 (diff)
Formatter: Add a test for bitfields.
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
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index a8417f1efd..b05d19c652 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -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"