[llvm] [VFABI] Improve VFABI unit tests (PR #73907)
Paschalis Mpeis via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 08:19:40 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:
The grammar on LLVM [docs](https://llvm.org/docs/LangRef.html#call-site-attributes) for `<parameter>` isn't very clear, however for [AArch64](https://github.com/ARM-software/abi-aa/blob/main/vfabia64/vfabia64.rst#name-mangling-function) it is, and it looks like it requires 1+ parameters.
So I guess this is resolved?
https://github.com/llvm/llvm-project/pull/73907
More information about the llvm-commits
mailing list