[llvm] [VFABI] Improve VFABI unit tests (PR #73907)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 07:42:49 PST 2023


================
@@ -537,27 +600,40 @@ TEST_F(VFABIParserTest, ParseScalableMaskingSVESincos) {
 // Make sure that we get the correct VF if the return type is wider than any
 // parameter type.
 TEST_F(VFABIParserTest, ParseWiderReturnTypeSVE) {
-  EXPECT_TRUE(
-      invokeParser("_ZGVsMxvv_foo(vector_foo)", "foo", "i64(i32, i32)"));
+  EXPECT_TRUE(invokeParser("_ZGVsMxvv_foo(vector_foo)", "i64(i32, i32)"));
+  EXPECT_TRUE(matchScalarParamNum()) << "Different number of scalar parameters";
+  EXPECT_EQ(ISA, VFISAKind::SVE);
+  EXPECT_EQ(Parameters.size(), (unsigned)3);
+  EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::Vector}));
+  EXPECT_EQ(Parameters[1], VFParameter({1, VFParamKind::Vector}));
+  EXPECT_EQ(Parameters[2], VFParameter({2, VFParamKind::GlobalPredicate}));
   EXPECT_EQ(VF, ElementCount::getScalable(2));
+  EXPECT_EQ(ScalarName, "foo");
+  EXPECT_EQ(VectorName, "vector_foo");
 }
 
 // Make sure we handle void return types.
 TEST_F(VFABIParserTest, ParseVoidReturnTypeSVE) {
-  EXPECT_TRUE(invokeParser("_ZGVsMxv_foo(vector_foo)", "foo", "void(i16)"));
+  EXPECT_TRUE(invokeParser("_ZGVsMxv_foo(vector_foo)", "void(i16)"));
+  EXPECT_TRUE(matchScalarParamNum()) << "Different number of scalar parameters";
----------------
paschalis-mpeis wrote:

Return a vector with no parameters? or `void()` ?

https://github.com/llvm/llvm-project/pull/73907


More information about the llvm-commits mailing list