Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceForstall committed Aug 18, 2023
1 parent 699d97b commit 1363246
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_71375/Runtime_71375.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,58 @@ public static bool Problem()
{
return VarArgs(0, 0, 0, 0, 0, 0, Vector128<int>.AllBitsSet, __arglist()) != -1;
}

[Fact]
public static int TestEntryPoint2()
{
if (Case2())
return 101;
return 100;
}

[MethodImpl(MethodImplOptions.NoInlining)]
static int VarArgs2(int arg1, int arg2, int arg3, int arg4, int arg5, Vector128<int> vecArg, __arglist) => vecArg.GetElement(0);

[MethodImpl(MethodImplOptions.NoInlining)]
public static bool Case2()
{
// vector is not split: it is passed in registers x6, x7
return VarArgs2(0, 0, 0, 0, 0, Vector128<int>.AllBitsSet, __arglist()) != -1;
}

[Fact]
public static int TestEntryPoint3()
{
if (Case3())
return 101;
return 100;
}

[MethodImpl(MethodImplOptions.NoInlining)]
static int VarArgs3(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, Vector128<int> vecArg, __arglist) => vecArg.GetElement(0);

[MethodImpl(MethodImplOptions.NoInlining)]
public static bool Case3()
{
// vector is not split: it is passed entirely on the stack
return VarArgs3(0, 0, 0, 0, 0, 0, 0, Vector128<int>.AllBitsSet, __arglist()) != -1;
}

[Fact]
public static int TestEntryPoint4()
{
if (Case4())
return 101;
return 100;
}

[MethodImpl(MethodImplOptions.NoInlining)]
static int VarArgs4(int arg1, object arg2, int arg3, object arg4, int arg5, object arg6, Vector128<int> splitArg, __arglist) => splitArg.GetElement(0);

[MethodImpl(MethodImplOptions.NoInlining)]
public static bool Case4()
{
// Spit the vector but also pass some object types so the GC needs to know about them.
return VarArgs4(0, new object(), 0, new object(), 0, new object(), Vector128<int>.AllBitsSet, __arglist()) != -1;
}
}

0 comments on commit 1363246

Please sign in to comment.