[llvm] [VFABI] Improve VFABI unit tests (PR #73907)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 04:32:53 PST 2023
================
@@ -423,107 +434,159 @@ TEST_F(VFABIParserTest, MissingVectorNameTermination) {
}
TEST_F(VFABIParserTest, ParseMaskingNEON) {
- EXPECT_TRUE(invokeParser("_ZGVnM2v_sin"));
+ EXPECT_TRUE(invokeParser("_ZGVnM2v_foo(vector_foo)", "void(i32)"));
+ EXPECT_TRUE(matchScalarParamNum()) << "Different number of scalar parameters";
EXPECT_EQ(VF, ElementCount::getFixed(2));
- EXPECT_TRUE(IsMasked());
+ EXPECT_TRUE(isMasked());
EXPECT_EQ(ISA, VFISAKind::AdvancedSIMD);
EXPECT_EQ(Parameters.size(), (unsigned)2);
EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::Vector}));
EXPECT_EQ(Parameters[1], VFParameter({1, VFParamKind::GlobalPredicate}));
- EXPECT_EQ(ScalarName, "sin");
+ EXPECT_EQ(ScalarName, "foo");
+ EXPECT_EQ(VectorName, "vector_foo");
}
TEST_F(VFABIParserTest, ParseMaskingSVE) {
- EXPECT_TRUE(invokeParser("_ZGVsM2v_sin"));
+ EXPECT_TRUE(invokeParser("_ZGVsM2v_foo(vector_foo)", "void(i32)"));
+ EXPECT_TRUE(matchScalarParamNum()) << "Different number of scalar parameters";
EXPECT_EQ(VF, ElementCount::getFixed(2));
- EXPECT_TRUE(IsMasked());
+ EXPECT_TRUE(isMasked());
EXPECT_EQ(ISA, VFISAKind::SVE);
EXPECT_EQ(Parameters.size(), (unsigned)2);
EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::Vector}));
EXPECT_EQ(Parameters[1], VFParameter({1, VFParamKind::GlobalPredicate}));
- EXPECT_EQ(ScalarName, "sin");
+ EXPECT_EQ(ScalarName, "foo");
+ EXPECT_EQ(VectorName, "vector_foo");
}
TEST_F(VFABIParserTest, ParseMaskingSSE) {
- EXPECT_TRUE(invokeParser("_ZGVbM2v_sin"));
+ EXPECT_TRUE(invokeParser("_ZGVbM2v_foo(vector_foo)", "void(i32)"));
+ EXPECT_TRUE(matchScalarParamNum()) << "Different number of scalar parameters";
EXPECT_EQ(VF, ElementCount::getFixed(2));
- EXPECT_TRUE(IsMasked());
+ EXPECT_TRUE(isMasked());
EXPECT_EQ(ISA, VFISAKind::SSE);
EXPECT_EQ(Parameters.size(), (unsigned)2);
EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::Vector}));
- EXPECT_EQ(Parameters[1], VFParameter({1, VFParamKind::GlobalPredicate}));
- EXPECT_EQ(ScalarName, "sin");
+ EXPECT_EQ(ScalarName, "foo");
----------------
paulwalker-arm wrote:
This would be fine for a new feature but these tests are already validating this so I'm not seeing a good reason to remove the existing validation.
https://github.com/llvm/llvm-project/pull/73907
More information about the llvm-commits
mailing list