summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/unittests/Symbol/TestClangASTContext.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lldb/unittests/Symbol/TestClangASTContext.cpp b/lldb/unittests/Symbol/TestClangASTContext.cpp
index ad2cb2c9e54..28df732fc79 100644
--- a/lldb/unittests/Symbol/TestClangASTContext.cpp
+++ b/lldb/unittests/Symbol/TestClangASTContext.cpp
@@ -190,12 +190,20 @@ void VerifyEncodingAndBitSize(clang::ASTContext *context,
return;
EXPECT_TRUE(type_ptr->isBuiltinType());
- if (encoding == eEncodingSint)
+ switch (encoding) {
+ case eEncodingSint:
EXPECT_TRUE(type_ptr->isSignedIntegerType());
- else if (encoding == eEncodingUint)
+ break;
+ case eEncodingUint:
EXPECT_TRUE(type_ptr->isUnsignedIntegerType());
- else if (encoding == eEncodingIEEE754)
+ break;
+ case eEncodingIEEE754:
EXPECT_TRUE(type_ptr->isFloatingType());
+ break;
+ default:
+ FAIL() << "Unexpected encoding";
+ break;
+ }
}
TEST_F(TestClangASTContext, TestBuiltinTypeForEncodingAndBitSize) {
OpenPOWER on IntegriCloud