================
@@ -629,3 +629,75 @@ TEST(RegisterTypeBuiltinTest, DoesNotSerialize) {
   type.ToXMLElement(strm);
   EXPECT_TRUE(strm.GetString().empty());
 }
+
+TEST(RegisterTypeVectorTest, ConstructionAndXML) {
+  RegisterTypeBuiltin element_type("ieee_single", eEncodingIEEE754,
+                                   eFormatFloat, 4);
+  RegisterTypeVector vector_type("v4f", &element_type, 4);
+
+  EXPECT_EQ(vector_type.GetID(), "v4f");
+  EXPECT_EQ(vector_type.GetElementType(), &element_type);
+  EXPECT_EQ(vector_type.GetCount(), 4u);
+  ASSERT_TRUE(vector_type.GetByteSize());
+  EXPECT_EQ(*vector_type.GetByteSize(), 16u);
+  EXPECT_TRUE(vector_type.IsByteSizeCompatible(16));
+  EXPECT_FALSE(vector_type.IsByteSizeCompatible(12));
----------------
DavidSpickett wrote:

LLDB's own vector types are even more lax I think. Just an element size, so as 
long as total size % element size is 0, it works. Not saying we should do that 
here, just mention it as a comparison point.

https://github.com/llvm/llvm-project/pull/219255
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to