- Add a mechanism for passing arbitrary arguments to the crossgen2 process while running crossgen2 tests
- Pass the `--codegenopt JitObjectStackAllocation=1` when compiling this test with Crossgen2. This will result in enabling the object stack allocation feature during compilation
- As Crossgen2 currently disregards the debuggable attribute when deciding codegen mode, detect the presence running crossgen2 and expect allocation to occur on the stack even if S.P.C is debuggable
<ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/tailcall_v4/hijacking/*">
<Issue>https://github.com/dotnet/runtime/issues/7597</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests/*">
- <Issue>Not compatible with crossgen2</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/clr-x64-JIT/v4.0/devdiv374539/DevDiv_374539/*">
<Issue>https://github.com/dotnet/runtime/issues/32732</Issue>
</ExcludeList>
fi
fi
+ ExtraCrossGen2Args+=" $(CrossGen2TestExtraArguments)"
+
if [ ! -z ${LargeVersionBubble+x} ]%3B then
ExtraCrossGen2Args+=" --inputbubble"
fi
)
REM CrossGen2 Script
if defined RunCrossGen2 (
+ set ExtraCrossGen2Args=!ExtraCrossGen2Args! $(CrossGen2TestExtraArguments)
+
if defined LargeVersionBubble ( set ExtraCrossGen2Args=!ExtraCrossGen2Args! --inputbubble)
call :TakeLock
set CrossGen2Status=0
Console.WriteLine("GCStress is enabled");
expectedAllocationKind = AllocationKind.Undefined;
}
- else if (!SPCOptimizationsEnabled()) {
+ else if (!SPCOptimizationsEnabled() && !Crossgen2Test()) {
Console.WriteLine("System.Private.CoreLib.dll optimizations are disabled");
expectedAllocationKind = AllocationKind.Heap;
}
return Environment.GetEnvironmentVariable("COMPlus_GCStress") != null;
}
+ static bool Crossgen2Test()
+ {
+ // CrossGen2 doesn't respect the debuggable attribute
+ return Environment.GetEnvironmentVariable("RunCrossGen2") != null;
+ }
+
static void CallTestAndVerifyAllocation(Test test, int expectedResult, AllocationKind expectedAllocationsKind)
{
long allocatedBytesBefore = GC.GetAllocatedBytesForCurrentThread();
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
<PropertyGroup>
+ <CrossGen2TestExtraArguments>--codegenopt JitObjectStackAllocation=1</CrossGen2TestExtraArguments>
<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
set COMPlus_TieredCompilation=0