Support: Stop stringifying DW_ATE_{lo,hi}_user
[oota-llvm.git] / unittests / Support / DwarfTest.cpp
index 2dccfe7ad3c0ce121ae498f547b0293313a015d9..b1a23b31c1c2f14bc77589ee9cfb927e2aa4bb9d 100644 (file)
@@ -69,4 +69,14 @@ TEST(DwarfTest, getLanguage) {
   EXPECT_EQ(0u, getLanguage("DW_LANG_hi_user"));
 }
 
+TEST(DwarfTest, AttributeEncodingStringOnInvalid) {
+  // This is invalid, so it shouldn't be stringified.
+  EXPECT_EQ(nullptr, AttributeEncodingString(0));
+
+  // These aren't really tags: they describe ranges within tags.  They
+  // shouldn't be stringified either.
+  EXPECT_EQ(nullptr, AttributeEncodingString(DW_ATE_lo_user));
+  EXPECT_EQ(nullptr, AttributeEncodingString(DW_ATE_hi_user));
+}
+
 } // end namespace