summaryrefslogtreecommitdiffstats
path: root/clang/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
commit7769a9044ead4ad9616629e68e9eba86cab8d7dd (patch)
tree0765a20b15bd2a036455f18b2450ecb0cce61c70 /clang/unittests/Format/FormatTest.cpp
parent574f4f6a1d8619e7a4e7ec0d376a5dd183c0a5d2 (diff)
downloadbcm5719-llvm-7769a9044ead4ad9616629e68e9eba86cab8d7dd.tar.gz
bcm5719-llvm-7769a9044ead4ad9616629e68e9eba86cab8d7dd.zip
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. llvm-svn: 172377
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index a8417f1efdc..b05d19c6529 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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"
OpenPOWER on IntegriCloud