From 2c31cd75e2a899943534cbfe38ea3f3c15b8f595 Mon Sep 17 00:00:00 2001 From: Mark Plesko Date: Fri, 12 May 2023 11:49:10 -0700 Subject: [PATCH] Convert JIT/opt to a merged test group (#85850) See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool. In this group, I was a bit more aggressive in converting individual tests in [Fact]s and [Theory]s when needing to make manual changes. This required a change to the wrapper generator. * Manual removal of C# Main args * Mark async Main test as RPI * Manual removal of IL Main arg * Manual fix for badcallee * [ILTransform -p] Remove _il from project name * [ILTransform -n] Unique project names * [ILTransform -m] Remove .module from IL tests * Rename GitHub_42719: _r means not DebugType=Full, _o for optimize * [ILTransform -a] Match IL .assembly names to project names * [ILTransform -prociso] Set RequiresProcessIsolation when needed by other properties * [ILTransform -sr] Use canonical form for .assembly extern System.Runtime * [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe * [ILTransform -public] Make test entrypoints accessible * Manual fixes for [ILTransform -public] - internal methods to handle internal parameter types * Handle float constants for InlineData in XUnitWrapperGenerator * Manual fixes for xUnit1013 - internal methods, convert to [Theory] * Manual fixes for xUnit1013 - internal methods, disable region * Add merged group * Fix mismatch{32,64} by putting the test methods in classes --- .../XUnitWrapperGenerator.cs | 2 +- src/tests/JIT/opt/Add/IntAdd.cs | 6 +- src/tests/JIT/opt/Add/IntAdd.csproj | 3 +- src/tests/JIT/opt/And/IntAnd.cs | 6 +- src/tests/JIT/opt/And/IntAnd.csproj | 3 +- .../opt/And/Regressions/Regression1.csproj | 12 ---- .../{Regression1.cs => Regression1_And.cs} | 4 +- .../Regressions/Regression1_And.csproj} | 2 +- .../AssertionPropagation/ArrBoundBinaryOp.cs | 6 +- .../ArrBoundBinaryOp.csproj | 3 +- .../opt/AssertionPropagation/ArrBoundElim.cs | 6 +- .../AssertionPropagation/ArrBoundElim.csproj | 3 - .../AssertionPropagation/ArrBoundMinLength.cs | 6 +- .../ArrBoundMinLength.csproj | 3 - .../AssertionPropagation/ArrBoundUnsigned.cs | 6 +- .../ArrBoundUnsigned.csproj | 3 - .../opt/AssertionPropagation/CPropOverflow.il | 4 +- .../AssertionPropagation/CPropOverflow.ilproj | 1 - .../opt/AssertionPropagation/ConstantProp.cs | 6 +- .../AssertionPropagation/ConstantProp.csproj | 1 - .../JIT/opt/AssertionPropagation/CopyProp.cs | 6 +- .../opt/AssertionPropagation/CopyProp.csproj | 1 - .../DynBlkNullAssertions.cs | 4 +- .../DynBlkNullAssertions.csproj | 1 - .../NullCheckAssertion1.cs | 6 +- .../NullCheckAssertion1.csproj | 1 - .../NullCheckAssertion2.cs | 6 +- .../NullCheckAssertion2.csproj | 1 - .../NullCheckAssertion3.cs | 6 +- .../NullCheckAssertion3.csproj | 1 - .../NullCheckAssertion4.cs | 6 +- .../NullCheckAssertion4.csproj | 1 - .../NullCheckAssertion5.cs | 6 +- .../NullCheckAssertion5.csproj | 1 - .../NullCheckAssertion6.cs | 6 +- .../NullCheckAssertion6.csproj | 1 - .../NullCheckAssertion7.cs | 6 +- .../NullCheckAssertion7.csproj | 1 - .../AssertionPropagation/TypeOfAssertion.cs | 6 +- .../TypeOfAssertion.csproj | 1 - .../regression/dev10/bug573840/bug573840.cs | 6 +- .../dev10/bug573840/bug573840.csproj | 1 - .../JIT/opt/CSE/CSEWithDoubleNegation.cs | 6 +- .../JIT/opt/CSE/CSEWithDoubleNegation.csproj | 3 - src/tests/JIT/opt/CSE/GitHub_16065a.cs | 6 +- src/tests/JIT/opt/CSE/GitHub_16065a.csproj | 3 - src/tests/JIT/opt/CSE/GitHub_16065b.cs | 6 +- src/tests/JIT/opt/CSE/GitHub_16065b.csproj | 3 - src/tests/JIT/opt/CSE/NarrowStore.cs | 6 +- src/tests/JIT/opt/CSE/NarrowStore.csproj | 3 - src/tests/JIT/opt/Casts/IntCast.cs | 6 +- src/tests/JIT/opt/Casts/IntCast.csproj | 3 +- src/tests/JIT/opt/Casts/shared.cs | 6 +- src/tests/JIT/opt/Casts/shared2.cs | 6 +- src/tests/JIT/opt/Casts/shared2.csproj | 3 - .../{shared.csproj => shared_Casts.csproj} | 3 - src/tests/JIT/opt/Casts/tests.cs | 6 +- src/tests/JIT/opt/Casts/tests.csproj | 3 - src/tests/JIT/opt/Cloning/Runtime_61040_1.cs | 6 +- .../JIT/opt/Cloning/Runtime_61040_1.csproj | 1 - src/tests/JIT/opt/Cloning/Runtime_61040_2.cs | 6 +- .../JIT/opt/Cloning/Runtime_61040_2.csproj | 1 - src/tests/JIT/opt/Cloning/Runtime_61040_3.cs | 6 +- .../JIT/opt/Cloning/Runtime_61040_3.csproj | 1 - src/tests/JIT/opt/Cloning/Runtime_61040_4.cs | 6 +- .../JIT/opt/Cloning/Runtime_61040_4.csproj | 1 - src/tests/JIT/opt/Cloning/Runtime_61040_5.cs | 6 +- .../JIT/opt/Cloning/Runtime_61040_5.csproj | 1 - src/tests/JIT/opt/Cloning/Runtime_70802.cs | 6 +- .../JIT/opt/Cloning/Runtime_70802.csproj | 3 +- src/tests/JIT/opt/Cloning/callandindir.cs | 14 ++-- src/tests/JIT/opt/Cloning/callandindir.csproj | 1 - .../JIT/opt/Compares/compareAnd2Chains.cs | 46 ++++++++----- .../JIT/opt/Compares/compareAnd2Chains.csproj | 3 +- .../JIT/opt/Compares/compareAnd3Chains.cs | 19 ++++-- .../JIT/opt/Compares/compareAnd3Chains.csproj | 3 +- .../JIT/opt/Compares/compareAndTestChains.cs | 4 +- .../opt/Compares/compareAndTestChains.csproj | 3 - src/tests/JIT/opt/Compares/compares.cs | 68 ++++++++++++------- src/tests/JIT/opt/Compares/compares.csproj | 3 +- .../JIT/opt/Compares/conditionalIncrements.cs | 4 +- .../opt/Compares/conditionalIncrements.csproj | 3 +- ...otRedundantInitsAreRemoved_Github_48394.cs | 25 +++---- ...dundantInitsAreRemoved_Github_48394.csproj | 1 - .../Devirtualization/Comparer_get_Default.cs | 6 +- .../Comparer_get_Default.csproj | 1 - .../EqualityComparer_GitHub_10050.cs | 6 +- .../EqualityComparer_GitHub_10050.csproj | 1 - .../Devirtualization/GDV_GenericInterface.cs | 4 +- .../GDV_GenericInterface.csproj | 3 +- .../Devirtualization/GenericArrayOverride.il | 10 +-- .../GenericArrayOverride.ilproj | 1 - .../JIT/opt/Devirtualization/GitHub_10311.cs | 6 +- .../opt/Devirtualization/GitHub_10311.csproj | 1 - .../JIT/opt/Devirtualization/GitHub_10858.cs | 17 +++-- .../opt/Devirtualization/GitHub_10858.csproj | 1 - .../JIT/opt/Devirtualization/GitHub_50492.cs | 6 +- .../opt/Devirtualization/GitHub_50492.csproj | 3 +- .../JIT/opt/Devirtualization/GitHub_51918.cs | 4 +- .../opt/Devirtualization/GitHub_51918.csproj | 1 - .../JIT/opt/Devirtualization/GitHub_59668.cs | 6 +- .../opt/Devirtualization/GitHub_59668.csproj | 1 - .../JIT/opt/Devirtualization/GitHub_9945.cs | 13 +++- .../opt/Devirtualization/GitHub_9945.csproj | 1 - .../opt/Devirtualization/GitHub_9945_2.ilproj | 1 - ...pleCanonicallyCompatibleImplementations.cs | 4 +- ...anonicallyCompatibleImplementations.csproj | 1 - .../JIT/opt/Devirtualization/arraypool.cs | 6 +- .../JIT/opt/Devirtualization/arraypool.csproj | 3 - src/tests/JIT/opt/Devirtualization/box1.cs | 6 +- .../JIT/opt/Devirtualization/box1.csproj | 3 - .../JIT/opt/Devirtualization/box2.csproj | 3 +- .../JIT/opt/Devirtualization/comparable.cs | 4 +- .../opt/Devirtualization/comparable.csproj | 1 - .../JIT/opt/Devirtualization/constructor.cs | 6 +- .../opt/Devirtualization/constructor.csproj | 3 - .../opt/Devirtualization/contravariance.cs | 6 +- .../Devirtualization/contravariance.csproj | 1 - .../JIT/opt/Devirtualization/covariance.cs | 6 +- .../opt/Devirtualization/covariance.csproj | 1 - src/tests/JIT/opt/Devirtualization/enum.cs | 4 +- .../JIT/opt/Devirtualization/enum.csproj | 1 - src/tests/JIT/opt/Devirtualization/exact1.cs | 6 +- .../JIT/opt/Devirtualization/exact1.csproj | 1 - src/tests/JIT/opt/Devirtualization/exact2.cs | 6 +- .../JIT/opt/Devirtualization/exact2.csproj | 1 - .../JIT/opt/Devirtualization/exacttype.cs | 4 +- .../JIT/opt/Devirtualization/exacttype.csproj | 1 - .../opt/Devirtualization/fromcollection.cs | 4 +- .../Devirtualization/fromcollection.csproj | 1 - src/tests/JIT/opt/Devirtualization/generic.cs | 4 +- .../JIT/opt/Devirtualization/generic.csproj | 1 - .../opt/Devirtualization/generic_noinline.cs | 6 +- .../Devirtualization/generic_noinline.csproj | 3 - .../JIT/opt/Devirtualization/inlinedevirt.cs | 6 +- .../opt/Devirtualization/inlinedevirt.csproj | 1 - src/tests/JIT/opt/Devirtualization/late.cs | 4 +- .../JIT/opt/Devirtualization/late.csproj | 1 - src/tests/JIT/opt/Devirtualization/late1.cs | 4 +- .../JIT/opt/Devirtualization/late1.csproj | 3 - .../JIT/opt/Devirtualization/overload.cs | 6 +- .../JIT/opt/Devirtualization/overload.csproj | 1 - .../JIT/opt/Devirtualization/override.ilproj | 1 - .../opt/Devirtualization/readonlystatic.cs | 6 +- .../Devirtualization/readonlystatic.csproj | 3 - .../JIT/opt/Devirtualization/sealedclass.cs | 4 +- .../opt/Devirtualization/sealedclass.csproj | 1 - .../JIT/opt/Devirtualization/sealeddefault.cs | 4 +- .../opt/Devirtualization/sealeddefault.csproj | 1 - .../JIT/opt/Devirtualization/sealedmethod.cs | 4 +- .../opt/Devirtualization/sealedmethod.csproj | 1 - .../opt/Devirtualization/sharedoverride.cs | 4 +- .../Devirtualization/sharedoverride.csproj | 1 - src/tests/JIT/opt/Devirtualization/simple.cs | 4 +- .../JIT/opt/Devirtualization/simple.csproj | 1 - .../JIT/opt/Devirtualization/spilledreturn.cs | 12 +++- .../opt/Devirtualization/spilledreturn.csproj | 1 - .../Devirtualization/structreturningstruct.cs | 6 +- .../structreturningstruct.csproj | 3 +- src/tests/JIT/opt/Directory.Build.props | 11 +++ .../opt/Divide/Regressions/Regression1.csproj | 12 ---- .../{Regression1.cs => Regression1_Divide.cs} | 4 +- .../Regressions/Regression1_Divide.csproj} | 2 +- .../{Regression2.cs => Regression2_Divide.cs} | 4 +- ...sion3.csproj => Regression2_Divide.csproj} | 3 - .../{Regression3.cs => Regression3_Divide.cs} | 4 +- ...sion2.csproj => Regression3_Divide.csproj} | 3 - .../JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il | 4 +- ...BBCnt1.ilproj => BBCnt1_DumpDisasm.ilproj} | 1 - .../opt/DumpDisasm/JitMinOpts/CodeSize1.il | 4 +- ...ze1.ilproj => CodeSize1_DumpDisasm.ilproj} | 1 - .../opt/DumpDisasm/JitMinOpts/InstrCnt1.il | 4 +- ...nt1.ilproj => InstrCnt1_DumpDisasm.ilproj} | 3 - .../opt/DumpDisasm/JitMinOpts/LVNumCnt1.il | 8 ++- .../JitMinOpts/LVNumCnt1_DumpDisasm.ilproj} | 1 - .../opt/DumpDisasm/JitMinOpts/LVRefCnt1.il | 8 ++- ...nt1.ilproj => LVRefCnt1_DumpDisasm.ilproj} | 1 - src/tests/JIT/opt/ETW/TailCallCases.il | 4 +- src/tests/JIT/opt/ETW/TailCallCases.ilproj | 3 - src/tests/JIT/opt/Enum/hasflag.cs | 16 +++-- src/tests/JIT/opt/Enum/hasflag.csproj | 3 - src/tests/JIT/opt/Enum/shared.cs | 6 +- .../{shared.csproj => shared_Enum.csproj} | 1 - .../FastTailCall/FastTailCallCandidates.cs | 6 +- .../FastTailCallCandidates.csproj | 3 +- .../opt/FastTailCall/FastTailCallInlining.cs | 15 ++-- .../FastTailCall/FastTailCallInlining.csproj | 3 +- .../JIT/opt/FastTailCall/GitHubIssue12479.cs | 4 +- .../opt/FastTailCall/GitHubIssue12479.csproj | 3 +- src/tests/JIT/opt/FastTailCall/StackFixup.cs | 6 +- .../JIT/opt/FastTailCall/StackFixup.csproj | 3 +- .../opt/FastTailCall/StructPassingSimple.cs | 6 +- .../FastTailCall/StructPassingSimple.csproj | 3 +- .../JIT/opt/ForwardSub/andnotcontained.cs | 6 +- .../JIT/opt/ForwardSub/andnotcontained.csproj | 1 - .../JIT/opt/ForwardSub/callArgInterference.cs | 6 +- .../opt/ForwardSub/callArgInterference.csproj | 1 - .../opt/ForwardSub/callArgInterference2.cs | 6 +- .../ForwardSub/callArgInterference2.csproj | 1 - .../opt/ForwardSub/callArgInterference3.cs | 10 +-- .../ForwardSub/callArgInterference3.csproj | 1 - src/tests/JIT/opt/ForwardSub/earlyLiveness.cs | 6 +- .../JIT/opt/ForwardSub/earlyLiveness.csproj | 1 - .../ForwardSub/lowerContainCheckCompare.cs | 6 +- .../lowerContainCheckCompare.csproj | 1 - src/tests/JIT/opt/ForwardSub/modOpt.cs | 6 +- src/tests/JIT/opt/ForwardSub/modOpt.csproj | 1 - .../JIT/opt/ForwardSub/normalizeOnStore.il | 15 ++-- .../opt/ForwardSub/normalizeOnStore.ilproj | 1 - .../opt/ForwardSub/switchWithSideEffects.cs | 6 +- .../ForwardSub/switchWithSideEffects.csproj | 1 - .../enumerablecloning.cs | 6 +- .../enumerablecloning.csproj | 3 +- .../typetestcloning.cs | 10 +-- .../typetestcloning.csproj | 3 +- src/tests/JIT/opt/Hoisting/Hoisting.cs | 6 +- src/tests/JIT/opt/Hoisting/Hoisting.csproj | 1 - .../Inline/regression/badcallee/badcallee.il | 19 ++++-- .../regression/badcallee/badcallee.ilproj | 3 +- .../regression/bug584219/inliningVars.cs | 6 +- .../regression/bug584219/inliningVars.csproj | 1 - .../Inline/regression/bug595776/bug595776.cs | 6 +- .../regression/bug595776/bug595776.csproj | 1 - .../regression/mismatch32/mismatch32.il | 8 +-- .../regression/mismatch32/mismatch32.ilproj | 1 - .../regression/mismatch64/mismatch64.il | 8 +-- .../regression/mismatch64/mismatch64.ilproj | 1 - .../JIT/opt/Inline/tests/ArrayOfStructs.cs | 4 +- .../opt/Inline/tests/ArrayOfStructs.csproj | 1 - .../JIT/opt/Inline/tests/DelegInstanceFtn.cs | 6 +- .../opt/Inline/tests/DelegInstanceFtn.csproj | 1 - .../JIT/opt/Inline/tests/DelegStaticFtn.cs | 6 +- .../opt/Inline/tests/DelegStaticFtn.csproj | 1 - .../JIT/opt/Inline/tests/GenericStructs.cs | 6 +- .../opt/Inline/tests/GenericStructs.csproj | 1 - src/tests/JIT/opt/Inline/tests/Inline.cs | 6 +- src/tests/JIT/opt/Inline/tests/Inline.csproj | 1 - .../JIT/opt/Inline/tests/InlineThrow.csproj | 3 - .../opt/Inline/tests/Inline_DelegateStruct.cs | 6 +- .../Inline/tests/Inline_DelegateStruct.csproj | 1 - .../opt/Inline/tests/Inline_DetectChanges.cs | 6 +- .../Inline/tests/Inline_DetectChanges.csproj | 1 - .../opt/Inline/tests/Inline_GenericMethods.cs | 8 ++- .../Inline/tests/Inline_GenericMethods.csproj | 1 - src/tests/JIT/opt/Inline/tests/Inline_Many.cs | 6 +- .../JIT/opt/Inline/tests/Inline_Many.csproj | 1 - .../opt/Inline/tests/Inline_MultipleReturn.cs | 6 +- .../Inline/tests/Inline_MultipleReturn.csproj | 1 - .../JIT/opt/Inline/tests/Inline_NewObj.cs | 6 +- .../JIT/opt/Inline/tests/Inline_NewObj.csproj | 1 - .../opt/Inline/tests/Inline_NormalizeStack.cs | 6 +- .../Inline/tests/Inline_NormalizeStack.csproj | 1 - .../JIT/opt/Inline/tests/Inline_Recursion.cs | 6 +- .../opt/Inline/tests/Inline_Recursion.csproj | 1 - .../Inline/tests/Inline_RecursiveMethod.cs | 4 +- .../tests/Inline_RecursiveMethod.csproj | 1 - .../Inline/tests/Inline_RecursiveMethod21.cs | 4 +- .../tests/Inline_RecursiveMethod21.csproj | 1 - .../JIT/opt/Inline/tests/Inline_STARG.cs | 8 ++- .../JIT/opt/Inline/tests/Inline_STARG.csproj | 1 - .../opt/Inline/tests/Inline_SideAffects.cs | 6 +- .../Inline/tests/Inline_SideAffects.csproj | 1 - src/tests/JIT/opt/Inline/tests/Inline_Vars.cs | 4 +- .../JIT/opt/Inline/tests/Inline_Vars.csproj | 1 - .../JIT/opt/Inline/tests/Inline_handler.cs | 14 ++-- .../opt/Inline/tests/Inline_handler.csproj | 1 - src/tests/JIT/opt/Inline/tests/Inlinethrow.cs | 10 +-- .../JIT/opt/Inline/tests/LotsOfInlines.cs | 4 +- .../JIT/opt/Inline/tests/LotsOfInlines.csproj | 1 - .../opt/Inline/tests/ReturnStruct_Method.cs | 4 +- .../Inline/tests/ReturnStruct_Method.csproj | 1 - .../opt/Inline/tests/StructAsParam_Method.cs | 6 +- .../Inline/tests/StructAsParam_Method.csproj | 1 - .../JIT/opt/Inline/tests/StructInClass.cs | 6 +- .../JIT/opt/Inline/tests/StructInClass.csproj | 1 - .../JIT/opt/Inline/tests/UnsafeBlockCopy.cs | 6 +- .../opt/Inline/tests/UnsafeBlockCopy.csproj | 1 - src/tests/JIT/opt/Inline/tests/args1.cs | 6 +- src/tests/JIT/opt/Inline/tests/args1.csproj | 1 - src/tests/JIT/opt/Inline/tests/args2.cs | 8 ++- src/tests/JIT/opt/Inline/tests/args2.csproj | 1 - src/tests/JIT/opt/Inline/tests/args3.cs | 8 ++- src/tests/JIT/opt/Inline/tests/args3.csproj | 1 - src/tests/JIT/opt/Inline/tests/array.cs | 4 +- src/tests/JIT/opt/Inline/tests/array.csproj | 1 - src/tests/JIT/opt/Inline/tests/calli.il | 2 +- src/tests/JIT/opt/Inline/tests/calli.ilproj | 1 - src/tests/JIT/opt/Inline/tests/debug.cs | 6 +- src/tests/JIT/opt/Inline/tests/debug.csproj | 1 - src/tests/JIT/opt/Inline/tests/deepcall.cs | 6 +- .../JIT/opt/Inline/tests/deepcall.csproj | 1 - src/tests/JIT/opt/Inline/tests/fact.cs | 6 +- src/tests/JIT/opt/Inline/tests/fact.csproj | 1 - src/tests/JIT/opt/Inline/tests/ifelse.cs | 6 +- src/tests/JIT/opt/Inline/tests/ifelse.csproj | 1 - src/tests/JIT/opt/Inline/tests/indexer.cs | 4 +- src/tests/JIT/opt/Inline/tests/indexer.csproj | 1 - .../JIT/opt/Inline/tests/interfaceCall.cs | 6 +- .../JIT/opt/Inline/tests/interfaceCall.csproj | 1 - .../JIT/opt/Inline/tests/interfaceProperty.cs | 4 +- .../opt/Inline/tests/interfaceproperty.csproj | 1 - src/tests/JIT/opt/Inline/tests/mathfunc.cs | 6 +- .../JIT/opt/Inline/tests/mathfunc.csproj | 3 - src/tests/JIT/opt/Inline/tests/mthdimpl.cs | 6 +- .../JIT/opt/Inline/tests/mthdimpl.csproj | 1 - src/tests/JIT/opt/Inline/tests/property.cs | 6 +- .../JIT/opt/Inline/tests/property.csproj | 1 - src/tests/JIT/opt/Inline/tests/size.cs | 6 +- src/tests/JIT/opt/Inline/tests/size.csproj | 1 - .../JIT/opt/Inline/tests/struct_opcodes.cs | 14 ++-- .../opt/Inline/tests/struct_opcodes.csproj | 1 - src/tests/JIT/opt/Inline/tests/throwTest.cs | 6 +- .../JIT/opt/Inline/tests/throwtest.csproj | 1 - src/tests/JIT/opt/Inline/tests/trycatch.cs | 6 +- .../JIT/opt/Inline/tests/trycatch.csproj | 1 - .../ArrayLengthArithmetic.cs | 4 +- .../ArrayLengthArithmetic.csproj | 3 - .../JIT/opt/InstructionCombining/DivToMul.cs | 4 +- .../opt/InstructionCombining/DivToMul.csproj | 3 - .../JIT/opt/InstructionCombining/MulToAdd.cs | 4 +- .../opt/InstructionCombining/MulToAdd.csproj | 3 - .../NegMulOrDivToConst.cs | 6 +- .../NegMulOrDivToConst.csproj | 3 +- .../opt/InstructionCombining/UbfizSbfiz.cs | 8 ++- .../InstructionCombining/UbfizSbfiz.csproj | 3 - ...als.cs => StringEquals_IsKnownConstant.cs} | 4 +- .../StringEquals_IsKnownConstant.csproj | 8 +++ .../opt/IsKnownConstant/TypeGetTypeCode.cs | 4 +- .../IsKnownConstant/TypeGetTypeCode.csproj | 1 - src/tests/JIT/opt/JIT.opt.csproj | 7 ++ src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il | 2 +- .../JIT/opt/JitMinOpts/Perf/BBCnt0.ilproj | 1 - src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il | 4 +- .../{BBCnt1.ilproj => BBCnt1_Perf.ilproj} | 1 - .../JIT/opt/JitMinOpts/Perf/CodeSize0.il | 2 +- .../JIT/opt/JitMinOpts/Perf/CodeSize0.ilproj | 1 - .../JIT/opt/JitMinOpts/Perf/CodeSize1.il | 4 +- ...CodeSize1.ilproj => CodeSize1_Perf.ilproj} | 1 - .../JIT/opt/JitMinOpts/Perf/InstrCnt0.il | 7 +- .../JIT/opt/JitMinOpts/Perf/InstrCnt0.ilproj | 1 - .../JIT/opt/JitMinOpts/Perf/InstrCnt1.il | 9 ++- ...InstrCnt1.ilproj => InstrCnt1_Perf.ilproj} | 1 - .../JIT/opt/JitMinOpts/Perf/LVNumCnt0.il | 7 +- .../JIT/opt/JitMinOpts/Perf/LVNumCnt0.ilproj | 1 - .../JIT/opt/JitMinOpts/Perf/LVNumCnt1.il | 9 ++- .../Perf/LVNumCnt1_Perf.ilproj} | 1 - .../JIT/opt/JitMinOpts/Perf/LVRefCnt0.il | 6 ++ .../JIT/opt/JitMinOpts/Perf/LVRefCnt0.ilproj | 1 - .../JIT/opt/JitMinOpts/Perf/LVRefCnt1.il | 8 ++- ...LVRefCnt1.ilproj => LVRefCnt1_Perf.ilproj} | 1 - .../opt/JitMinOpts/Regression/GitHub_42719.il | 9 ++- .../JitMinOpts/Regression/GitHub_42719_r.il | 1 + ...Hub_42719.ilproj => GitHub_42719_r.ilproj} | 2 +- .../JitMinOpts/Regression/GitHub_42719_ro.il | 1 + ...719_il_r.ilproj => GitHub_42719_ro.ilproj} | 2 +- src/tests/JIT/opt/LocAlloc/inloop.cs | 6 +- src/tests/JIT/opt/LocAlloc/inloop.csproj | 3 - src/tests/JIT/opt/LocAlloc/localloc.cs | 6 +- src/tests/JIT/opt/LocAlloc/localloc.csproj | 3 - .../opt/Loops/LoopSideEffectsForHwiStores.cs | 6 +- .../Loops/LoopSideEffectsForHwiStores.csproj | 1 - src/tests/JIT/opt/Loops/SearchLoopTail.cs | 4 +- src/tests/JIT/opt/Loops/SearchLoopTail.csproj | 1 - src/tests/JIT/opt/Multiply/IntMultiply.cs | 6 +- src/tests/JIT/opt/Multiply/IntMultiply.csproj | 3 +- src/tests/JIT/opt/OSR/Runtime_69032.cs | 6 +- src/tests/JIT/opt/OSR/Runtime_69032.csproj | 3 +- src/tests/JIT/opt/OSR/addressexposedlocal.cs | 8 ++- .../JIT/opt/OSR/addressexposedlocal.csproj | 3 +- src/tests/JIT/opt/OSR/doublestackalloc.cs | 6 +- src/tests/JIT/opt/OSR/doublestackalloc.csproj | 3 +- src/tests/JIT/opt/OSR/example.cs | 16 +++-- src/tests/JIT/opt/OSR/example.csproj | 3 +- src/tests/JIT/opt/OSR/exposure1.cs | 4 +- src/tests/JIT/opt/OSR/exposure1.csproj | 3 +- src/tests/JIT/opt/OSR/exposure2.cs | 4 +- src/tests/JIT/opt/OSR/exposure2.csproj | 3 +- .../JIT/opt/OSR/genericmethodpatchpoint.cs | 6 +- .../opt/OSR/genericmethodpatchpoint.csproj | 3 +- src/tests/JIT/opt/OSR/handlerloop.cs | 6 +- src/tests/JIT/opt/OSR/handlerloop.csproj | 3 +- src/tests/JIT/opt/OSR/innerloop.cs | 6 +- src/tests/JIT/opt/OSR/innerloop.csproj | 3 +- src/tests/JIT/opt/OSR/integersumloop.cs | 6 +- src/tests/JIT/opt/OSR/integersumloop.csproj | 3 +- src/tests/JIT/opt/OSR/invalidpromotion.cs | 4 +- src/tests/JIT/opt/OSR/invalidpromotion.csproj | 3 +- src/tests/JIT/opt/OSR/largefuncletframe.cs | 7 +- .../JIT/opt/OSR/largefuncletframe.csproj | 3 +- src/tests/JIT/opt/OSR/livelocaladdress.cs | 6 +- src/tests/JIT/opt/OSR/livelocaladdress.csproj | 3 +- src/tests/JIT/opt/OSR/livelocalstackalloc.cs | 6 +- .../JIT/opt/OSR/livelocalstackalloc.csproj | 3 +- src/tests/JIT/opt/OSR/mainloop.cs | 7 +- src/tests/JIT/opt/OSR/mainloop.csproj | 3 +- src/tests/JIT/opt/OSR/mainloop2.cs | 7 +- src/tests/JIT/opt/OSR/mainloop2.csproj | 3 +- src/tests/JIT/opt/OSR/mainlooptry.cs | 6 +- src/tests/JIT/opt/OSR/mainlooptry.csproj | 3 +- src/tests/JIT/opt/OSR/mainlooptry2.cs | 6 +- src/tests/JIT/opt/OSR/mainlooptry2.csproj | 3 +- src/tests/JIT/opt/OSR/mainlooptry3.cs | 6 +- src/tests/JIT/opt/OSR/mainlooptry3.csproj | 3 +- src/tests/JIT/opt/OSR/mainlooptry4.cs | 6 +- src/tests/JIT/opt/OSR/mainlooptry4.csproj | 3 +- src/tests/JIT/opt/OSR/memoryargument.cs | 6 +- src/tests/JIT/opt/OSR/memoryargument.csproj | 3 +- src/tests/JIT/opt/OSR/nesteddoloops.cs | 6 +- src/tests/JIT/opt/OSR/nesteddoloops.csproj | 3 +- src/tests/JIT/opt/OSR/normalizeonload.cs | 6 +- src/tests/JIT/opt/OSR/normalizeonload.csproj | 3 +- src/tests/JIT/opt/OSR/originalstackalloc.cs | 6 +- .../JIT/opt/OSR/originalstackalloc.csproj | 3 +- src/tests/JIT/opt/OSR/osrcontainstry.cs | 6 +- src/tests/JIT/opt/OSR/osrcontainstry.csproj | 3 +- src/tests/JIT/opt/OSR/pinnedlocal.cs | 6 +- src/tests/JIT/opt/OSR/pinnedlocal.csproj | 3 +- src/tests/JIT/opt/OSR/promoted.cs | 6 +- src/tests/JIT/opt/OSR/promoted.csproj | 3 +- src/tests/JIT/opt/OSR/shadowparam.cs | 4 +- src/tests/JIT/opt/OSR/shadowparam.csproj | 1 - .../JIT/opt/OSR/shortenregisteredlocal.cs | 10 +-- .../JIT/opt/OSR/shortenregisteredlocal.csproj | 3 +- src/tests/JIT/opt/OSR/synchronized.cs | 8 ++- src/tests/JIT/opt/OSR/synchronized.csproj | 3 +- src/tests/JIT/opt/OSR/tailpgo.cs | 10 +-- src/tests/JIT/opt/OSR/tailpgo.csproj | 3 +- src/tests/JIT/opt/OSR/tailpgo2.cs | 8 ++- src/tests/JIT/opt/OSR/tailpgo2.csproj | 3 +- src/tests/JIT/opt/OSR/tailrecurse.cs | 6 +- src/tests/JIT/opt/OSR/tailrecurse.csproj | 3 +- src/tests/JIT/opt/OSR/tailrecursetry.cs | 6 +- src/tests/JIT/opt/OSR/tailrecursetry.csproj | 3 +- src/tests/JIT/opt/OSR/tailrecursetry2.cs | 6 +- src/tests/JIT/opt/OSR/tailrecursetry2.csproj | 3 +- src/tests/JIT/opt/OSR/twoosrmethods.cs | 8 ++- src/tests/JIT/opt/OSR/twoosrmethods.csproj | 3 +- src/tests/JIT/opt/OSR/twoosrmethods1.cs | 6 +- src/tests/JIT/opt/OSR/twoosrmethods1.csproj | 3 +- .../ObjectStackAllocationTests.cs | 6 +- .../ObjectStackAllocationTests.csproj | 3 +- .../JIT/opt/OptimizeBools/optboolsreturn.cs | 4 +- .../opt/OptimizeBools/optboolsreturn.csproj | 3 - src/tests/JIT/opt/Or/IntOr.cs | 6 +- src/tests/JIT/opt/Or/IntOr.csproj | 3 +- src/tests/JIT/opt/RangeChecks/ModLength.cs | 4 +- .../JIT/opt/RangeChecks/ModLength.csproj | 1 - .../opt/RedundantBranch/RedundantBranchAnd.cs | 6 +- .../RedundantBranch/RedundantBranchAnd.csproj | 1 - .../opt/RedundantBranch/RedundantBranchOr.cs | 6 +- .../RedundantBranch/RedundantBranchOr.csproj | 1 - .../RedundantBranchUnsigned.cs | 4 +- .../RedundantBranchUnsigned.csproj | 1 - ...ression1.cs => Regression1_Regressions.cs} | 4 +- ....csproj => Regression1_Regressions.csproj} | 3 +- ...ression2.cs => Regression2_Regressions.cs} | 4 +- ....csproj => Regression2_Regressions.csproj} | 1 - ...ression3.cs => Regression3_Regressions.cs} | 10 ++- ....csproj => Regression3_Regressions.csproj} | 1 - src/tests/JIT/opt/Regressions/Regression4.cs | 6 +- .../JIT/opt/Regressions/Regression4.csproj | 1 - src/tests/JIT/opt/Regressions/Regression5.cs | 4 +- .../JIT/opt/Regressions/Regression5.csproj | 3 - src/tests/JIT/opt/Regressions/Regression6.cs | 4 +- .../JIT/opt/Regressions/Regression6.csproj | 3 - src/tests/JIT/opt/Regressions/Regression7.cs | 4 +- .../JIT/opt/Regressions/Regression7.csproj | 3 - src/tests/JIT/opt/Remainder/IntRemainder.cs | 6 +- .../JIT/opt/Remainder/IntRemainder.csproj | 3 +- .../Regressions/Regression1/Regression1.cs | 4 +- .../Regression1/Regression1.csproj | 3 - src/tests/JIT/opt/Structs/structcopies.cs | 6 +- src/tests/JIT/opt/Structs/structcopies.csproj | 3 - src/tests/JIT/opt/Structs/structpop.cs | 6 +- src/tests/JIT/opt/Structs/structpop.csproj | 3 - src/tests/JIT/opt/Structs/structpop2.cs | 6 +- src/tests/JIT/opt/Structs/structpop2.csproj | 3 - src/tests/JIT/opt/Subtract/IntSubtract.cs | 6 +- src/tests/JIT/opt/Subtract/IntSubtract.csproj | 3 +- .../JIT/opt/Tailcall/EarlyFlowOptExample.cs | 6 +- .../opt/Tailcall/EarlyFlowOptExample.csproj | 3 - .../opt/Tailcall/ImplicitByrefTailCalls.cs | 6 +- .../Tailcall/ImplicitByrefTailCalls.csproj | 3 - .../ImplicitByrefTailCallsAliasing.cs | 6 +- .../ImplicitByrefTailCallsAliasing.csproj | 3 - .../opt/Tailcall/TailcallVerifyWithPrefix.il | 12 +--- .../Tailcall/TailcallVerifyWithPrefix.ilproj | 3 +- .../JIT/opt/ThrowHelper/NonVoidThrowHelper.cs | 4 +- .../opt/ThrowHelper/NonVoidThrowHelper.csproj | 1 - src/tests/JIT/opt/ThrowHelper/ThrowHelper.cs | 32 +++++---- .../JIT/opt/ThrowHelper/ThrowHelper.csproj | 3 - .../opt/ThrowHelper/ThrowHelperAtTryEntry.cs | 6 +- .../ThrowHelper/ThrowHelperAtTryEntry.csproj | 3 - src/tests/JIT/opt/Types/Equality.cs | 6 +- src/tests/JIT/opt/Types/Equality.csproj | 3 - src/tests/JIT/opt/Unsafe/Unsafe.cs | 6 +- src/tests/JIT/opt/Unsafe/Unsafe.csproj | 3 +- .../JIT/opt/ValueNumbering/ConstIndexRVA.cs | 6 +- .../opt/ValueNumbering/ConstIndexRVA.csproj | 1 - .../ConstStringConstIndexOptimizations.cs | 4 +- .../ConstStringConstIndexOptimizations.csproj | 3 +- .../JIT/opt/ValueNumbering/ExceptionSets.cs | 6 +- .../opt/ValueNumbering/ExceptionSets.csproj | 1 - .../ExceptionSetsPropagation_Hwi.cs | 6 +- .../ExceptionSetsPropagation_Hwi.csproj | 1 - .../ExceptionSetsPropagation_LclHeap.il | 4 +- .../ExceptionSetsPropagation_LclHeap.ilproj | 1 - .../ValueNumbering/ExposedLocalsNumbering.cs | 6 +- .../ExposedLocalsNumbering.csproj | 3 +- .../StaticReadonlyStructWithGC.cs | 6 +- .../StaticReadonlyStructWithGC.csproj | 1 - .../JIT/opt/ValueNumbering/TypeTestFolding.cs | 6 +- .../opt/ValueNumbering/TypeTestFolding.csproj | 3 - .../opt/ValueNumbering/ZeroOffsetFieldSeqs.cs | 6 +- .../ValueNumbering/ZeroOffsetFieldSeqs.csproj | 3 - .../JIT/opt/Vectorization/BufferMemmove.cs | 6 +- .../opt/Vectorization/BufferMemmove.csproj | 1 - .../Vectorization/BufferMemmoveTailCall.il | 10 ++- .../BufferMemmoveTailCall.ilproj | 1 - .../SpanHelpers_SequenceEqual.cs | 4 +- .../SpanHelpers_SequenceEqual.csproj | 1 - .../opt/Vectorization/StackallocBlkTests.cs | 6 +- .../Vectorization/StackallocBlkTests.csproj | 1 - ...quals.cs => StringEquals_Vectorization.cs} | 4 +- .../StringEquals_Vectorization.csproj | 8 +++ .../Vectorization/UnrollEqualsStartsWIth.cs | 4 +- .../UnrollEqualsStartsWIth.csproj | 1 - .../JIT/opt/perf/doublealign/Arrays.csproj | 3 +- .../JIT/opt/perf/doublealign/Locals.csproj | 3 +- src/tests/JIT/opt/perf/doublealign/arrays.cs | 4 +- src/tests/JIT/opt/perf/doublealign/locals.cs | 4 +- src/tests/JIT/opt/perf/doublealign/objects.cs | 4 +- .../JIT/opt/perf/doublealign/objects.csproj | 3 +- .../JIT/opt/perf/doublenegate/GitHub_57470.cs | 6 +- .../opt/perf/doublenegate/GitHub_57470.csproj | 1 - .../JIT/opt/perf/doublenegate/doublenegate.cs | 6 +- .../opt/perf/doublenegate/doublenegate.csproj | 1 - .../JIT/opt/perf/movelim/CalculateChecksum.cs | 6 +- .../opt/perf/movelim/CalculateChecksum.csproj | 3 +- .../virtualstubdispatch/bigvtbl/bigvtbl.cs | 6 +- .../bigvtbl/bigvtbl_cs_d.csproj | 3 +- .../bigvtbl/bigvtbl_cs_do.csproj | 3 - .../bigvtbl/bigvtbl_cs_r.csproj | 3 +- .../bigvtbl/bigvtbl_cs_ro.csproj | 3 - .../virtualstubdispatch/hashcode/ctest1.cs | 6 +- .../hashcode/ctest1_cs_d.csproj | 1 - .../hashcode/ctest1_cs_do.csproj | 1 - .../hashcode/ctest1_cs_r.csproj | 1 - .../hashcode/ctest1_cs_ro.csproj | 1 - .../opt/virtualstubdispatch/manyintf/ctest.cs | 6 +- .../manyintf/ctest_cs_d.csproj | 1 - .../manyintf/ctest_cs_do.csproj | 1 - .../manyintf/ctest_cs_r.csproj | 1 - .../manyintf/ctest_cs_ro.csproj | 1 - .../opt/virtualstubdispatch/mixed/mixed.cs | 8 ++- .../mixed/mixed_cs_d.csproj | 3 +- .../mixed/mixed_cs_do.csproj | 3 +- .../mixed/mixed_cs_r.csproj | 3 +- .../mixed/mixed_cs_ro.csproj | 3 +- 559 files changed, 1389 insertions(+), 1014 deletions(-) delete mode 100644 src/tests/JIT/opt/And/Regressions/Regression1.csproj rename src/tests/JIT/opt/And/Regressions/{Regression1.cs => Regression1_And.cs} (92%) rename src/tests/JIT/opt/{IsKnownConstant/StringEquals.csproj => And/Regressions/Regression1_And.csproj} (85%) rename src/tests/JIT/opt/Casts/{shared.csproj => shared_Casts.csproj} (75%) create mode 100644 src/tests/JIT/opt/Directory.Build.props delete mode 100644 src/tests/JIT/opt/Divide/Regressions/Regression1.csproj rename src/tests/JIT/opt/Divide/Regressions/{Regression1.cs => Regression1_Divide.cs} (98%) rename src/tests/JIT/opt/{Vectorization/StringEquals.csproj => Divide/Regressions/Regression1_Divide.csproj} (85%) rename src/tests/JIT/opt/Divide/Regressions/{Regression2.cs => Regression2_Divide.cs} (93%) rename src/tests/JIT/opt/Divide/Regressions/{Regression3.csproj => Regression2_Divide.csproj} (76%) rename src/tests/JIT/opt/Divide/Regressions/{Regression3.cs => Regression3_Divide.cs} (90%) rename src/tests/JIT/opt/Divide/Regressions/{Regression2.csproj => Regression3_Divide.csproj} (76%) rename src/tests/JIT/opt/DumpDisasm/JitMinOpts/{BBCnt1.ilproj => BBCnt1_DumpDisasm.ilproj} (89%) rename src/tests/JIT/opt/DumpDisasm/JitMinOpts/{CodeSize1.ilproj => CodeSize1_DumpDisasm.ilproj} (89%) rename src/tests/JIT/opt/DumpDisasm/JitMinOpts/{InstrCnt1.ilproj => InstrCnt1_DumpDisasm.ilproj} (75%) rename src/tests/JIT/opt/{JitMinOpts/Perf/LVNumCnt1.ilproj => DumpDisasm/JitMinOpts/LVNumCnt1_DumpDisasm.ilproj} (89%) rename src/tests/JIT/opt/DumpDisasm/JitMinOpts/{LVRefCnt1.ilproj => LVRefCnt1_DumpDisasm.ilproj} (89%) rename src/tests/JIT/opt/Enum/{shared.csproj => shared_Enum.csproj} (89%) rename src/tests/JIT/opt/IsKnownConstant/{StringEquals.cs => StringEquals_IsKnownConstant.cs} (98%) create mode 100644 src/tests/JIT/opt/IsKnownConstant/StringEquals_IsKnownConstant.csproj create mode 100644 src/tests/JIT/opt/JIT.opt.csproj rename src/tests/JIT/opt/JitMinOpts/Perf/{BBCnt1.ilproj => BBCnt1_Perf.ilproj} (89%) rename src/tests/JIT/opt/JitMinOpts/Perf/{CodeSize1.ilproj => CodeSize1_Perf.ilproj} (89%) rename src/tests/JIT/opt/JitMinOpts/Perf/{InstrCnt1.ilproj => InstrCnt1_Perf.ilproj} (89%) rename src/tests/JIT/opt/{DumpDisasm/JitMinOpts/LVNumCnt1.ilproj => JitMinOpts/Perf/LVNumCnt1_Perf.ilproj} (89%) rename src/tests/JIT/opt/JitMinOpts/Perf/{LVRefCnt1.ilproj => LVRefCnt1_Perf.ilproj} (89%) create mode 100644 src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_r.il rename src/tests/JIT/opt/JitMinOpts/Regression/{GitHub_42719.ilproj => GitHub_42719_r.ilproj} (80%) create mode 100644 src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_ro.il rename src/tests/JIT/opt/JitMinOpts/Regression/{GitHub_42719_il_r.ilproj => GitHub_42719_ro.ilproj} (80%) rename src/tests/JIT/opt/Regressions/{Regression1.cs => Regression1_Regressions.cs} (95%) rename src/tests/JIT/opt/Regressions/{Regression1.csproj => Regression1_Regressions.csproj} (78%) rename src/tests/JIT/opt/Regressions/{Regression2.cs => Regression2_Regressions.cs} (96%) rename src/tests/JIT/opt/Regressions/{Regression2.csproj => Regression2_Regressions.csproj} (91%) rename src/tests/JIT/opt/Regressions/{Regression3.cs => Regression3_Regressions.cs} (86%) rename src/tests/JIT/opt/Regressions/{Regression3.csproj => Regression3_Regressions.csproj} (91%) rename src/tests/JIT/opt/Vectorization/{StringEquals.cs => StringEquals_Vectorization.cs} (99%) create mode 100644 src/tests/JIT/opt/Vectorization/StringEquals_Vectorization.csproj diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs index 143c3dbd0994c..90673831f8137 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs @@ -767,7 +767,7 @@ private static ImmutableArray CreateTestCases(IMethodSymbol method, L // Emit diagnostic continue; } - var argsAsCode = ImmutableArray.CreateRange(args.Select(a => a.ToCSharpString())); + var argsAsCode = ImmutableArray.CreateRange(args.Select(a => a.ToCSharpString() + (a.Type!.SpecialType == SpecialType.System_Single ? "F" : ""))); testCasesBuilder.Add(new BasicTestMethod(method, alias, arguments: argsAsCode)); break; } diff --git a/src/tests/JIT/opt/Add/IntAdd.cs b/src/tests/JIT/opt/Add/IntAdd.cs index 158e54a1e2290..f840a951dddce 100644 --- a/src/tests/JIT/opt/Add/IntAdd.cs +++ b/src/tests/JIT/opt/Add/IntAdd.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - static class IntAdd + public static class IntAdd { [MethodImpl(MethodImplOptions.NoInlining)] static sbyte Int8_Add(sbyte x, sbyte y) @@ -86,7 +87,8 @@ static ulong UInt64_Add(ulong x, ulong y) return x + y; } - static int Main() + [Fact] + public static int TestEntryPoint() { // Int8 if (Int8_Add(SByte.MaxValue, 15) != -114) diff --git a/src/tests/JIT/opt/Add/IntAdd.csproj b/src/tests/JIT/opt/Add/IntAdd.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Add/IntAdd.csproj +++ b/src/tests/JIT/opt/Add/IntAdd.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/And/IntAnd.cs b/src/tests/JIT/opt/And/IntAnd.cs index 1f2e2275c5780..5faaffa1e08c0 100644 --- a/src/tests/JIT/opt/And/IntAnd.cs +++ b/src/tests/JIT/opt/And/IntAnd.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - class IntAnd + public class IntAnd { [MethodImpl(MethodImplOptions.NoInlining)] static void SideEffect() @@ -70,7 +71,8 @@ static uint Test_And_UInt32_MaxValue(uint i) return i & UInt32.MaxValue; } - static int Main() + [Fact] + public static int TestEntryPoint() { // No CastByte if (!Test_UInt32_UInt32_And(0b1000_0000_0000_0000_0000_0000_0000_0000, 0b0000_0000_0000_0000_0000_0000_0000_0001)) diff --git a/src/tests/JIT/opt/And/IntAnd.csproj b/src/tests/JIT/opt/And/IntAnd.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/And/IntAnd.csproj +++ b/src/tests/JIT/opt/And/IntAnd.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/And/Regressions/Regression1.csproj b/src/tests/JIT/opt/And/Regressions/Regression1.csproj deleted file mode 100644 index f3e1cbd44b404..0000000000000 --- a/src/tests/JIT/opt/And/Regressions/Regression1.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - Exe - - - None - True - - - - - diff --git a/src/tests/JIT/opt/And/Regressions/Regression1.cs b/src/tests/JIT/opt/And/Regressions/Regression1_And.cs similarity index 92% rename from src/tests/JIT/opt/And/Regressions/Regression1.cs rename to src/tests/JIT/opt/And/Regressions/Regression1_And.cs index a2f282bca8c8e..42076ccddcca6 100644 --- a/src/tests/JIT/opt/And/Regressions/Regression1.cs +++ b/src/tests/JIT/opt/And/Regressions/Regression1_And.cs @@ -7,10 +7,12 @@ // // File: D:\a\_work\1\s\src\coreclr\jit\lowerxarch.cpp Line: 5118 // +using Xunit; public class Program { public static bool s_26; - public static int Main() + [Fact] + public static int TestEntryPoint() { var vr2 = new uint[,] { { 0 } }; int vr7 = default(int); diff --git a/src/tests/JIT/opt/IsKnownConstant/StringEquals.csproj b/src/tests/JIT/opt/And/Regressions/Regression1_And.csproj similarity index 85% rename from src/tests/JIT/opt/IsKnownConstant/StringEquals.csproj rename to src/tests/JIT/opt/And/Regressions/Regression1_And.csproj index 6946bed81bfd5..501217e4d8689 100644 --- a/src/tests/JIT/opt/IsKnownConstant/StringEquals.csproj +++ b/src/tests/JIT/opt/And/Regressions/Regression1_And.csproj @@ -1,6 +1,6 @@ - Exe + None True diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.cs b/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.cs index 7d103e0f8c408..bf464158a0d2e 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.cs +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.cs @@ -5,12 +5,14 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using Xunit; -class Program +public class Program { private static int returnCode = 100; - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] testIndices = Enumerable.Range(-50, 50) // also add some corner case values diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.csproj b/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.csproj index 5e0b56dad86ed..04d5731b459d1 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundBinaryOp.csproj @@ -1,6 +1,7 @@ - Exe + + true true diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.cs b/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.cs index 088b9ed900af3..84b947dd99255 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.cs +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.cs @@ -3,12 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class Program +public class Program { private static int returnCode = 100; - public static int Main() + [Fact] + public static int TestEntryPoint() { RunTestThrows(Tests.MulOutsideRange); RunTestThrows(Tests.MulOverflow); diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.csproj b/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.csproj index e5ad660f3d500..cb71454a803a8 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundElim.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.cs b/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.cs index 73d3d0f0cb1ba..744dedf319f54 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.cs +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.cs @@ -3,14 +3,16 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class Program +public class Program { private static int returnCode = 100; private static int[] arr = new int[6]; - public static int Main() + [Fact] + public static int TestEntryPoint() { RunTestThrows(Tests.GreaterOutOfBound); RunTestThrows(Tests.GreaterEqualOutOfBound); diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.csproj b/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundMinLength.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.cs b/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.cs index 06417ed3474b3..a6126b6de44b4 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.cs +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.cs @@ -5,8 +5,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class ArrBoundUnsigned +public class ArrBoundUnsigned { // The method names indicate when the array access takes place e.g i_LT_UN_len executes a[i] if (uint)i < (uint)a.len. // If the condition is true and the array index is invalid then an IndexOutOfRangeException is expected. @@ -300,7 +301,8 @@ static int i_GE_UN_len_next_edge(int[] a, int i, int lenTest) return a[i]; } - static int Main() + [Fact] + public static int TestEntryPoint() { const int Pass = 100; const int Fail = -1; diff --git a/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.csproj b/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.csproj index bac43c81f412a..dd42de3b8653c 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/ArrBoundUnsigned.csproj @@ -1,7 +1,4 @@ - - Exe - None diff --git a/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il b/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il index a11b01b257bfb..f2f6ec69384c6 100644 --- a/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il +++ b/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il @@ -37,7 +37,7 @@ // =============== CLASS MEMBERS DECLARATION =================== -.class private auto ansi beforefieldinit Sample1 +.class public auto ansi beforefieldinit Sample1 extends [mscorlib]System.Object { .method private hidebysig static int32 @@ -63,7 +63,7 @@ IL_0018: ret } // end of method Sample1::OverflowTest - .method private hidebysig static int32 + .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( diff --git a/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.ilproj b/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.ilproj index 9d5b47467d27f..b914fc2dc6708 100644 --- a/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.ilproj +++ b/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/ConstantProp.cs b/src/tests/JIT/opt/AssertionPropagation/ConstantProp.cs index 2b7f7a3411da4..556dc11ec725f 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ConstantProp.cs +++ b/src/tests/JIT/opt/AssertionPropagation/ConstantProp.cs @@ -4,8 +4,9 @@ //Simple dev unit test for constant propagation assertion. using System; +using Xunit; -internal class Sample1 +public class Sample1 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static int func(int a) @@ -18,7 +19,8 @@ private static int func(int a) else return y; } - private static int Main() + [Fact] + public static int TestEntryPoint() { bool failed = false; if (func(0) != 5) diff --git a/src/tests/JIT/opt/AssertionPropagation/ConstantProp.csproj b/src/tests/JIT/opt/AssertionPropagation/ConstantProp.csproj index 300e42f4729c3..2d6c0da6ebdac 100644 --- a/src/tests/JIT/opt/AssertionPropagation/ConstantProp.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/ConstantProp.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/CopyProp.cs b/src/tests/JIT/opt/AssertionPropagation/CopyProp.cs index dc947245012f9..b99ae4ff81816 100644 --- a/src/tests/JIT/opt/AssertionPropagation/CopyProp.cs +++ b/src/tests/JIT/opt/AssertionPropagation/CopyProp.cs @@ -4,8 +4,9 @@ //Unit test for copy propagation assertion. using System; +using Xunit; -internal class Sample2 +public class Sample2 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static sbyte func(int a, int b) @@ -21,7 +22,8 @@ private static sbyte func(int a, int b) return (sbyte)res; } - private static int Main() + [Fact] + public static int TestEntryPoint() { bool failed = false; if (func(1, 2) != -1) diff --git a/src/tests/JIT/opt/AssertionPropagation/CopyProp.csproj b/src/tests/JIT/opt/AssertionPropagation/CopyProp.csproj index 9fa9b23450f01..b44877cd1cd2c 100644 --- a/src/tests/JIT/opt/AssertionPropagation/CopyProp.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/CopyProp.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.cs b/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.cs index f13bbc2010397..e76b3ee7d85aa 100644 --- a/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.cs +++ b/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.cs @@ -7,10 +7,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class DynBlkNullAssertions { - public static int Main() + [Fact] + public static int TestEntryPoint() { if (!TestCpBlk(ref Unsafe.NullRef(), ref Unsafe.NullRef(), 0)) { diff --git a/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.csproj b/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.csproj index 5d8fe22529764..377bf381b5286 100644 --- a/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/DynBlkNullAssertions.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.cs b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.cs index 6dbf23faf44db..29516fe0e8333 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.cs +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.cs @@ -4,8 +4,9 @@ //Unit test for null check assertion. using System; +using Xunit; -internal class Sample3 +public class Sample3 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static void func(object o) @@ -15,7 +16,8 @@ private static void func(object o) o.GetType(); } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.csproj b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.csproj index 4fdc3210608bc..1d9ab7517b7ed 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion1.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.cs b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.cs index 87393fbd02ac7..5216de0e5bffa 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.cs +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.cs @@ -2,8 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; -internal class Sample4 +public class Sample4 { private static int s_s = 1; @@ -19,7 +20,8 @@ private static void func(object o1, object o2) } } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.csproj b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.csproj index 3064fc126a30e..6337206d18c3a 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion2.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.cs b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.cs index 25afedb2166e4..ff7359c2b186b 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.cs +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.cs @@ -4,6 +4,7 @@ //Unit test for Null check assertion propagation. using System; +using Xunit; internal class Point { @@ -16,7 +17,7 @@ internal class Point public int Distance() { return x * x + y * y; } } -internal class Sample5 +public class Sample5 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static int func(Point p1, Point p2, Point p3) @@ -36,7 +37,8 @@ private static int func(Point p1, Point p2, Point p3) return h; } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.csproj b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.csproj index 62012a33740b6..d6ae7bbd9a004 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion3.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.cs b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.cs index cde5131d20706..51699cb09ed88 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.cs +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.cs @@ -4,8 +4,9 @@ //unit test for null check assertion propagation. using System; +using Xunit; -internal class Sample6 +public class Sample6 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static int func(int[] a1) @@ -22,7 +23,8 @@ private static int func(int[] a1) return h; } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.csproj b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.csproj index 7225cdb7e61d0..cbf7b51e8778a 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion4.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.cs b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.cs index 29c74f1add3fc..97d9bd689ec4e 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.cs +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.cs @@ -4,8 +4,9 @@ //Unit test for null check assertion. using System; +using Xunit; -internal class Sample7 +public class Sample7 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static int func(int[] a1) @@ -22,7 +23,8 @@ private static int func(int[] a1) return h; } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.csproj b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.csproj index 5a28c3111f2d6..47fa32f2af1b1 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion5.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.cs b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.cs index 353bc8a8bb7bc..33c5605df9db4 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.cs +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.cs @@ -4,8 +4,9 @@ //Unit test for null check assertion. using System; +using Xunit; -internal class Sample8 +public class Sample8 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static int func(int[,] a1) @@ -22,7 +23,8 @@ private static int func(int[,] a1) return h; } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.csproj b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.csproj index b84eb65b020f1..0358b654a0b96 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion6.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.cs b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.cs index 3f482dc6118d7..a577b5e429c88 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.cs +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.cs @@ -4,8 +4,9 @@ //Unit test for null check assertion. using System; +using Xunit; -internal class Sample7 +public class Sample7 { [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] private static int func(int[,] a1) @@ -22,7 +23,8 @@ private static int func(int[,] a1) return h; } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.csproj b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.csproj index 4b17e37ba9c0a..6910bedf7adcd 100644 --- a/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/NullCheckAssertion7.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.cs b/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.cs index 527a61eaf1598..c7becb88996fb 100644 --- a/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.cs +++ b/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.cs @@ -4,8 +4,9 @@ //Unit test for typeof assertion. using System; +using Xunit; -internal class Sample10 +public class Sample10 { private static int s_s = 1; @@ -25,7 +26,8 @@ private static int func(object o) return 0; } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.csproj b/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.csproj index c1092420f2ac0..601f6fc5e61f2 100644 --- a/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/TypeOfAssertion.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.cs b/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.cs index 150a62cffa380..b64b86a38351d 100644 --- a/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.cs +++ b/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Xunit; internal struct Position @@ -12,9 +13,10 @@ internal struct Position } -internal class Program +public class Program { - private static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine("Main called"); diff --git a/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.csproj b/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.csproj index 242109d8b763f..c57fb3438e3a6 100644 --- a/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.csproj +++ b/src/tests/JIT/opt/AssertionPropagation/regression/dev10/bug573840/bug573840.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.cs b/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.cs index cb3913e9b494e..4b626df7a0bc5 100644 --- a/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.cs +++ b/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.cs @@ -3,14 +3,16 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CSEWithDoubleNegation { - class DoNotMorphAwayCSEThatRepresentsDoubleNegation + public class DoNotMorphAwayCSEThatRepresentsDoubleNegation { private static int _static = 0; - static int Main() + [Fact] + public static int TestEntryPoint() { if (DoubleNeg() != 22) { diff --git a/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.csproj b/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.csproj index 075001135d548..d04f2570901aa 100644 --- a/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.csproj +++ b/src/tests/JIT/opt/CSE/CSEWithDoubleNegation.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/CSE/GitHub_16065a.cs b/src/tests/JIT/opt/CSE/GitHub_16065a.cs index 440bcf0e6e94a..a755fab6f6282 100644 --- a/src/tests/JIT/opt/CSE/GitHub_16065a.cs +++ b/src/tests/JIT/opt/CSE/GitHub_16065a.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace GitHub_16065a { @@ -70,9 +71,10 @@ public Vector GetDiagonal(int index) } } - class Program + public class Program { - static int Main() + [Fact] + public static int TestEntryPoint() { int result = 0; var A = new Matrix(new Array2D(0, 4)); diff --git a/src/tests/JIT/opt/CSE/GitHub_16065a.csproj b/src/tests/JIT/opt/CSE/GitHub_16065a.csproj index 7e17ca512d217..0797f8f58a0c2 100644 --- a/src/tests/JIT/opt/CSE/GitHub_16065a.csproj +++ b/src/tests/JIT/opt/CSE/GitHub_16065a.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/CSE/GitHub_16065b.cs b/src/tests/JIT/opt/CSE/GitHub_16065b.cs index f298d647cfc39..1ea8f90293d89 100644 --- a/src/tests/JIT/opt/CSE/GitHub_16065b.cs +++ b/src/tests/JIT/opt/CSE/GitHub_16065b.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace GitHub_16065b { @@ -72,9 +73,10 @@ public Vector GetDiagonal(int index) } } - class Program + public class Program { - static int Main() + [Fact] + public static int TestEntryPoint() { int result = 0; var A = new Matrix(new Array2D(0, 4)); diff --git a/src/tests/JIT/opt/CSE/GitHub_16065b.csproj b/src/tests/JIT/opt/CSE/GitHub_16065b.csproj index 2da3f625911c7..cf631b512e22f 100644 --- a/src/tests/JIT/opt/CSE/GitHub_16065b.csproj +++ b/src/tests/JIT/opt/CSE/GitHub_16065b.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/CSE/NarrowStore.cs b/src/tests/JIT/opt/CSE/NarrowStore.cs index 06b93366a4d13..5d15970e4c780 100644 --- a/src/tests/JIT/opt/CSE/NarrowStore.cs +++ b/src/tests/JIT/opt/CSE/NarrowStore.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace NarrowStore { - class Program + public class Program { byte x01; byte t01; @@ -26,7 +27,8 @@ int Test() } } - static int Main() + [Fact] + public static int TestEntryPoint() { Program prog = new Program(); diff --git a/src/tests/JIT/opt/CSE/NarrowStore.csproj b/src/tests/JIT/opt/CSE/NarrowStore.csproj index ea7263b9efd66..32ea9dd914e21 100644 --- a/src/tests/JIT/opt/CSE/NarrowStore.csproj +++ b/src/tests/JIT/opt/CSE/NarrowStore.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Casts/IntCast.cs b/src/tests/JIT/opt/Casts/IntCast.cs index 1b360f0aa44d6..9638036560eb9 100644 --- a/src/tests/JIT/opt/Casts/IntCast.cs +++ b/src/tests/JIT/opt/Casts/IntCast.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - class IntCast + public class IntCast { [MethodImpl(MethodImplOptions.NoInlining)] static long Cast_Short_To_Long(short value) @@ -26,7 +27,8 @@ static long Cast_Short_To_Long_Add(short value1, short value2) return (long)value1 + (long)value2; } - static int Main() + [Fact] + public static int TestEntryPoint() { if (Cast_Short_To_Long(Int16.MaxValue) != 32767) return 0; diff --git a/src/tests/JIT/opt/Casts/IntCast.csproj b/src/tests/JIT/opt/Casts/IntCast.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Casts/IntCast.csproj +++ b/src/tests/JIT/opt/Casts/IntCast.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/Casts/shared.cs b/src/tests/JIT/opt/Casts/shared.cs index 3e60d1e6af2ea..f4be93ff7d6ea 100644 --- a/src/tests/JIT/opt/Casts/shared.cs +++ b/src/tests/JIT/opt/Casts/shared.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; interface I { @@ -14,7 +15,7 @@ sealed class J : I public int E(T t) { return 3; } } -class Z +public class Z { [MethodImpl(MethodImplOptions.NoInlining)] static bool F0(I i) @@ -28,7 +29,8 @@ static bool F1(J j) return j is I; } - public static int Main() + [Fact] + public static int TestEntryPoint() { var j0 = new J(); var j1 = new J(); diff --git a/src/tests/JIT/opt/Casts/shared2.cs b/src/tests/JIT/opt/Casts/shared2.cs index 9613bf9d5ea2e..21d247bf169ea 100644 --- a/src/tests/JIT/opt/Casts/shared2.cs +++ b/src/tests/JIT/opt/Casts/shared2.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; interface IBar {} interface IFoo {} @@ -13,7 +14,7 @@ struct SBar : IBar {} // More tests for shared types passing through compareTypesForCast -class X +public class X { static int _errors; @@ -71,7 +72,8 @@ static bool C2(T t) return (t as IBar) != null; } - public static int Main() + [Fact] + public static int TestEntryPoint() { var c = new C(); var ci = new C(); diff --git a/src/tests/JIT/opt/Casts/shared2.csproj b/src/tests/JIT/opt/Casts/shared2.csproj index 97176f997545d..d913ed5838068 100644 --- a/src/tests/JIT/opt/Casts/shared2.csproj +++ b/src/tests/JIT/opt/Casts/shared2.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Casts/shared.csproj b/src/tests/JIT/opt/Casts/shared_Casts.csproj similarity index 75% rename from src/tests/JIT/opt/Casts/shared.csproj rename to src/tests/JIT/opt/Casts/shared_Casts.csproj index 9bba1eea14b48..7f702b5a776c3 100644 --- a/src/tests/JIT/opt/Casts/shared.csproj +++ b/src/tests/JIT/opt/Casts/shared_Casts.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Casts/tests.cs b/src/tests/JIT/opt/Casts/tests.cs index 8786b240d176b..8ea466eba4419 100644 --- a/src/tests/JIT/opt/Casts/tests.cs +++ b/src/tests/JIT/opt/Casts/tests.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; interface I { @@ -33,7 +34,7 @@ public int E(object o) } } -class F +public class F { [MethodImpl(MethodImplOptions.NoInlining)] static bool IsIString(I i) @@ -140,7 +141,8 @@ static bool IsIL(I i) return i is K; } - public static int Main() + [Fact] + public static int TestEntryPoint() { var j = new J(); var k = new K(); diff --git a/src/tests/JIT/opt/Casts/tests.csproj b/src/tests/JIT/opt/Casts/tests.csproj index 5bffb877b3d47..aa080d48ddead 100644 --- a/src/tests/JIT/opt/Casts/tests.csproj +++ b/src/tests/JIT/opt/Casts/tests.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_1.cs b/src/tests/JIT/opt/Cloning/Runtime_61040_1.cs index a2a298d737f03..775a4d1b93561 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_1.cs +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_1.cs @@ -3,13 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; struct ArrayWrapper { public int[] Array; } -class Runtime_61040_1 +public class Runtime_61040_1 { [MethodImpl(MethodImplOptions.NoInlining)] static void JitUse(T arg) { } @@ -35,7 +36,8 @@ static void Problem(ArrayWrapper a) [MethodImpl(MethodImplOptions.NoInlining)] static ArrayWrapper GetArrayLong() => new() { Array = new int[10000] }; - public static int Main() + [Fact] + public static int TestEntryPoint() { int result = -1; try diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_1.csproj b/src/tests/JIT/opt/Cloning/Runtime_61040_1.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_1.csproj +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_1.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_2.cs b/src/tests/JIT/opt/Cloning/Runtime_61040_2.cs index 19c70b474f13a..a562c25f24fb8 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_2.cs +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_2.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; [StructLayout(LayoutKind.Explicit)] struct StructWithHoles @@ -16,7 +17,7 @@ struct StructWithHoles public int C; } -class Runtime_61040_2 +public class Runtime_61040_2 { static int z = 0; @@ -45,5 +46,6 @@ static int Problem(StructWithHoles a, StructWithHoles b, int[] d) return -1; } - public static int Main() => Problem(new() { Index = 0 }, new() { Index = 100_000_000 }, new int[10]); + [Fact] + public static int TestEntryPoint() => Problem(new() { Index = 0 }, new() { Index = 100_000_000 }, new int[10]); } diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_2.csproj b/src/tests/JIT/opt/Cloning/Runtime_61040_2.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_2.csproj +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_2.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_3.cs b/src/tests/JIT/opt/Cloning/Runtime_61040_3.cs index 2fd71fff30730..90d9c0b6f13fe 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_3.cs +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_3.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; struct StructWithIndex { @@ -10,7 +11,7 @@ struct StructWithIndex public int Value; } -class Runtime_61040_3 +public class Runtime_61040_3 { static int z = 100; @@ -41,5 +42,6 @@ static int Problem(StructWithIndex a, int[] d) [MethodImpl(MethodImplOptions.NoInlining)] static StructWithIndex GetStructWithIndex() => new() { Index = 100_000_000 }; - public static int Main() => Problem(new() { Index = 0, Value = 33 }, new int[10]); + [Fact] + public static int TestEntryPoint() => Problem(new() { Index = 0, Value = 33 }, new int[10]); } diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_3.csproj b/src/tests/JIT/opt/Cloning/Runtime_61040_3.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_3.csproj +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_3.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_4.cs b/src/tests/JIT/opt/Cloning/Runtime_61040_4.cs index 85b41f33273dc..1ee6d851ef605 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_4.cs +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_4.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class Runtime_61040_4 +public class Runtime_61040_4 { [MethodImpl(MethodImplOptions.NoInlining)] static void JitUse(T arg) { } @@ -44,6 +45,7 @@ static int Problem() [MethodImpl(MethodImplOptions.NoInlining)] static int[] GetArrayLong() => new int[10000]; - public static int Main() => Problem(); + [Fact] + public static int TestEntryPoint() => Problem(); } diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_4.csproj b/src/tests/JIT/opt/Cloning/Runtime_61040_4.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_4.csproj +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_4.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_5.cs b/src/tests/JIT/opt/Cloning/Runtime_61040_5.cs index 6c94d8371392b..f55ef4aa92aa7 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_5.cs +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_5.cs @@ -3,12 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -unsafe class Runtime_61040_5 +public unsafe class Runtime_61040_5 { private const int ArrLen = 10; - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] arr = new int[ArrLen]; diff --git a/src/tests/JIT/opt/Cloning/Runtime_61040_5.csproj b/src/tests/JIT/opt/Cloning/Runtime_61040_5.csproj index 8c7132fd350c9..a4cc9d0594f93 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_61040_5.csproj +++ b/src/tests/JIT/opt/Cloning/Runtime_61040_5.csproj @@ -1,6 +1,5 @@ - Exe True True diff --git a/src/tests/JIT/opt/Cloning/Runtime_70802.cs b/src/tests/JIT/opt/Cloning/Runtime_70802.cs index d10c799d25718..da847a79dbe13 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_70802.cs +++ b/src/tests/JIT/opt/Cloning/Runtime_70802.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; public class B { @@ -15,7 +16,7 @@ public class D : B public override int V() => 44; } -class Runtime_70802 +public class Runtime_70802 { [MethodImpl(MethodImplOptions.NoInlining)] static void G() {} @@ -38,7 +39,8 @@ static int F(B b, int n = 10, int m = 10) return r; } - public static int Main() + [Fact] + public static int TestEntryPoint() { D d = new D(); diff --git a/src/tests/JIT/opt/Cloning/Runtime_70802.csproj b/src/tests/JIT/opt/Cloning/Runtime_70802.csproj index 731b0c97a96ef..2b516780a5332 100644 --- a/src/tests/JIT/opt/Cloning/Runtime_70802.csproj +++ b/src/tests/JIT/opt/Cloning/Runtime_70802.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/Cloning/callandindir.cs b/src/tests/JIT/opt/Cloning/callandindir.cs index 065c893e11530..1dfd773f5a76e 100644 --- a/src/tests/JIT/opt/Cloning/callandindir.cs +++ b/src/tests/JIT/opt/Cloning/callandindir.cs @@ -3,16 +3,17 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Loops in F, G, H should all clone -class CallAndIndir +public class CallAndIndir { [MethodImpl(MethodImplOptions.NoInlining)] - public static void S() { } + internal static void S() { } [MethodImpl(MethodImplOptions.NoInlining)] - public static void F(int[] a, int low, int high, ref int z) + internal static void F(int[] a, int low, int high, ref int z) { for (int i = low; i < high; i++) { @@ -22,7 +23,7 @@ public static void F(int[] a, int low, int high, ref int z) } [MethodImpl(MethodImplOptions.NoInlining)] - public static void G(int[] a, int low, int high, ref int z) + internal static void G(int[] a, int low, int high, ref int z) { for (int i = low; i < high; i++) { @@ -31,7 +32,7 @@ public static void G(int[] a, int low, int high, ref int z) } [MethodImpl(MethodImplOptions.NoInlining)] - public static void H(int[] a, int low, int high, ref int z) + internal static void H(int[] a, int low, int high, ref int z) { int r = 0; for (int i = low; i < high; i++) @@ -42,7 +43,8 @@ public static void H(int[] a, int low, int high, ref int z) z += r; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] a = new int[] { 1, 2, 3, 4 }; int z = 0; diff --git a/src/tests/JIT/opt/Cloning/callandindir.csproj b/src/tests/JIT/opt/Cloning/callandindir.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/Cloning/callandindir.csproj +++ b/src/tests/JIT/opt/Cloning/callandindir.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Compares/compareAnd2Chains.cs b/src/tests/JIT/opt/Compares/compareAnd2Chains.cs index ff6eebda58979..b2de5aab1c0a3 100644 --- a/src/tests/JIT/opt/Compares/compareAnd2Chains.cs +++ b/src/tests/JIT/opt/Compares/compareAnd2Chains.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class ComparisonTestAnd2Chains { @@ -179,11 +180,13 @@ public class ComparisonTestAnd2Chains [MethodImpl(MethodImplOptions.NoInlining)] - public static void consume(T a1, T a2) {} + internal static void consume(T a1, T a2) {} // If conditions that are consumed. [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Lt_byte_2_consume(byte a1, byte a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #10 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #11, nc, {{ge|lt}} @@ -193,6 +196,8 @@ public static void Lt_byte_2_consume(byte a1, byte a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(12, 13)] public static void Le_short_2_consume(short a1, short a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #10 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #12, 0, {{gt|le}} @@ -202,6 +207,8 @@ public static void Le_short_2_consume(short a1, short a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(14, 15)] public static void Gt_int_2_consume(int a1, int a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #10 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #13, 0, {{le|gt}} @@ -211,6 +218,8 @@ public static void Gt_int_2_consume(int a1, int a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(16, 17)] public static void Ge_long_2_consume(long a1, long a2) { //ARM64-FULL-LINE: cmp {{x[0-9]+}}, #10 //ARM64-FULL-LINE-NEXT: ccmp {{x[0-9]+}}, #14, nc, {{lt|ge}} @@ -220,6 +229,8 @@ public static void Ge_long_2_consume(long a1, long a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(18, 19)] public static void Eq_ushort_2_consume(ushort a1, ushort a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #10 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #15, z, {{ne|eq}} @@ -229,6 +240,8 @@ public static void Eq_ushort_2_consume(ushort a1, ushort a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(20, 21)] public static void Ne_uint_2_consume(uint a1, uint a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #10 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #16, z, {{eq|ne}} @@ -240,6 +253,9 @@ public static void Ne_uint_2_consume(uint a1, uint a2) { /* If/Else conditions that consume. */ [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] + [InlineData(12, 13)] public static void Le_else_byte_2_consume(byte a1, byte a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #11 @@ -250,6 +266,8 @@ public static void Le_else_byte_2_consume(byte a1, byte a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(14, 15)] public static void Gt_else_short_2_consume(short a1, short a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #11 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #23, nzc, {{le|gt}} @@ -259,6 +277,8 @@ public static void Gt_else_short_2_consume(short a1, short a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(16, 17)] public static void Ge_else_int_2_consume(int a1, int a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #11 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #24, z, {{lt|ge}} @@ -268,6 +288,8 @@ public static void Ge_else_int_2_consume(int a1, int a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(18, 19)] public static void Eq_else_long_2_consume(long a1, long a2) { //ARM64-FULL-LINE: cmp {{x[0-9]+}}, #11 //ARM64-FULL-LINE-NEXT: ccmp {{x[0-9]+}}, #25, 0, {{ne|eq}} @@ -277,6 +299,8 @@ public static void Eq_else_long_2_consume(long a1, long a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(20, 21)] public static void Ne_else_ushort_2_consume(ushort a1, ushort a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #11 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #26, 0, {{eq|ne}} @@ -286,6 +310,8 @@ public static void Ne_else_ushort_2_consume(ushort a1, ushort a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(22, 23)] public static void Lt_else_uint_2_consume(uint a1, uint a2) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #11 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #27, c, {{hs|lo}} @@ -295,7 +321,8 @@ public static void Lt_else_uint_2_consume(uint a1, uint a2) { } [MethodImpl(MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { if (!Eq_byte_2(10, 11)) { @@ -573,21 +600,6 @@ public static int Main() return 101; } - Lt_byte_2_consume(10, 11); - Le_short_2_consume(12, 13); - Gt_int_2_consume(14, 15); - Ge_long_2_consume(16, 17); - Eq_ushort_2_consume(18, 19); - Ne_uint_2_consume(20, 21); - - Le_else_byte_2_consume(10, 11); - Le_else_byte_2_consume(12, 13); - Gt_else_short_2_consume(14, 15); - Ge_else_int_2_consume(16, 17); - Eq_else_long_2_consume(18, 19); - Ne_else_ushort_2_consume(20, 21); - Lt_else_uint_2_consume(22, 23); - Console.WriteLine("PASSED"); return 100; } diff --git a/src/tests/JIT/opt/Compares/compareAnd2Chains.csproj b/src/tests/JIT/opt/Compares/compareAnd2Chains.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Compares/compareAnd2Chains.csproj +++ b/src/tests/JIT/opt/Compares/compareAnd2Chains.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/Compares/compareAnd3Chains.cs b/src/tests/JIT/opt/Compares/compareAnd3Chains.cs index 64c81941821f0..fe1ad0a094d11 100644 --- a/src/tests/JIT/opt/Compares/compareAnd3Chains.cs +++ b/src/tests/JIT/opt/Compares/compareAnd3Chains.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class ComparisonTestAnd3Chains { @@ -179,11 +180,13 @@ public class ComparisonTestAnd3Chains [MethodImpl(MethodImplOptions.NoInlining)] - public static void consume(T a1, T a2, T a3) {} + internal static void consume(T a1, T a2, T a3) {} // If conditions that are consumed. [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(101, 102, 103)] public static void Le_byte_3_consume(byte a1, byte a2, byte a3) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #10 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #11, nzc, {{gt|le}} @@ -194,6 +197,8 @@ public static void Le_byte_3_consume(byte a1, byte a2, byte a3) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(104, 105, 106)] public static void Gt_short_3_consume(short a1, short a2, short a3) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #13 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #14, 0, {{gt|le}} @@ -204,6 +209,8 @@ public static void Gt_short_3_consume(short a1, short a2, short a3) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(107, 108, 109)] public static void Ge_int_3_consume(int a1, int a2, int a3) { //ARM64-FULL-LINE: cmp {{w[0-9]+}}, #16 //ARM64-FULL-LINE-NEXT: ccmp {{w[0-9]+}}, #17, 0, {{gt|le}} @@ -214,6 +221,8 @@ public static void Ge_int_3_consume(int a1, int a2, int a3) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(110, 111, 112)] public static void Eq_else_long_3_consume(long a1, long a2, long a3) { //ARM64-FULL-LINE: cmp {{x[0-9]+}}, #20 //ARM64-FULL-LINE-NEXT: ccmp {{x[0-9]+}}, #21, 0, {{eq|ne}} @@ -224,7 +233,8 @@ public static void Eq_else_long_3_consume(long a1, long a2, long a3) { } [MethodImpl(MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { if (!Eq_byte_3(10, 11, 12)) { @@ -502,11 +512,6 @@ public static int Main() return 101; } - Le_byte_3_consume(101, 102, 103); - Gt_short_3_consume(104, 105, 106); - Ge_int_3_consume(107, 108, 109); - Eq_else_long_3_consume(110, 111, 112); - Console.WriteLine("PASSED"); return 100; } diff --git a/src/tests/JIT/opt/Compares/compareAnd3Chains.csproj b/src/tests/JIT/opt/Compares/compareAnd3Chains.csproj index 6e57bab578a71..b4e772eda2d22 100644 --- a/src/tests/JIT/opt/Compares/compareAnd3Chains.csproj +++ b/src/tests/JIT/opt/Compares/compareAnd3Chains.csproj @@ -1,6 +1,7 @@ - Exe + + true None True True diff --git a/src/tests/JIT/opt/Compares/compareAndTestChains.cs b/src/tests/JIT/opt/Compares/compareAndTestChains.cs index 575a9372509d3..70c8ea157a54c 100644 --- a/src/tests/JIT/opt/Compares/compareAndTestChains.cs +++ b/src/tests/JIT/opt/Compares/compareAndTestChains.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class ComparisonTestAndTestChains { @@ -179,7 +180,8 @@ public class ComparisonTestAndTestChains [MethodImpl(MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { if (!Eq_byte_bool(10, false)) { diff --git a/src/tests/JIT/opt/Compares/compareAndTestChains.csproj b/src/tests/JIT/opt/Compares/compareAndTestChains.csproj index 5e5fbae5cb863..b47c3e8e8d9f5 100644 --- a/src/tests/JIT/opt/Compares/compareAndTestChains.csproj +++ b/src/tests/JIT/opt/Compares/compareAndTestChains.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Compares/compares.cs b/src/tests/JIT/opt/Compares/compares.cs index 8c29ba5df789f..7400f2404ffa1 100644 --- a/src/tests/JIT/opt/Compares/compares.cs +++ b/src/tests/JIT/opt/Compares/compares.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class FullRangeComparisonTest { @@ -75,11 +76,13 @@ public class SideEffects [MethodImpl(MethodImplOptions.NoInlining)] - public static void consume(T a1, T a2) {} + internal static void consume(T a1, T a2) {} /* If conditions that are consumed. */ [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Eq_byte_consume(byte a1, byte a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} // ARM64-FULL-LINE-NEXT: csel {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, {{eq|ne}} @@ -91,6 +94,8 @@ public static void Eq_byte_consume(byte a1, byte a2) { } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Ne_short_consume(short a1, short a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -103,6 +108,8 @@ public static void Ne_short_consume(short a1, short a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Lt_int_consume(int a1, int a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -115,6 +122,8 @@ public static void Lt_int_consume(int a1, int a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Le_long_consume(long a1, long a2) { // ARM64-FULL-LINE: cmp {{x[0-9]+}}, {{x[0-9]+}} @@ -127,6 +136,8 @@ public static void Le_long_consume(long a1, long a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Gt_ushort_consume(ushort a1, ushort a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -139,6 +150,8 @@ public static void Gt_ushort_consume(ushort a1, ushort a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Ge_uint_consume(uint a1, uint a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -151,6 +164,8 @@ public static void Ge_uint_consume(uint a1, uint a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Eq_ulong_consume(ulong a1, ulong a2) { // ARM64-FULL-LINE: cmp {{x[0-9]+}}, {{x[0-9]+}} @@ -163,6 +178,8 @@ public static void Eq_ulong_consume(ulong a1, ulong a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10.1F, 11.1F, 12, 13)] public static void Ne_float_int_consume(float f1, float f2, int a1, int a2) { // ARM64-FULL-LINE: fcmp {{s[0-9]+}}, {{s[0-9]+}} @@ -176,6 +193,8 @@ public static void Ne_float_int_consume(float f1, float f2, int a1, int a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10.1, 11.1, 12, 13)] public static void Lt_double_long_consume(double f1, double f2, long a1, long a2) { // ARM64-FULL-LINE: fcmp {{d[0-9]+}}, {{d[0-9]+}} @@ -188,6 +207,8 @@ public static void Lt_double_long_consume(double f1, double f2, long a1, long a2 } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10.1, 11.1, 12, 13)] public static void Eq_double_long_consume(double f1, double f2, long a1, long a2) { // ARM64-FULL-LINE: fcmp {{d[0-9]+}}, {{d[0-9]+}} @@ -201,6 +222,8 @@ public static void Eq_double_long_consume(double f1, double f2, long a1, long a2 } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10.1, 11.1, 12, 13)] public static void Ne_double_int_consume(double f1, double f2, int a1, int a2) { // ARM64-FULL-LINE: fcmp {{d[0-9]+}}, {{d[0-9]+}} @@ -216,6 +239,8 @@ public static void Ne_double_int_consume(double f1, double f2, int a1, int a2) /* If/Else conditions that consume. */ [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(20, 21)] public static void Ne_else_byte_consume(byte a1, byte a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -228,6 +253,8 @@ public static void Ne_else_byte_consume(byte a1, byte a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Lt_else_short_consume(short a1, short a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -240,6 +267,8 @@ public static void Lt_else_short_consume(short a1, short a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Le_else_int_consume(int a1, int a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -252,6 +281,8 @@ public static void Le_else_int_consume(int a1, int a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Gt_else_long_consume(long a1, long a2) { // ARM64-FULL-LINE: cmp {{x[0-9]+}}, {{x[0-9]+}} @@ -264,6 +295,8 @@ public static void Gt_else_long_consume(long a1, long a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Ge_else_ushort_consume(ushort a1, ushort a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -276,6 +309,8 @@ public static void Ge_else_ushort_consume(ushort a1, ushort a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Eq_else_uint_consume(uint a1, uint a2) { // ARM64-FULL-LINE: cmp {{w[0-9]+}}, {{w[0-9]+}} @@ -288,6 +323,8 @@ public static void Eq_else_uint_consume(uint a1, uint a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10, 11)] public static void Ne_else_ulong_consume(ulong a1, ulong a2) { // ARM64-FULL-LINE: cmp {{x[0-9]+}}, {{x[0-9]+}} @@ -300,6 +337,8 @@ public static void Ne_else_ulong_consume(ulong a1, ulong a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10.1F, 11.1F, 12, 13)] public static void Lt_else_float_int_consume(float f1, float f2, int a1, int a2) { // ARM64-FULL-LINE: fcmp {{s[0-9]+}}, {{s[0-9]+}} @@ -312,6 +351,8 @@ public static void Lt_else_float_int_consume(float f1, float f2, int a1, int a2) } [MethodImpl(MethodImplOptions.NoInlining)] + [Theory] + [InlineData(10.1, 11.1, 12, 13)] public static void Le_else_double_int_consume(double f1, double f2, int a1, int a2) { // ARM64-FULL-LINE: fcmp {{d[0-9]+}}, {{d[0-9]+}} @@ -425,7 +466,8 @@ public static int Gt_else_double_int_return(double a1, double a2) } - public static int Main() + [Fact] + public static int TestEntryPoint() { // Optimize comparison with full range values // RHS Const Optimization @@ -551,28 +593,6 @@ public static int Main() return 101; } - Eq_byte_consume(10, 11); - Ne_short_consume(10, 11); - Lt_int_consume(10, 11); - Le_long_consume(10, 11); - Gt_ushort_consume(10, 11); - Ge_uint_consume(10, 11); - Eq_ulong_consume(10, 11); - Ne_float_int_consume(10.1F, 11.1F, 12, 13); - Lt_double_long_consume(10.1, 11.1, 12, 13); - Eq_double_long_consume(10.1, 11.1, 12, 13); - Ne_double_int_consume(10.1, 11.1, 12, 13); - - Ne_else_byte_consume(20, 21); - Lt_else_short_consume(10, 11); - Le_else_int_consume(10, 11); - Gt_else_long_consume(10, 11); - Ge_else_ushort_consume(10, 11); - Eq_else_uint_consume(10, 11); - Ne_else_ulong_consume(10, 11); - Lt_else_float_int_consume(10.1F, 11.1F, 12, 13); - Le_else_double_int_consume(10.1, 11.1, 12, 13); - if (Lt_else_byte_return(10,11) != 10) { Console.WriteLine("FullRangeComparisonTest:Lt_else_byte_return() failed"); diff --git a/src/tests/JIT/opt/Compares/compares.csproj b/src/tests/JIT/opt/Compares/compares.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Compares/compares.csproj +++ b/src/tests/JIT/opt/Compares/compares.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/Compares/conditionalIncrements.cs b/src/tests/JIT/opt/Compares/conditionalIncrements.cs index 4462bf744fbcd..2580fa3d5ca5c 100644 --- a/src/tests/JIT/opt/Compares/conditionalIncrements.cs +++ b/src/tests/JIT/opt/Compares/conditionalIncrements.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class ConditionalIncrementTest { @@ -84,7 +85,8 @@ static int cinc_float(float op1) } - public static int Main() + [Fact] + public static int TestEntryPoint() { if (cinc_byte(72) != 6) { diff --git a/src/tests/JIT/opt/Compares/conditionalIncrements.csproj b/src/tests/JIT/opt/Compares/conditionalIncrements.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Compares/conditionalIncrements.csproj +++ b/src/tests/JIT/opt/Compares/conditionalIncrements.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.cs b/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.cs index 0eba1a3cf7aff..77e19baab520e 100644 --- a/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.cs +++ b/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public struct Struct1 { @@ -40,6 +41,7 @@ private static void ValidateAndAssignValue(ref Struct1 val) val.b = 43; } + [Fact] public static void TestRefs() { object obj = null; @@ -52,6 +54,7 @@ public static void TestRefs() while (i++ < 2); } + [Fact] public static void TestInt() { int val = 0; @@ -64,6 +67,7 @@ public static void TestInt() while (i++ < 2); } + [Fact] public static void TestStruct() { Struct1 val = default; @@ -77,6 +81,7 @@ public static void TestStruct() while (i++ < 2); } + [Fact] public static unsafe void TestTakeAddress() { int a = 0; @@ -87,7 +92,10 @@ public static unsafe void TestTakeAddress() throw new Exception("a was expected to be zero"); } - public static unsafe void TestTakeAddress(bool cond) + [Theory] + [InlineData(true)] + [InlineData(false)] + public static unsafe void TestTakeAddressCond(bool cond) { int a = 0; if (cond) @@ -100,6 +108,7 @@ public static unsafe void TestTakeAddress(bool cond) throw new Exception("a was expected to be zero"); } + [Fact] public static void ReproFrom_GitHub_48394() { bool x = false; @@ -129,6 +138,7 @@ public static void ReproFrom_GitHub_48394() public static int Zero => 0; + [Fact] public static void TestInt2() { int val = Zero; @@ -141,17 +151,4 @@ public static void TestInt2() if (i < 10) goto label; } - - public static int Main() - { - ReproFrom_GitHub_48394(); - TestTakeAddress(); - TestTakeAddress(true); - TestTakeAddress(false); - TestInt(); - TestInt2(); - TestRefs(); - TestStruct(); - return 100; - } } diff --git a/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.csproj b/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.csproj index cba26e216ca0f..fd9e8098e4bc9 100644 --- a/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.csproj +++ b/src/tests/JIT/opt/DSE/Regressions/NotRedundantInitsAreRemoved_Github_48394.csproj @@ -1,6 +1,5 @@ - Exe True true diff --git a/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.cs b/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.cs index f394f4bea10ed..6a8b09163d776 100644 --- a/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.cs +++ b/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.cs @@ -6,8 +6,9 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; +using Xunit; -class Program +public class Program { private static int s_ReturnCode = 100; @@ -88,7 +89,8 @@ private static void Compare_Int32_Nullable(long? a, long? b) AssertEquals(expected, actual); } - public static int Main() + [Fact] + public static int TestEntryPoint() { long[] values = { diff --git a/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.csproj b/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.csproj index d3861623ca403..669603b68d88e 100644 --- a/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.csproj +++ b/src/tests/JIT/opt/Devirtualization/Comparer_get_Default.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.cs b/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.cs index 0639b948633a6..f96bd70e2ac96 100644 --- a/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.cs +++ b/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.cs @@ -3,8 +3,9 @@ using System; using System.Collections.Generic; +using Xunit; -class EqualityComparer_GitHub_10050 +public class EqualityComparer_GitHub_10050 { // Would like to see just one call to Default per call to Hoist public static int Hoist() @@ -111,7 +112,8 @@ public static int GeneralSink(T v0, T v1) } - public static int Main() + [Fact] + public static int TestEntryPoint() { int h = Hoist(); int s = Sink(33, 33); diff --git a/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.csproj b/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.csproj index 9d4c71a9706af..05084812d8c5c 100644 --- a/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.csproj +++ b/src/tests/JIT/opt/Devirtualization/EqualityComparer_GitHub_10050.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.cs b/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.cs index f106b70d28480..3f32ed68ceb0b 100644 --- a/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.cs +++ b/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; public class Program { @@ -11,7 +12,8 @@ public class Program private static IFoo _foo; private static IFooCov _fooCov; - public static int Main() + [Fact] + public static int TestEntryPoint() { _foo = new Foo1(); _fooCov = new Foo1Cov(); diff --git a/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.csproj b/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.csproj index d2e876e46ae5f..54cc0a1185b60 100644 --- a/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.csproj +++ b/src/tests/JIT/opt/Devirtualization/GDV_GenericInterface.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il b/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il index 408378fec3085..979353d0ef228 100644 --- a/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il +++ b/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il @@ -4,11 +4,7 @@ // Metadata version: v4.0.30319 -.assembly extern System.Runtime -{ - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 5:0:0:0 -} +.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } .assembly extern xunit.core {} .assembly extern System.Collections { @@ -203,10 +199,10 @@ } // end of class GenericArrayOverride.Derived -.class private auto ansi beforefieldinit GenericArrayOverride.Program +.class public auto ansi beforefieldinit GenericArrayOverride.Program extends [System.Runtime]System.Object { - .method private hidebysig static int32 + .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( diff --git a/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.ilproj b/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.ilproj index 2250129c9ce9c..85ce210283084 100644 --- a/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.ilproj +++ b/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_10311.cs b/src/tests/JIT/opt/Devirtualization/GitHub_10311.cs index 09bee8fc1c07d..4914993e1fe09 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_10311.cs +++ b/src/tests/JIT/opt/Devirtualization/GitHub_10311.cs @@ -4,6 +4,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Xunit; public class MyCollection : ICollection { @@ -64,9 +65,10 @@ IEnumerator IEnumerable.GetEnumerator() } } -class Bug +public class Bug { - public static int Main() + [Fact] + public static int TestEntryPoint() { int v = 0; MyCollection x = new MyCollection("a1", "a2"); diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_10311.csproj b/src/tests/JIT/opt/Devirtualization/GitHub_10311.csproj index e6224e0fcc14f..204766d169145 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_10311.csproj +++ b/src/tests/JIT/opt/Devirtualization/GitHub_10311.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_10858.cs b/src/tests/JIT/opt/Devirtualization/GitHub_10858.cs index b75a22402d0d7..ab487021c61b6 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_10858.cs +++ b/src/tests/JIT/opt/Devirtualization/GitHub_10858.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Runtime.CompilerServices; +using Xunit; class B { @@ -18,19 +20,20 @@ sealed class E : B public override string F() { return "E"; } } -class X +public class X { - public static int Main(string[] args) + [MethodImpl(MethodImplOptions.NoInlining)] + public static int Test(bool arg) { // When optimizing IL, CSC will leave the newobj's on the stack // across the branches to the common def point. - B b1 = (args.Length > 0) ? (B)new E() : (B)new D(); + B b1 = arg ? (B)new E() : (B)new D(); B b2 = null; // Conditional flow here to forces b1 to a local instead of // remaining on the stack. So we have a single def point with // two reaching values. - if (args.Length > 0) + if (arg) { b2 = new D(); } @@ -42,4 +45,10 @@ public static int Main(string[] args) // We should not be able to devirtualize either call. return b2.F()[0] + b1.F()[0] - 37; } + + [Fact] + public static int TestEntryPoint() + { + return Test(false); + } } diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_10858.csproj b/src/tests/JIT/opt/Devirtualization/GitHub_10858.csproj index ae0f1e7e4ee78..051f9e6ba4a02 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_10858.csproj +++ b/src/tests/JIT/opt/Devirtualization/GitHub_10858.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_50492.cs b/src/tests/JIT/opt/Devirtualization/GitHub_50492.cs index cdcb0bf584458..77dfd2b1840de 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_50492.cs +++ b/src/tests/JIT/opt/Devirtualization/GitHub_50492.cs @@ -3,6 +3,7 @@ using System.Runtime.CompilerServices; using System.Threading; +using Xunit; class Base { @@ -21,9 +22,10 @@ class ClassB : ClassA public override int Test(Base b1, Base b2, bool p) => b1.Test(b1, b2, p); } -class Program +public class Program { - public static int Main() + [Fact] + public static int TestEntryPoint() { for (int i = 0; i < 100; i++) { diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_50492.csproj b/src/tests/JIT/opt/Devirtualization/GitHub_50492.csproj index 1c4ed98b7d199..42abfa332ba85 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_50492.csproj +++ b/src/tests/JIT/opt/Devirtualization/GitHub_50492.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_51918.cs b/src/tests/JIT/opt/Devirtualization/GitHub_51918.cs index 0191f2f86b03b..8f1f592ed45ae 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_51918.cs +++ b/src/tests/JIT/opt/Devirtualization/GitHub_51918.cs @@ -1,4 +1,5 @@ using System; +using Xunit; public interface IGeneric { @@ -46,7 +47,8 @@ public InnerClass(GenericClass pointer) public class GitHub_51918 { - public static int Main() + [Fact] + public static int TestEntryPoint() { IGeneric genInterface = new GenericClass().GetInnerClass(); // Validate that two levels of inlining we don't behave incorrectly due to generic diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_51918.csproj b/src/tests/JIT/opt/Devirtualization/GitHub_51918.csproj index 76c35b1994db9..021eabca10816 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_51918.csproj +++ b/src/tests/JIT/opt/Devirtualization/GitHub_51918.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_59668.cs b/src/tests/JIT/opt/Devirtualization/GitHub_59668.cs index 93c3077908416..dd9906f1a4bae 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_59668.cs +++ b/src/tests/JIT/opt/Devirtualization/GitHub_59668.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.CompilerServices; +using Xunit; interface IMyInterface { @@ -13,9 +14,10 @@ sealed class MyInterfaceImpl : IMyInterface public int MyMethod() => 100; } -class Program +public class Program { - static int Main() => Test(); + [Fact] + public static int TestEntryPoint() => Test(); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_59668.csproj b/src/tests/JIT/opt/Devirtualization/GitHub_59668.csproj index a79791e0ad0c1..c9fcfc79b5147 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_59668.csproj +++ b/src/tests/JIT/opt/Devirtualization/GitHub_59668.csproj @@ -1,6 +1,5 @@ - Exe True None diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_9945.cs b/src/tests/JIT/opt/Devirtualization/GitHub_9945.cs index 53c8c2712c934..d87b54c288a9d 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_9945.cs +++ b/src/tests/JIT/opt/Devirtualization/GitHub_9945.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Runtime.CompilerServices; +using Xunit; public class Base { @@ -42,11 +44,12 @@ public virtual void MD() { } public class Test { - public static int Main(string[] args) + [MethodImpl(MethodImplOptions.NoInlining)] + public static int TestEntry(bool arg) { Base b; - if (args.Length > 0) + if (arg) { D1 d1 = new D1(); b = d1; @@ -64,4 +67,10 @@ public static int Main(string[] args) b.B0(); return b.value; } + + [Fact] + public static int TestEntryPoint() + { + return TestEntry(false); + } } diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_9945.csproj b/src/tests/JIT/opt/Devirtualization/GitHub_9945.csproj index 3a461b5344730..7a52fe688ef9c 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_9945.csproj +++ b/src/tests/JIT/opt/Devirtualization/GitHub_9945.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.ilproj b/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.ilproj index 40e94c4d7ee6b..0c65a1676f27f 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.ilproj +++ b/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.cs b/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.cs index e426eb5632233..2deac4dc8d6e6 100644 --- a/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.cs +++ b/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.cs @@ -1,10 +1,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class MultipleCanonicallyCompatibleImplementations { - static int Main() + [Fact] + public static int TestEntryPoint() { string atom1Call = Foo.Call(); string atom2Call = Foo.Call(); diff --git a/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.csproj b/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.csproj index 8b0cb15a73cba..738da49773721 100644 --- a/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.csproj +++ b/src/tests/JIT/opt/Devirtualization/MultipleCanonicallyCompatibleImplementations.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/arraypool.cs b/src/tests/JIT/opt/Devirtualization/arraypool.cs index 27a271552cbd9..ae962d0ce4400 100644 --- a/src/tests/JIT/opt/Devirtualization/arraypool.cs +++ b/src/tests/JIT/opt/Devirtualization/arraypool.cs @@ -4,8 +4,9 @@ using System; using System.Buffers; using System.Runtime.CompilerServices; +using Xunit; -class X +public class X { static int N; static int J; @@ -16,7 +17,8 @@ class X // We expect calls to Rent and Return to be // devirtualized. - public static int Main() + [Fact] + public static int TestEntryPoint() { N = 100; byte[] buffer = ArrayPool.Shared.Rent(N); diff --git a/src/tests/JIT/opt/Devirtualization/arraypool.csproj b/src/tests/JIT/opt/Devirtualization/arraypool.csproj index 01d379a82e540..3353cbe7472d7 100644 --- a/src/tests/JIT/opt/Devirtualization/arraypool.csproj +++ b/src/tests/JIT/opt/Devirtualization/arraypool.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Devirtualization/box1.cs b/src/tests/JIT/opt/Devirtualization/box1.cs index 4ce705f422e11..c26ae16df54d4 100644 --- a/src/tests/JIT/opt/Devirtualization/box1.cs +++ b/src/tests/JIT/opt/Devirtualization/box1.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; interface IPrint { @@ -15,9 +16,10 @@ struct X : IPrint T _t; } -class Y +public class Y { - static int Main() + [Fact] + public static int TestEntryPoint() { var s = new X("hello, world!"); // Jit should devirtualize, remove box, diff --git a/src/tests/JIT/opt/Devirtualization/box1.csproj b/src/tests/JIT/opt/Devirtualization/box1.csproj index 18d98a440f45b..f8a0baeaad553 100644 --- a/src/tests/JIT/opt/Devirtualization/box1.csproj +++ b/src/tests/JIT/opt/Devirtualization/box1.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Devirtualization/box2.csproj b/src/tests/JIT/opt/Devirtualization/box2.csproj index 3efd7cdda6629..8d5913d6526a8 100644 --- a/src/tests/JIT/opt/Devirtualization/box2.csproj +++ b/src/tests/JIT/opt/Devirtualization/box2.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/Devirtualization/comparable.cs b/src/tests/JIT/opt/Devirtualization/comparable.cs index 0270f98dbcfb8..2259cd6cb9e8e 100644 --- a/src/tests/JIT/opt/Devirtualization/comparable.cs +++ b/src/tests/JIT/opt/Devirtualization/comparable.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public sealed class X: IComparable { @@ -55,7 +56,8 @@ public static int C(T x, T y) public class Z { - public static int Main() + [Fact] + public static int TestEntryPoint() { // Ideally inlining Y.C would enable the interface call in Y // to be devirtualized, since we know the exact type of the diff --git a/src/tests/JIT/opt/Devirtualization/comparable.csproj b/src/tests/JIT/opt/Devirtualization/comparable.csproj index 14f8f48c308ce..578623c06b261 100644 --- a/src/tests/JIT/opt/Devirtualization/comparable.csproj +++ b/src/tests/JIT/opt/Devirtualization/comparable.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/constructor.cs b/src/tests/JIT/opt/Devirtualization/constructor.cs index ed7098f72feba..fd0094a4a3b39 100644 --- a/src/tests/JIT/opt/Devirtualization/constructor.cs +++ b/src/tests/JIT/opt/Devirtualization/constructor.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class Test_constructor +public class Test_constructor { static string s; @@ -19,7 +20,8 @@ public Test_constructor() s = ToString(); // cannot be devirtualized } - static int Main() + [Fact] + public static int TestEntryPoint() { new Child(); return (s == "Child" ? 100 : 0); diff --git a/src/tests/JIT/opt/Devirtualization/constructor.csproj b/src/tests/JIT/opt/Devirtualization/constructor.csproj index 97acbe3a946a3..df16af69d94d8 100644 --- a/src/tests/JIT/opt/Devirtualization/constructor.csproj +++ b/src/tests/JIT/opt/Devirtualization/constructor.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Devirtualization/contravariance.cs b/src/tests/JIT/opt/Devirtualization/contravariance.cs index d074d4e6a87ce..c71232d9109cd 100644 --- a/src/tests/JIT/opt/Devirtualization/contravariance.cs +++ b/src/tests/JIT/opt/Devirtualization/contravariance.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; interface I { @@ -16,14 +17,15 @@ T I.A() } } -class T +public class T { static object F(I i) { return i.A(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { // Jit should inline F and then devirtualize the call to A. // (inlining A blocked by runtime lookup) diff --git a/src/tests/JIT/opt/Devirtualization/contravariance.csproj b/src/tests/JIT/opt/Devirtualization/contravariance.csproj index 19fa41a61ff8b..d1b9b777560c6 100644 --- a/src/tests/JIT/opt/Devirtualization/contravariance.csproj +++ b/src/tests/JIT/opt/Devirtualization/contravariance.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/covariance.cs b/src/tests/JIT/opt/Devirtualization/covariance.cs index 457712c01f427..ca5fe8366b979 100644 --- a/src/tests/JIT/opt/Devirtualization/covariance.cs +++ b/src/tests/JIT/opt/Devirtualization/covariance.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; interface I { @@ -17,14 +18,15 @@ int I.A(T t) } } -class T +public class T { static int F(I i) { return i.A("A"); } - public static int Main() + [Fact] + public static int TestEntryPoint() { // Jit should inline F and then devirtualize // and inline the call to A. diff --git a/src/tests/JIT/opt/Devirtualization/covariance.csproj b/src/tests/JIT/opt/Devirtualization/covariance.csproj index e984c932ebd71..7f6205e49fc37 100644 --- a/src/tests/JIT/opt/Devirtualization/covariance.csproj +++ b/src/tests/JIT/opt/Devirtualization/covariance.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/enum.cs b/src/tests/JIT/opt/Devirtualization/enum.cs index e5bf3c0afb95d..48d09e5c0c583 100644 --- a/src/tests/JIT/opt/Devirtualization/enum.cs +++ b/src/tests/JIT/opt/Devirtualization/enum.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; enum MyEnum { One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten }; public class Test_enum { - public static int Main() + [Fact] + public static int TestEntryPoint() { // Call to ToString should be devirtualize since boxed enums // are sealed classes. This doesn't happen yet. diff --git a/src/tests/JIT/opt/Devirtualization/enum.csproj b/src/tests/JIT/opt/Devirtualization/enum.csproj index d2dc4df29b098..6b44bf1e8fbcc 100644 --- a/src/tests/JIT/opt/Devirtualization/enum.csproj +++ b/src/tests/JIT/opt/Devirtualization/enum.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/exact1.cs b/src/tests/JIT/opt/Devirtualization/exact1.cs index 3072df3c64a1a..2a62e3170c3b8 100644 --- a/src/tests/JIT/opt/Devirtualization/exact1.cs +++ b/src/tests/JIT/opt/Devirtualization/exact1.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // The jit should be able to inline M() if it gets the // exact context G @@ -13,7 +14,8 @@ class G public virtual bool M() => typeof(T) == typeof(string); } -class Program +public class Program { - static int Main() => new G().M() ? 100 : -1; + [Fact] + public static int TestEntryPoint() => new G().M() ? 100 : -1; } diff --git a/src/tests/JIT/opt/Devirtualization/exact1.csproj b/src/tests/JIT/opt/Devirtualization/exact1.csproj index 5625db7318199..4be61f56bf34a 100644 --- a/src/tests/JIT/opt/Devirtualization/exact1.csproj +++ b/src/tests/JIT/opt/Devirtualization/exact1.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/exact2.cs b/src/tests/JIT/opt/Devirtualization/exact2.cs index 0b18ff7e22634..c2e61b803bb80 100644 --- a/src/tests/JIT/opt/Devirtualization/exact2.cs +++ b/src/tests/JIT/opt/Devirtualization/exact2.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; class B { @@ -28,9 +29,10 @@ class G : E // All of the calls to F() in Main should devirtualize and inline -class Program +public class Program { - public static int Main() + [Fact] + public static int TestEntryPoint() { B b = new B(); D ds = new D(); diff --git a/src/tests/JIT/opt/Devirtualization/exact2.csproj b/src/tests/JIT/opt/Devirtualization/exact2.csproj index 8cd5842213800..1ab4977868a8d 100644 --- a/src/tests/JIT/opt/Devirtualization/exact2.csproj +++ b/src/tests/JIT/opt/Devirtualization/exact2.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/exacttype.cs b/src/tests/JIT/opt/Devirtualization/exacttype.cs index 46f8a6a6a53eb..d3a60f5b03026 100644 --- a/src/tests/JIT/opt/Devirtualization/exacttype.cs +++ b/src/tests/JIT/opt/Devirtualization/exacttype.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Base { @@ -33,7 +34,8 @@ public static Base M() return new Derived(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { // Declared type of 'd' has final method Foo(), so calls to // Foo() will devirtualize. diff --git a/src/tests/JIT/opt/Devirtualization/exacttype.csproj b/src/tests/JIT/opt/Devirtualization/exacttype.csproj index 5626aadb4c7b6..87808a560dcba 100644 --- a/src/tests/JIT/opt/Devirtualization/exacttype.csproj +++ b/src/tests/JIT/opt/Devirtualization/exacttype.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/fromcollection.cs b/src/tests/JIT/opt/Devirtualization/fromcollection.cs index e5ba1becfad34..4389df7e711d1 100644 --- a/src/tests/JIT/opt/Devirtualization/fromcollection.cs +++ b/src/tests/JIT/opt/Devirtualization/fromcollection.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Xunit; public class Base { @@ -34,7 +35,8 @@ public class Test_fromcollection static Derived[] arrayOfDerived = new Derived[3]; static List listOfDerived = new List(); - public static int Main() + [Fact] + public static int TestEntryPoint() { for (int i = 0; i < 3; i++) { diff --git a/src/tests/JIT/opt/Devirtualization/fromcollection.csproj b/src/tests/JIT/opt/Devirtualization/fromcollection.csproj index fa2c94d2d7bc3..ea51fb7be4e66 100644 --- a/src/tests/JIT/opt/Devirtualization/fromcollection.csproj +++ b/src/tests/JIT/opt/Devirtualization/fromcollection.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/generic.cs b/src/tests/JIT/opt/Devirtualization/generic.cs index 1bc408e05d215..0930f2f7c229b 100644 --- a/src/tests/JIT/opt/Devirtualization/generic.cs +++ b/src/tests/JIT/opt/Devirtualization/generic.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; interface Ix { @@ -63,7 +64,8 @@ public class Z static int IxF(Ix x) { return x.F(); } static int IxG(Ix x) { return x.G(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { E e = new E(); K k = new K(); diff --git a/src/tests/JIT/opt/Devirtualization/generic.csproj b/src/tests/JIT/opt/Devirtualization/generic.csproj index ae787ed27d2b1..eab165d7a7270 100644 --- a/src/tests/JIT/opt/Devirtualization/generic.csproj +++ b/src/tests/JIT/opt/Devirtualization/generic.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/generic_noinline.cs b/src/tests/JIT/opt/Devirtualization/generic_noinline.cs index 541478c831238..766e00e05dbfb 100644 --- a/src/tests/JIT/opt/Devirtualization/generic_noinline.cs +++ b/src/tests/JIT/opt/Devirtualization/generic_noinline.cs @@ -3,10 +3,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class Program +public class Program { - static int Main() + [Fact] + public static int TestEntryPoint() { MyStruct s = default; diff --git a/src/tests/JIT/opt/Devirtualization/generic_noinline.csproj b/src/tests/JIT/opt/Devirtualization/generic_noinline.csproj index 4478172d2f505..a5286ed85dbb4 100644 --- a/src/tests/JIT/opt/Devirtualization/generic_noinline.csproj +++ b/src/tests/JIT/opt/Devirtualization/generic_noinline.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Devirtualization/inlinedevirt.cs b/src/tests/JIT/opt/Devirtualization/inlinedevirt.cs index c1ac52f3fd43f..95e48b32b86e0 100644 --- a/src/tests/JIT/opt/Devirtualization/inlinedevirt.cs +++ b/src/tests/JIT/opt/Devirtualization/inlinedevirt.cs @@ -2,8 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; -class ImprovedType +public class ImprovedType { // Jit should inline this method and then devirtualize ToString() static void Print(object o) @@ -11,7 +12,8 @@ static void Print(object o) Console.WriteLine(o.ToString()); } - public static int Main() + [Fact] + public static int TestEntryPoint() { Print("hello, world!"); return 100; diff --git a/src/tests/JIT/opt/Devirtualization/inlinedevirt.csproj b/src/tests/JIT/opt/Devirtualization/inlinedevirt.csproj index d7b2c50ba69e6..725f688a2a378 100644 --- a/src/tests/JIT/opt/Devirtualization/inlinedevirt.csproj +++ b/src/tests/JIT/opt/Devirtualization/inlinedevirt.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/late.cs b/src/tests/JIT/opt/Devirtualization/late.cs index 2b98b3efb3beb..cd8484748cd94 100644 --- a/src/tests/JIT/opt/Devirtualization/late.cs +++ b/src/tests/JIT/opt/Devirtualization/late.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; interface Ix where T : class { @@ -30,7 +31,8 @@ static string X(Base b) return b.F(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { // Would like to be able to late devirtualize the call to F // here after inlining Get exposes the exact type of the diff --git a/src/tests/JIT/opt/Devirtualization/late.csproj b/src/tests/JIT/opt/Devirtualization/late.csproj index 2df30ff9555b6..2e24218aac647 100644 --- a/src/tests/JIT/opt/Devirtualization/late.csproj +++ b/src/tests/JIT/opt/Devirtualization/late.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/late1.cs b/src/tests/JIT/opt/Devirtualization/late1.cs index 244f3528cdf7f..a05aa2e5b171b 100644 --- a/src/tests/JIT/opt/Devirtualization/late1.cs +++ b/src/tests/JIT/opt/Devirtualization/late1.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class B { @@ -34,7 +35,8 @@ static B Choose(bool b) } // The calls to F should be devirtualized late - public static int Main() + [Fact] + public static int TestEntryPoint() { int v0 = Choose(false).F(V(67)); B b = Choose(true); diff --git a/src/tests/JIT/opt/Devirtualization/late1.csproj b/src/tests/JIT/opt/Devirtualization/late1.csproj index 3b41b7b1b0a75..de1b91f7e3015 100644 --- a/src/tests/JIT/opt/Devirtualization/late1.csproj +++ b/src/tests/JIT/opt/Devirtualization/late1.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Devirtualization/overload.cs b/src/tests/JIT/opt/Devirtualization/overload.cs index 41d8a7f822689..e9924881a8709 100644 --- a/src/tests/JIT/opt/Devirtualization/overload.cs +++ b/src/tests/JIT/opt/Devirtualization/overload.cs @@ -2,8 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; -interface Io where T:class where U:class +public interface Io where T:class where U:class { T FromU(U u); T FromS(string s); @@ -14,7 +15,8 @@ public class Z : Io string Io.FromU(string s) { return "U"; } string Io.FromS(string s) { return "S"; } - public static int Main() + [Fact] + public static int TestEntryPoint() { string fromU = ((Io) new Z()).FromU("u"); string fromS = ((Io) new Z()).FromS("s"); diff --git a/src/tests/JIT/opt/Devirtualization/overload.csproj b/src/tests/JIT/opt/Devirtualization/overload.csproj index a447bae22fc07..ceaf53773b082 100644 --- a/src/tests/JIT/opt/Devirtualization/overload.csproj +++ b/src/tests/JIT/opt/Devirtualization/overload.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/override.ilproj b/src/tests/JIT/opt/Devirtualization/override.ilproj index 8e31850ce765e..0446d3eb30253 100644 --- a/src/tests/JIT/opt/Devirtualization/override.ilproj +++ b/src/tests/JIT/opt/Devirtualization/override.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/readonlystatic.cs b/src/tests/JIT/opt/Devirtualization/readonlystatic.cs index 8dd7d0debc09c..7e8946f8f2a76 100644 --- a/src/tests/JIT/opt/Devirtualization/readonlystatic.cs +++ b/src/tests/JIT/opt/Devirtualization/readonlystatic.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; class B { @@ -14,7 +15,7 @@ class D : B public override int F() => 100; } -class X +public class X { static readonly B S; static int R; @@ -40,7 +41,8 @@ static int After() return S.F(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { var p = S; int a = After(); diff --git a/src/tests/JIT/opt/Devirtualization/readonlystatic.csproj b/src/tests/JIT/opt/Devirtualization/readonlystatic.csproj index 901818a1b003d..33259167d4782 100644 --- a/src/tests/JIT/opt/Devirtualization/readonlystatic.csproj +++ b/src/tests/JIT/opt/Devirtualization/readonlystatic.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Devirtualization/sealedclass.cs b/src/tests/JIT/opt/Devirtualization/sealedclass.cs index f3951416e9053..5b0c7475e632e 100644 --- a/src/tests/JIT/opt/Devirtualization/sealedclass.cs +++ b/src/tests/JIT/opt/Devirtualization/sealedclass.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Base { @@ -28,7 +29,8 @@ public static int TestSealedMethodInlining(Derived obj) return obj.GetValue(3); } - public static int Main() + [Fact] + public static int TestEntryPoint() { Derived d = new Derived(); int v = TestSealedMethodInlining(d); diff --git a/src/tests/JIT/opt/Devirtualization/sealedclass.csproj b/src/tests/JIT/opt/Devirtualization/sealedclass.csproj index 34ebbf0aab21b..dd5721bf3db44 100644 --- a/src/tests/JIT/opt/Devirtualization/sealedclass.csproj +++ b/src/tests/JIT/opt/Devirtualization/sealedclass.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/sealeddefault.cs b/src/tests/JIT/opt/Devirtualization/sealeddefault.cs index bec72db38a395..e749b1d9f680f 100644 --- a/src/tests/JIT/opt/Devirtualization/sealeddefault.cs +++ b/src/tests/JIT/opt/Devirtualization/sealeddefault.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public class Base { @@ -19,7 +20,8 @@ sealed class BaseSealed : Base {} public class Test_sealeddefault { - public static int Main() + [Fact] + public static int TestEntryPoint() { Base b = Base.Default; int x = b.Foo(); diff --git a/src/tests/JIT/opt/Devirtualization/sealeddefault.csproj b/src/tests/JIT/opt/Devirtualization/sealeddefault.csproj index 6e51956155123..d11717539953a 100644 --- a/src/tests/JIT/opt/Devirtualization/sealeddefault.csproj +++ b/src/tests/JIT/opt/Devirtualization/sealeddefault.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/sealedmethod.cs b/src/tests/JIT/opt/Devirtualization/sealedmethod.cs index 64cbfc26a5346..babd13c83b0c6 100644 --- a/src/tests/JIT/opt/Devirtualization/sealedmethod.cs +++ b/src/tests/JIT/opt/Devirtualization/sealedmethod.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Base { @@ -28,7 +29,8 @@ public static int TestSealedMethodInlining(Derived obj) return obj.GetValue(3); } - public static int Main() + [Fact] + public static int TestEntryPoint() { Derived d = new Derived(); int v = TestSealedMethodInlining(d); diff --git a/src/tests/JIT/opt/Devirtualization/sealedmethod.csproj b/src/tests/JIT/opt/Devirtualization/sealedmethod.csproj index fe99d483736ce..800581095e3f3 100644 --- a/src/tests/JIT/opt/Devirtualization/sealedmethod.csproj +++ b/src/tests/JIT/opt/Devirtualization/sealedmethod.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/sharedoverride.cs b/src/tests/JIT/opt/Devirtualization/sharedoverride.cs index 8e973f6c9d830..a75db7aa5f0bc 100644 --- a/src/tests/JIT/opt/Devirtualization/sharedoverride.cs +++ b/src/tests/JIT/opt/Devirtualization/sharedoverride.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public class Base { @@ -41,7 +42,8 @@ public override sealed int Foo(int x) public class Test_sharedoverride { - public static int Main() + [Fact] + public static int TestEntryPoint() { var ds = new Derived(); var dx = new Derived(); diff --git a/src/tests/JIT/opt/Devirtualization/sharedoverride.csproj b/src/tests/JIT/opt/Devirtualization/sharedoverride.csproj index 831d875712e3a..345a13e57d330 100644 --- a/src/tests/JIT/opt/Devirtualization/sharedoverride.csproj +++ b/src/tests/JIT/opt/Devirtualization/sharedoverride.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/simple.cs b/src/tests/JIT/opt/Devirtualization/simple.cs index 89d23b114e831..17fe1ee8675e1 100644 --- a/src/tests/JIT/opt/Devirtualization/simple.cs +++ b/src/tests/JIT/opt/Devirtualization/simple.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // Some simple interface call devirtualization cases @@ -40,7 +41,8 @@ public class Z : B, Iz static int Hz(Iz z) { return z.H(); } static int Hi(Iz z) { return z.I(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { int callsBF = Fx(new Z()) + Fx(new B()) + ((Ix) new Z()).F() + ((Ix) new B()).F(); int callsBG = Gy(new B()) + ((Iy) new B()).G() + (new B()).G(); diff --git a/src/tests/JIT/opt/Devirtualization/simple.csproj b/src/tests/JIT/opt/Devirtualization/simple.csproj index fe4c3ed99ecaf..afa524a1223fc 100644 --- a/src/tests/JIT/opt/Devirtualization/simple.csproj +++ b/src/tests/JIT/opt/Devirtualization/simple.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/spilledreturn.cs b/src/tests/JIT/opt/Devirtualization/spilledreturn.cs index a7b11fe3da5ad..dadd8bc417a19 100644 --- a/src/tests/JIT/opt/Devirtualization/spilledreturn.cs +++ b/src/tests/JIT/opt/Devirtualization/spilledreturn.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Examples where methods potentially return multiple types // but the jit can prune the set down to one type during @@ -74,10 +75,9 @@ public static Base G() } } - public static int Main(string[] args) + [MethodImpl(MethodImplOptions.NoInlining)] + public static int TestEntry(bool vague) { - vague = args.Length > 0; - M(0).Foo(); M(0).Bar(); M(1).Foo(); @@ -92,6 +92,12 @@ public static int Main(string[] args) return 100; } + + [Fact] + public static int TestEntryPoint() + { + return TestEntry(false); + } } diff --git a/src/tests/JIT/opt/Devirtualization/spilledreturn.csproj b/src/tests/JIT/opt/Devirtualization/spilledreturn.csproj index 6d649e35b7f7d..37f68ddf78053 100644 --- a/src/tests/JIT/opt/Devirtualization/spilledreturn.csproj +++ b/src/tests/JIT/opt/Devirtualization/spilledreturn.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Devirtualization/structreturningstruct.cs b/src/tests/JIT/opt/Devirtualization/structreturningstruct.cs index 4abba445753d0..11d264099ae4b 100644 --- a/src/tests/JIT/opt/Devirtualization/structreturningstruct.cs +++ b/src/tests/JIT/opt/Devirtualization/structreturningstruct.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.Threading; +using Xunit; // Runtime issue 52975. // @@ -21,7 +22,7 @@ // DOTNET_TieredPGO=1 // DOTNET_TC_QuickJitForLoopsO=1 // -class X +public class X { static int F(IDictionary i) { @@ -37,7 +38,8 @@ static int F(IDictionary i) return r; } - public static int Main() + [Fact] + public static int TestEntryPoint() { Dictionary s = new Dictionary(); s["hello"] = "world"; diff --git a/src/tests/JIT/opt/Devirtualization/structreturningstruct.csproj b/src/tests/JIT/opt/Devirtualization/structreturningstruct.csproj index 4cda91093d148..cf5598e6bb997 100644 --- a/src/tests/JIT/opt/Devirtualization/structreturningstruct.csproj +++ b/src/tests/JIT/opt/Devirtualization/structreturningstruct.csproj @@ -1,6 +1,7 @@ - Exe + + true PdbOnly diff --git a/src/tests/JIT/opt/Directory.Build.props b/src/tests/JIT/opt/Directory.Build.props new file mode 100644 index 0000000000000..fd98cb087403e --- /dev/null +++ b/src/tests/JIT/opt/Directory.Build.props @@ -0,0 +1,11 @@ + + + + + + + true + $(NoWarn);IL3000 + false + + diff --git a/src/tests/JIT/opt/Divide/Regressions/Regression1.csproj b/src/tests/JIT/opt/Divide/Regressions/Regression1.csproj deleted file mode 100644 index f3e1cbd44b404..0000000000000 --- a/src/tests/JIT/opt/Divide/Regressions/Regression1.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - Exe - - - None - True - - - - - diff --git a/src/tests/JIT/opt/Divide/Regressions/Regression1.cs b/src/tests/JIT/opt/Divide/Regressions/Regression1_Divide.cs similarity index 98% rename from src/tests/JIT/opt/Divide/Regressions/Regression1.cs rename to src/tests/JIT/opt/Divide/Regressions/Regression1_Divide.cs index 0e6b0bf731372..f09006b3f48c8 100644 --- a/src/tests/JIT/opt/Divide/Regressions/Regression1.cs +++ b/src/tests/JIT/opt/Divide/Regressions/Regression1_Divide.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { @@ -169,7 +170,8 @@ public static short Test20(short x, short y) return (short)(x / y); } - public static int Main() + [Fact] + public static int TestEntryPoint() { var result1 = Test1(24648); var result2 = Test2(); diff --git a/src/tests/JIT/opt/Vectorization/StringEquals.csproj b/src/tests/JIT/opt/Divide/Regressions/Regression1_Divide.csproj similarity index 85% rename from src/tests/JIT/opt/Vectorization/StringEquals.csproj rename to src/tests/JIT/opt/Divide/Regressions/Regression1_Divide.csproj index 6946bed81bfd5..501217e4d8689 100644 --- a/src/tests/JIT/opt/Vectorization/StringEquals.csproj +++ b/src/tests/JIT/opt/Divide/Regressions/Regression1_Divide.csproj @@ -1,6 +1,6 @@ - Exe + None True diff --git a/src/tests/JIT/opt/Divide/Regressions/Regression2.cs b/src/tests/JIT/opt/Divide/Regressions/Regression2_Divide.cs similarity index 93% rename from src/tests/JIT/opt/Divide/Regressions/Regression2.cs rename to src/tests/JIT/opt/Divide/Regressions/Regression2_Divide.cs index 923462a26e95b..55e0591ed72c5 100644 --- a/src/tests/JIT/opt/Divide/Regressions/Regression2.cs +++ b/src/tests/JIT/opt/Divide/Regressions/Regression2_Divide.cs @@ -1,13 +1,15 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2023-02-22 21:24:57 // Run on X64 Windows // Seed: 15773855565313675298 public class Program { public static sbyte s_3 = 10; - public static int Main() + [Fact] + public static int TestEntryPoint() { var result = 100; diff --git a/src/tests/JIT/opt/Divide/Regressions/Regression3.csproj b/src/tests/JIT/opt/Divide/Regressions/Regression2_Divide.csproj similarity index 76% rename from src/tests/JIT/opt/Divide/Regressions/Regression3.csproj rename to src/tests/JIT/opt/Divide/Regressions/Regression2_Divide.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Divide/Regressions/Regression3.csproj +++ b/src/tests/JIT/opt/Divide/Regressions/Regression2_Divide.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Divide/Regressions/Regression3.cs b/src/tests/JIT/opt/Divide/Regressions/Regression3_Divide.cs similarity index 90% rename from src/tests/JIT/opt/Divide/Regressions/Regression3.cs rename to src/tests/JIT/opt/Divide/Regressions/Regression3_Divide.cs index b45f3a9e53887..b585a91f261f2 100644 --- a/src/tests/JIT/opt/Divide/Regressions/Regression3.cs +++ b/src/tests/JIT/opt/Divide/Regressions/Regression3_Divide.cs @@ -1,13 +1,15 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2023-02-22 22:21:43 // Run on X64 Windows // Seed: 1391301158118545956 public class Program { public static ulong s_2 = 12180724836008689112UL; - public static int Main() + [Fact] + public static int TestEntryPoint() { short vr4 = default(short); return M3(vr4); diff --git a/src/tests/JIT/opt/Divide/Regressions/Regression2.csproj b/src/tests/JIT/opt/Divide/Regressions/Regression3_Divide.csproj similarity index 76% rename from src/tests/JIT/opt/Divide/Regressions/Regression2.csproj rename to src/tests/JIT/opt/Divide/Regressions/Regression3_Divide.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Divide/Regressions/Regression2.csproj +++ b/src/tests/JIT/opt/Divide/Regressions/Regression3_Divide.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il index 36adec8a81ca5..04439a45761f2 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il @@ -11,8 +11,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly BBCnt1 {} -.class private auto ansi beforefieldinit BBCnt1 +.assembly BBCnt1_DumpDisasm {} +.class public auto ansi beforefieldinit BBCnt1 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.ilproj b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1_DumpDisasm.ilproj similarity index 89% rename from src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.ilproj rename to src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1_DumpDisasm.ilproj index 9056251dd3990..8819e126ace2c 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.ilproj +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1_DumpDisasm.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il index 62d2f492b5cc1..43951d3027179 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il @@ -11,8 +11,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly CodeSize1 {} -.class private auto ansi beforefieldinit CodeSize1 +.assembly CodeSize1_DumpDisasm {} +.class public auto ansi beforefieldinit CodeSize1 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.ilproj b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1_DumpDisasm.ilproj similarity index 89% rename from src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.ilproj rename to src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1_DumpDisasm.ilproj index a04764310e762..65cfc3ba7ff40 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.ilproj +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1_DumpDisasm.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il index da075a15f17c5..f61d6aaae7e7c 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il @@ -10,8 +10,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly InstrCnt1 {} -.class private auto ansi beforefieldinit InstrCnt1 +.assembly InstrCnt1_DumpDisasm {} +.class public auto ansi beforefieldinit InstrCnt1 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.ilproj b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1_DumpDisasm.ilproj similarity index 75% rename from src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.ilproj rename to src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1_DumpDisasm.ilproj index e952e5537dce3..aac839385c705 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.ilproj +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1_DumpDisasm.ilproj @@ -1,7 +1,4 @@ - - Exe - Full False diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1.il index 75abf4b11226f..d6d6434b3ce59 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1.il @@ -5,20 +5,26 @@ // V2000 (loc2000) int // OPTIONS: opts.MinOpts() == true .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly LVNumCnt1 {} +.assembly LVNumCnt1_DumpDisasm {} +.class public auto ansi LVNumCnt1 { .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint call int32 TestLVNumCnt() ldc.i4 100000199 add ret } +} .method public static int32 TestLVNumCnt() { .locals init ( diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1.ilproj b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1_DumpDisasm.ilproj similarity index 89% rename from src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1.ilproj rename to src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1_DumpDisasm.ilproj index 0802139d9f482..ba32603baafff 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1.ilproj +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1_DumpDisasm.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1.il index bae14f10c6166..7121e872619de 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1.il @@ -5,20 +5,26 @@ // New refCnts for V00: refCnt = 8001 // OPTIONS: opts.MinOpts() == true .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly LVRefCnt1 {} +.assembly LVRefCnt1_DumpDisasm {} +.class public auto ansi LVRefCnt1 { .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint call int32 TestLVRefCnt() ldc.i4 100 sub ret } +} .method public static int32 TestLVRefCnt() { .locals init (int32 V_0) diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1.ilproj b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1_DumpDisasm.ilproj similarity index 89% rename from src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1.ilproj rename to src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1_DumpDisasm.ilproj index 2a6adc319f61d..5272c51cf9eae 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1.ilproj +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVRefCnt1_DumpDisasm.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/ETW/TailCallCases.il b/src/tests/JIT/opt/ETW/TailCallCases.il index 352698950fbf2..031d857fab083 100644 --- a/src/tests/JIT/opt/ETW/TailCallCases.il +++ b/src/tests/JIT/opt/ETW/TailCallCases.il @@ -88,7 +88,7 @@ } // end of class ETW.threeByteStruct -.class private auto ansi beforefieldinit ETW.TailCallETW +.class public auto ansi beforefieldinit ETW.TailCallETW extends [mscorlib]System.Object { .method private hidebysig static int32 @@ -222,7 +222,7 @@ IL_0011: ret } // end of method TailCallETW::failedHelper - .method private hidebysig static int32 + .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( diff --git a/src/tests/JIT/opt/ETW/TailCallCases.ilproj b/src/tests/JIT/opt/ETW/TailCallCases.ilproj index 8093054d48be1..c7d05362d767e 100644 --- a/src/tests/JIT/opt/ETW/TailCallCases.ilproj +++ b/src/tests/JIT/opt/ETW/TailCallCases.ilproj @@ -1,7 +1,4 @@ - - Exe - Full False diff --git a/src/tests/JIT/opt/Enum/hasflag.cs b/src/tests/JIT/opt/Enum/hasflag.cs index 9fb8fae2a94c9..4609f0e8a7758 100644 --- a/src/tests/JIT/opt/Enum/hasflag.cs +++ b/src/tests/JIT/opt/Enum/hasflag.cs @@ -8,6 +8,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; enum E { @@ -46,7 +47,7 @@ class ShortHolder public short v; } -class P +public class P { static E[] ArrayOfE = { E.RED, E.BLUE }; @@ -72,36 +73,37 @@ static E GetESideEffect() return e; } - public static bool ByrefE(ref E e1, E e2) + internal static bool ByrefE(ref E e1, E e2) { return e1.HasFlag(e2); } - public static bool ByrefF(ref F e1, F e2) + internal static bool ByrefF(ref F e1, F e2) { return e1.HasFlag(e2); } - public static bool ByrefG(ref G e1, G e2) + internal static bool ByrefG(ref G e1, G e2) { return e1.HasFlag(e2); } // Example from GitHub 23847 [MethodImpl(MethodImplOptions.NoInlining)] - public static bool GitHub23847(E e1, short s) + internal static bool GitHub23847(E e1, short s) { return GitHub23847Aux(s).HasFlag(e1); } // Once this is inlined we end up with a short pre-boxed value - public static E GitHub23847Aux(short s) + internal static E GitHub23847Aux(short s) { ShortHolder h = new ShortHolder(s); return (E)h.v; } - public static int Main() + [Fact] + public static int TestEntryPoint() { E e1 = E.RED; E e2 = E.BLUE; diff --git a/src/tests/JIT/opt/Enum/hasflag.csproj b/src/tests/JIT/opt/Enum/hasflag.csproj index 4c6d160d71617..3d79f2e202515 100644 --- a/src/tests/JIT/opt/Enum/hasflag.csproj +++ b/src/tests/JIT/opt/Enum/hasflag.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Enum/shared.cs b/src/tests/JIT/opt/Enum/shared.cs index b7c2305111c6c..501421f1e9d3a 100644 --- a/src/tests/JIT/opt/Enum/shared.cs +++ b/src/tests/JIT/opt/Enum/shared.cs @@ -6,6 +6,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; class MyG { @@ -22,9 +23,10 @@ public static void foo() } } -class My +public class My { - public static int Main() + [Fact] + public static int TestEntryPoint() { int result = 0; try diff --git a/src/tests/JIT/opt/Enum/shared.csproj b/src/tests/JIT/opt/Enum/shared_Enum.csproj similarity index 89% rename from src/tests/JIT/opt/Enum/shared.csproj rename to src/tests/JIT/opt/Enum/shared_Enum.csproj index 7b6ce500bcd81..8fdba6fd199f9 100644 --- a/src/tests/JIT/opt/Enum/shared.csproj +++ b/src/tests/JIT/opt/Enum/shared_Enum.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.cs b/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.cs index 1ad915322ee79..840c2d79b5f47 100644 --- a/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.cs +++ b/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; //////////////////////////////////////////////////////////////////////////////// // Types @@ -24,7 +25,7 @@ public class FastTailCallCandidates /// /// Check the return value of the test and set s_ret_value if incorrect /// - public static void CheckOutput(int code) + internal static void CheckOutput(int code) { // If there has been a previous failure then do not reset the first // failure this will be the return value. @@ -1871,7 +1872,8 @@ public static int CallerAmd64WindowsStructs3Bytes(byte a, byte b) // Main //////////////////////////////////////////////////////////////////////////// - public static int Main() + [Fact] + public static int TestEntryPoint() { return Tester(1); } diff --git a/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.csproj b/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.csproj index d782cd6a7f213..e6a95ae3076d4 100644 --- a/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.csproj +++ b/src/tests/JIT/opt/FastTailCall/FastTailCallCandidates.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.cs b/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.cs index 0644e703a6a6a..bc8c6ab8b02af 100644 --- a/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.cs +++ b/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.cs @@ -3,16 +3,13 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Test_FastTailCallInlining { - public static int Main() - { - A(2); - return 100; - } - - public static void A(int i) + [Theory] + [InlineData(2)] + public static void A(int i) { if (i > 0) { @@ -21,13 +18,13 @@ public static void A(int i) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void B(int i) + internal static void B(int i) { C(i); A(--i); } - public static void C(int i) + internal static void C(int i) { Console.WriteLine("In C"); if (i==0) diff --git a/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.csproj b/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.csproj index 8fb9fc418fd7d..6e4107a858074 100644 --- a/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.csproj +++ b/src/tests/JIT/opt/FastTailCall/FastTailCallInlining.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.cs b/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.cs index 0dddf63ee5ddb..a0a2f29378b40 100644 --- a/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.cs +++ b/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public class GitHubIssue12479 { @@ -75,7 +76,8 @@ public static int caller(float one, } - public static int Main() + [Fact] + public static int TestEntryPoint() { // We have 8 floating args on unix. int a = caller(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); diff --git a/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.csproj b/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.csproj index 1ef1a0fdc6066..f35649562084d 100644 --- a/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.csproj +++ b/src/tests/JIT/opt/FastTailCall/GitHubIssue12479.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/JIT/opt/FastTailCall/StackFixup.cs b/src/tests/JIT/opt/FastTailCall/StackFixup.cs index 99df90209839a..09cd0b253ed27 100644 --- a/src/tests/JIT/opt/FastTailCall/StackFixup.cs +++ b/src/tests/JIT/opt/FastTailCall/StackFixup.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public struct A { @@ -8,7 +9,7 @@ public struct A public short b; } -class TailCallStructPassing +public class TailCallStructPassing { public static int bar(int count, A temp) { @@ -50,7 +51,8 @@ public static int foo(int decision, int count, int a, int b, int c, int d, int e } } - public static int Main() + [Fact] + public static int TestEntryPoint() { A temp = new A(); temp.a = 50; diff --git a/src/tests/JIT/opt/FastTailCall/StackFixup.csproj b/src/tests/JIT/opt/FastTailCall/StackFixup.csproj index a54fe126ba7f9..ba8ad7c14401f 100644 --- a/src/tests/JIT/opt/FastTailCall/StackFixup.csproj +++ b/src/tests/JIT/opt/FastTailCall/StackFixup.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/JIT/opt/FastTailCall/StructPassingSimple.cs b/src/tests/JIT/opt/FastTailCall/StructPassingSimple.cs index 8752035c36703..e9423842901ad 100644 --- a/src/tests/JIT/opt/FastTailCall/StructPassingSimple.cs +++ b/src/tests/JIT/opt/FastTailCall/StructPassingSimple.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // 10 byte struct public struct A @@ -10,7 +11,7 @@ public struct A public short c; } -class TailCallStructPassingSimple +public class TailCallStructPassingSimple { // Simple tail call candidate that would be ignored on Arm64 and amd64 Unix // due to https://github.com/dotnet/runtime/issues/4941 @@ -24,7 +25,8 @@ public static int ImplicitTailCallTenByteStruct(A a, int count=1000) return ImplicitTailCallTenByteStruct(a, count); } - public static int Main() + [Fact] + public static int TestEntryPoint() { A temp = new A(); temp.a = 50; diff --git a/src/tests/JIT/opt/FastTailCall/StructPassingSimple.csproj b/src/tests/JIT/opt/FastTailCall/StructPassingSimple.csproj index a1a30072de807..57484ce9c8a23 100644 --- a/src/tests/JIT/opt/FastTailCall/StructPassingSimple.csproj +++ b/src/tests/JIT/opt/FastTailCall/StructPassingSimple.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/JIT/opt/ForwardSub/andnotcontained.cs b/src/tests/JIT/opt/ForwardSub/andnotcontained.cs index 3a9c3934599ac..82230e88c79dc 100644 --- a/src/tests/JIT/opt/ForwardSub/andnotcontained.cs +++ b/src/tests/JIT/opt/ForwardSub/andnotcontained.cs @@ -1,6 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2022-02-04 12:51:20 // Run on X86 Windows // Seed: 5821979800164656837 @@ -11,7 +12,8 @@ public class Program { public static IRT s_rt; public static long s_4; - public static int Main() + [Fact] + public static int TestEntryPoint() { s_rt = new C(); int vr3 = (int)(s_4 & ~M7()); diff --git a/src/tests/JIT/opt/ForwardSub/andnotcontained.csproj b/src/tests/JIT/opt/ForwardSub/andnotcontained.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/andnotcontained.csproj +++ b/src/tests/JIT/opt/ForwardSub/andnotcontained.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ForwardSub/callArgInterference.cs b/src/tests/JIT/opt/ForwardSub/callArgInterference.cs index 60c8a908e85bc..0522260018c63 100644 --- a/src/tests/JIT/opt/ForwardSub/callArgInterference.cs +++ b/src/tests/JIT/opt/ForwardSub/callArgInterference.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // Generated by Fuzzlyn v1.5 on 2022-02-02 18:45:57 @@ -9,6 +9,7 @@ // Release: Outputs -2 using System; using System.Runtime.CompilerServices; +using Xunit; public interface I1 { @@ -40,7 +41,8 @@ public I1 M7() public class ForwardSubCallArgInterference { public static IRT s_rt; - public static int Main() + [Fact] + public static int TestEntryPoint() { s_rt = new C(); S0 vr0 = default(S0); diff --git a/src/tests/JIT/opt/ForwardSub/callArgInterference.csproj b/src/tests/JIT/opt/ForwardSub/callArgInterference.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/callArgInterference.csproj +++ b/src/tests/JIT/opt/ForwardSub/callArgInterference.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ForwardSub/callArgInterference2.cs b/src/tests/JIT/opt/ForwardSub/callArgInterference2.cs index 729254aa448fa..d490780d99967 100644 --- a/src/tests/JIT/opt/ForwardSub/callArgInterference2.cs +++ b/src/tests/JIT/opt/ForwardSub/callArgInterference2.cs @@ -1,6 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2022-02-06 17:06:01 // Run on X86 Windows // Seed: 7854701479455767355 @@ -29,7 +30,8 @@ public class ForwardSubCallArgInterference2 { public static IRT s_rt; public static int[][] s_28 = new int[][]{new int[]{1}}; - public static int Main() + [Fact] + public static int TestEntryPoint() { s_rt = new C(); var vr3 = new S0(); diff --git a/src/tests/JIT/opt/ForwardSub/callArgInterference2.csproj b/src/tests/JIT/opt/ForwardSub/callArgInterference2.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/callArgInterference2.csproj +++ b/src/tests/JIT/opt/ForwardSub/callArgInterference2.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ForwardSub/callArgInterference3.cs b/src/tests/JIT/opt/ForwardSub/callArgInterference3.cs index 7ecdb58982f15..488afab50b1ec 100644 --- a/src/tests/JIT/opt/ForwardSub/callArgInterference3.cs +++ b/src/tests/JIT/opt/ForwardSub/callArgInterference3.cs @@ -1,6 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2022-02-06 16:34:36 // Run on X86 Windows // Seed: 15345211054104247945 @@ -41,7 +42,8 @@ public class ForwardSubCallArgInterference3 public static byte s_6; public static S0[] s_10; public static S0[, ] s_20 = new S0[, ]{{new S0()}}; - public static int Main() + [Fact] + public static int TestEntryPoint() { s_rt = new C(); S0 vr2 = default(S0); @@ -49,11 +51,11 @@ public static int Main() return S0.s_result; } - public static void M8(S0 arg0, long arg1) + internal static void M8(S0 arg0, long arg1) { } - public static void M7(S0 argThis, uint[] arg0, ref byte arg1, ref S0[] arg2, int arg3) + internal static void M7(S0 argThis, uint[] arg0, ref byte arg1, ref S0[] arg2, int arg3) { } } diff --git a/src/tests/JIT/opt/ForwardSub/callArgInterference3.csproj b/src/tests/JIT/opt/ForwardSub/callArgInterference3.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/callArgInterference3.csproj +++ b/src/tests/JIT/opt/ForwardSub/callArgInterference3.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ForwardSub/earlyLiveness.cs b/src/tests/JIT/opt/ForwardSub/earlyLiveness.cs index 061bb041ef95e..5b54f295117e9 100644 --- a/src/tests/JIT/opt/ForwardSub/earlyLiveness.cs +++ b/src/tests/JIT/opt/ForwardSub/earlyLiveness.cs @@ -3,10 +3,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class EarlyLiveness_ForwardSub +public class EarlyLiveness_ForwardSub { - static int Main(string[] args) + [Fact] + public static int TestEntryPoint() { int result = 100; int test1 = Test1(); diff --git a/src/tests/JIT/opt/ForwardSub/earlyLiveness.csproj b/src/tests/JIT/opt/ForwardSub/earlyLiveness.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/earlyLiveness.csproj +++ b/src/tests/JIT/opt/ForwardSub/earlyLiveness.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.cs b/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.cs index 16f09d41a5f24..4cd0d65e3cc37 100644 --- a/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.cs +++ b/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.cs @@ -1,6 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2022-02-04 13:20:27 // Run on X64 Windows // Seed: 7242107031351932946 @@ -34,7 +35,8 @@ public class Program { public static S0 s_25 = new S0(new C0()); public static C1[] s_28; - public static int Main() + [Fact] + public static int TestEntryPoint() { int result = 100; s_28 = new C1[]{new C1(0)}; diff --git a/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.csproj b/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.csproj +++ b/src/tests/JIT/opt/ForwardSub/lowerContainCheckCompare.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ForwardSub/modOpt.cs b/src/tests/JIT/opt/ForwardSub/modOpt.cs index c1c2492715085..91e15ef445095 100644 --- a/src/tests/JIT/opt/ForwardSub/modOpt.cs +++ b/src/tests/JIT/opt/ForwardSub/modOpt.cs @@ -1,6 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2022-02-08 16:14:33 // Run on Arm64 Linux // Seed: 10380378818647712015 @@ -36,7 +37,8 @@ public class ForwardSubModOpt public static IRT s_rt; public static uint s_2; public static S0 s_8 = new S0(0, 1); - public static int Main() + [Fact] + public static int TestEntryPoint() { s_rt = new C(); S0 vr8 = default(S0); diff --git a/src/tests/JIT/opt/ForwardSub/modOpt.csproj b/src/tests/JIT/opt/ForwardSub/modOpt.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/modOpt.csproj +++ b/src/tests/JIT/opt/ForwardSub/modOpt.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ForwardSub/normalizeOnStore.il b/src/tests/JIT/opt/ForwardSub/normalizeOnStore.il index d92bb12492103..0d1944dffab7c 100644 --- a/src/tests/JIT/opt/ForwardSub/normalizeOnStore.il +++ b/src/tests/JIT/opt/ForwardSub/normalizeOnStore.il @@ -1,12 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -.assembly extern System.Runtime -{ - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 -} -.assembly store +.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } +.assembly extern xunit.core {} +.assembly normalizeOnStore { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) .custom instance void [System.Runtime]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx @@ -28,7 +25,6 @@ .hash algorithm 0x00008004 .ver 1:0:0:0 } -.module store.dll // MVID: {A3A2457C-4D44-404C-9480-A353C3DB86A4} .imagebase 0x00400000 .file alignment 0x00000200 @@ -40,7 +36,7 @@ // =============== CLASS MEMBERS DECLARATION =================== -.class private auto ansi beforefieldinit ForwardSubNormalizeOnStore +.class public auto ansi beforefieldinit ForwardSubNormalizeOnStore extends [System.Runtime]System.Object { .method private hidebysig static int32 @@ -57,6 +53,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 11 (0xb) .maxstack 8 diff --git a/src/tests/JIT/opt/ForwardSub/normalizeOnStore.ilproj b/src/tests/JIT/opt/ForwardSub/normalizeOnStore.ilproj index 477cccfe1def0..5416dc703fa32 100644 --- a/src/tests/JIT/opt/ForwardSub/normalizeOnStore.ilproj +++ b/src/tests/JIT/opt/ForwardSub/normalizeOnStore.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.cs b/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.cs index ebdd6850e360b..b67dc2fbb8046 100644 --- a/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.cs +++ b/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using Xunit; public class SwitchWithSideEffects { public struct S1 @@ -75,7 +76,7 @@ public uint Method40(out ulong p_ulong_1015, ref S1 p_s1_1016, ref S2 p_s2_1017, return 15|4; } } - public void Method0() + internal void Method0() { unchecked { @@ -87,7 +88,8 @@ public void Method0() return; } } - public static int Main() + [Fact] + public static int TestEntryPoint() { new SwitchWithSideEffects().Method0(); return 100; diff --git a/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.csproj b/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.csproj +++ b/src/tests/JIT/opt/ForwardSub/switchWithSideEffects.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.cs b/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.cs index b7b565a427b01..fb3b1bdbee66f 100644 --- a/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.cs +++ b/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.cs @@ -10,8 +10,9 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; -class CloningForIEnumerable +public class CloningForIEnumerable { [MethodImpl(MethodImplOptions.NoInlining)] public static int Sum(IEnumerable e) @@ -24,7 +25,8 @@ public static int Sum(IEnumerable e) return r; } - public static int Main() + [Fact] + public static int TestEntryPoint() { List list = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; diff --git a/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.csproj b/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.csproj index b148ee1c7b234..f2066253c8942 100644 --- a/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.csproj +++ b/src/tests/JIT/opt/GuardedDevirtualization/enumerablecloning.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.cs b/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.cs index c800c618c9ae4..48f52f40b534c 100644 --- a/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.cs +++ b/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.cs @@ -9,6 +9,7 @@ using System; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; interface I { @@ -25,10 +26,10 @@ class Mul : I int I.F(int x, int y) => x * y; } -class CloningForTypeTests +public class CloningForTypeTests { [MethodImpl(MethodImplOptions.NoInlining)] - public static int BothTypeAndArray(I m, int[] xs, int[] ys, int from, int to) + internal static int BothTypeAndArray(I m, int[] xs, int[] ys, int from, int to) { int r = 0; @@ -42,7 +43,7 @@ public static int BothTypeAndArray(I m, int[] xs, int[] ys, int from, int to) } [MethodImpl(MethodImplOptions.NoInlining)] - public static int JustType(I m, int from, int to) + internal static int JustType(I m, int from, int to) { int r = 0; @@ -55,7 +56,8 @@ public static int JustType(I m, int from, int to) return r; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] xs = new int[] { 1, 2, 3, 4 }; int[] ys = new int[] { 4, 3, 2, 1 }; diff --git a/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.csproj b/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.csproj index b148ee1c7b234..f2066253c8942 100644 --- a/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.csproj +++ b/src/tests/JIT/opt/GuardedDevirtualization/typetestcloning.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/Hoisting/Hoisting.cs b/src/tests/JIT/opt/Hoisting/Hoisting.cs index 3bb61b9fe6de2..586abba4d57f8 100644 --- a/src/tests/JIT/opt/Hoisting/Hoisting.cs +++ b/src/tests/JIT/opt/Hoisting/Hoisting.cs @@ -6,10 +6,12 @@ using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; using System.Runtime.Intrinsics.Arm; +using Xunit; -unsafe class Hoisting +public unsafe class Hoisting { - public static int Main() + [Fact] + public static int TestEntryPoint() { var p = stackalloc int[4]; p[0] = 1; diff --git a/src/tests/JIT/opt/Hoisting/Hoisting.csproj b/src/tests/JIT/opt/Hoisting/Hoisting.csproj index de62e29fa3e18..47508bb49d57b 100644 --- a/src/tests/JIT/opt/Hoisting/Hoisting.csproj +++ b/src/tests/JIT/opt/Hoisting/Hoisting.csproj @@ -1,6 +1,5 @@ - Exe true diff --git a/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il b/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il index cd3bc451edb61..e0e3ee3e3d4ac 100644 --- a/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il +++ b/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il @@ -32,12 +32,8 @@ ret } // end of method P::A1 - .method public hidebysig static int32 Main(string[] x) cil managed + .method public hidebysig static int32 Test(string[] x) cil managed noinlining { - .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( - 01 00 00 00 - ) - .entrypoint ldarg.0 ldlen dup @@ -51,4 +47,17 @@ ret } // end of method P::Main + .method public hidebysig static int32 Main() cil managed + { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) + .entrypoint + + ldc.i4.0 + newarr [mscorlib]System.String + call int32 P::Test(string[] x) + ret + } + } // end of class P diff --git a/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.ilproj b/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.ilproj index 971f2fc5e764e..2f0e6f024322e 100644 --- a/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.ilproj +++ b/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 true diff --git a/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.cs b/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.cs index ee3ff103e9d14..ba0d87dcd2f46 100644 --- a/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.cs +++ b/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace ConsoleApplication1 { - internal class Program + public class Program { - private static int Main() + [Fact] + public static int TestEntryPoint() { int result = 100; int byteCount = 0; diff --git a/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.csproj b/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.csproj index 07188377d0521..01dcdd4e75ecf 100644 --- a/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.csproj +++ b/src/tests/JIT/opt/Inline/regression/bug584219/inliningVars.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.cs b/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.cs index 23e9ca95602c7..5a0f17da2d3db 100644 --- a/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.cs +++ b/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; internal class Buffer { private byte[] _buffer; @@ -39,9 +40,10 @@ public void AdvanceToEnd() } -internal class Test_bug595776 +public class Test_bug595776 { - private static int Main() + [Fact] + public static int TestEntryPoint() { Buffer b1 = new Buffer("Abra-cadabra"); int result = 0; diff --git a/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.csproj b/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.csproj index ba46b8f2c5061..119ebcd1d21e1 100644 --- a/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.csproj +++ b/src/tests/JIT/opt/Inline/regression/bug595776/bug595776.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il b/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il index ae1ec6cb06a21..b4955ae0cc483 100644 --- a/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il +++ b/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il @@ -10,7 +10,7 @@ .assembly extern mscorlib {} .assembly extern xunit.core {} .assembly extern System.Console {} -.assembly extern System.Runtime {} +.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } .assembly 'mismatch32' {} .class public sealed F extends System.ValueType @@ -22,7 +22,6 @@ } .field public string A -} .method private static int32 B(int32 X, int32 Y) { @@ -35,7 +34,7 @@ .locals init (valuetype F v_0) newobj instance void F::.ctor() ldc.i4 33 - call int32 B(int32, int32) + call int32 F::B(int32, int32) pop } @@ -51,7 +50,7 @@ IL_0000: nop .try { - IL_0005: call void Test() + IL_0005: call void F::Test() IL_000c: leave.s IL_0015 } // end .try catch [System.Runtime]System.InvalidProgramException @@ -68,3 +67,4 @@ IL_001a: ldloc.0 IL_001b: ret } +} \ No newline at end of file diff --git a/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.ilproj b/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.ilproj index 32358eee9cb95..50bf17d8e5d8e 100644 --- a/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.ilproj +++ b/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.ilproj @@ -1,6 +1,5 @@ - Exe true 1 diff --git a/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il b/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il index 1d71ad6375029..bee6db1652dac 100644 --- a/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il +++ b/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il @@ -10,7 +10,7 @@ .assembly extern mscorlib {} .assembly extern xunit.core {} .assembly extern System.Console {} -.assembly extern System.Runtime {} +.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } .assembly 'mismatch64' {} .class public sealed F extends System.ValueType @@ -22,7 +22,6 @@ } .field public string A -} .method private static int64 B(int64 X, int64 Y) cil managed { @@ -35,7 +34,7 @@ .locals init (valuetype F v_0) newobj instance void F::.ctor() ldc.i8 44 - call int64 B(int64, int64) + call int64 F::B(int64, int64) pop } @@ -51,7 +50,7 @@ IL_0000: nop .try { - IL_0005: call void Test() + IL_0005: call void F::Test() IL_000c: leave.s IL_0015 } // end .try catch [System.Runtime]System.InvalidProgramException @@ -68,3 +67,4 @@ IL_001a: ldloc.0 IL_001b: ret } +} diff --git a/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.ilproj b/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.ilproj index 32358eee9cb95..50bf17d8e5d8e 100644 --- a/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.ilproj +++ b/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.ilproj @@ -1,6 +1,5 @@ - Exe true 1 diff --git a/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.cs b/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.cs index 2851a40a5f351..c080904d9f1a5 100644 --- a/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.cs +++ b/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; internal struct Foo { @@ -16,7 +17,8 @@ private static int StructTaker_Inline(Foo FooStruct) array[0].x = 3; return array[0].x; } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.csproj b/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.csproj index ebf937776be1b..39e5d72fbcbe9 100644 --- a/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.csproj +++ b/src/tests/JIT/opt/Inline/tests/ArrayOfStructs.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.cs b/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.cs index 1701f6246a084..1b8ed100fb80a 100644 --- a/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.cs +++ b/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.cs @@ -2,8 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; -internal class Test_DelegInstanceFtn +public class Test_DelegInstanceFtn { private delegate object MyDeleg(string s); @@ -15,7 +16,8 @@ private object f2(string s) return 1; } - public static int Main() + [Fact] + public static int TestEntryPoint() { Test_DelegInstanceFtn t = new Test_DelegInstanceFtn(); MyDeleg d2 = new MyDeleg(t.f2); diff --git a/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.csproj b/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.csproj index 4eca7203211a4..3c5310591305e 100644 --- a/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.csproj +++ b/src/tests/JIT/opt/Inline/tests/DelegInstanceFtn.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.cs b/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.cs index dca0fd06c8a5f..6ac1585e4ac64 100644 --- a/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.cs +++ b/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.cs @@ -2,8 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; -internal class Test_DelegStaticFtn +public class Test_DelegStaticFtn { private delegate object MyDeleg(string s); @@ -15,7 +16,8 @@ private static object f1(string s) return 1; } - public static int Main() + [Fact] + public static int TestEntryPoint() { MyDeleg d1 = new MyDeleg(f1); return Convert.ToInt32(d1("test1")); diff --git a/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.csproj b/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.csproj index ab03bd7c5fda0..4338f8ce69d55 100644 --- a/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.csproj +++ b/src/tests/JIT/opt/Inline/tests/DelegStaticFtn.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/GenericStructs.cs b/src/tests/JIT/opt/Inline/tests/GenericStructs.cs index d1daaa91ee671..39b5859479624 100644 --- a/src/tests/JIT/opt/Inline/tests/GenericStructs.cs +++ b/src/tests/JIT/opt/Inline/tests/GenericStructs.cs @@ -4,6 +4,7 @@ //This test is used to check whether a method that takes a generic struct is inlined. using System; +using Xunit; internal struct XY { private T _x; @@ -28,14 +29,15 @@ public T Y } } -internal class StructTest +public class StructTest { private static void XYZ_Inline(XY xy) { xy.X = 10; xy.Y = 20; } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/GenericStructs.csproj b/src/tests/JIT/opt/Inline/tests/GenericStructs.csproj index 1145384fba99e..30ee603e329f4 100644 --- a/src/tests/JIT/opt/Inline/tests/GenericStructs.csproj +++ b/src/tests/JIT/opt/Inline/tests/GenericStructs.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline.cs b/src/tests/JIT/opt/Inline/tests/Inline.cs index 6c40d85b51b29..b3c4e77111b3f 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { private static int s_c = 1; @@ -23,7 +24,8 @@ public static int Foo_Inline(int v) return ret; } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/Inline.csproj b/src/tests/JIT/opt/Inline/tests/Inline.csproj index 943c1bfd57e9d..872890f85a8b5 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/InlineThrow.csproj b/src/tests/JIT/opt/Inline/tests/InlineThrow.csproj index 6313c4eaa2f61..d005333a98b81 100644 --- a/src/tests/JIT/opt/Inline/tests/InlineThrow.csproj +++ b/src/tests/JIT/opt/Inline/tests/InlineThrow.csproj @@ -1,7 +1,4 @@ - - Exe - None diff --git a/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.cs b/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.cs index 5f9eacb01da93..7ed966eceb3d2 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.cs @@ -2,13 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public struct TestStruct { public int f1; public int f2; } -internal class DelegateStruct +public class DelegateStruct { private delegate TestStruct DelSt(TestStruct st, int x); @@ -19,7 +20,8 @@ private TestStruct DelMethod_Inline(TestStruct st, int x) return st; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int iret = 100; DelegateStruct ds = new DelegateStruct(); diff --git a/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.csproj b/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.csproj index 42566e71011f4..ae94367e8e651 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_DelegateStruct.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.cs b/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.cs index 30ef1f718d6b0..9ff7e82c0d1eb 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.cs @@ -16,6 +16,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { @@ -23,7 +24,8 @@ public class Program internal static ulong[, ] s_3; internal static byte s_7; internal static ulong[] s_16; - public static int Main() + [Fact] + public static int TestEntryPoint() { try { @@ -36,7 +38,7 @@ public static int Main() return 101; } - public static void Foo(object o) + internal static void Foo(object o) { s_rt = o; var vr3 = new sbyte[]{0}; diff --git a/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.csproj b/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.csproj index abdd0ab242269..a0f449e7a09a9 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_DetectChanges.csproj @@ -1,6 +1,5 @@ - Exe None True diff --git a/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.cs b/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.cs index a14a2dd74197d..5732504d6ef06 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.cs @@ -4,17 +4,19 @@ using System; using System.Collections.Generic; using System.Text; +using Xunit; namespace Inline_GenericMethods { - internal class Inline_GenericMethods + public class Inline_GenericMethods { - public static void GetType_NoInline() + internal static void GetType_NoInline() { Console.WriteLine(typeof(T)); } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.csproj b/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.csproj index bcc81d90529c1..37d279645265d 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_GenericMethods.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_Many.cs b/src/tests/JIT/opt/Inline/tests/Inline_Many.cs index d4c0dd06e81d7..fe83401a6c29f 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_Many.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_Many.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { private static int s_c = 1; @@ -42,7 +43,8 @@ public static int TestNewInline_A_Inline(int v) return ret; } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/Inline_Many.csproj b/src/tests/JIT/opt/Inline/tests/Inline_Many.csproj index 53dac08be5c5b..2a0f921da7354 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_Many.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_Many.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.cs b/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.cs index d179ec62adff4..c920e79f9970c 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { private static int s_s = 1; @@ -68,7 +69,8 @@ public static int Method_QMark_Inline(int i) return v; } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.csproj b/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.csproj index d6864f3fa6c90..3b07d5f1c9cd9 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_MultipleReturn.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs b/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs index 1d5ddd3752551..ad0a2233660c7 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp_Inline +public class MainApp_Inline { private int _v; @@ -34,7 +35,8 @@ public MainApp_Inline(int i) } } - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine(new MainApp_Inline(800)._v); try diff --git a/src/tests/JIT/opt/Inline/tests/Inline_NewObj.csproj b/src/tests/JIT/opt/Inline/tests/Inline_NewObj.csproj index eb47d3a44ecf4..80e4085d6f9a1 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_NewObj.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_NewObj.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.cs b/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.cs index f5d7ea82d89ec..3a8fdfd56fd45 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { private static int s_a = 0; @@ -14,7 +15,8 @@ public static bool Foo_Inline(bool b) return b; } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.csproj b/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.csproj index f8d20fa766adf..fca563c19d5aa 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_NormalizeStack.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_Recursion.cs b/src/tests/JIT/opt/Inline/tests/Inline_Recursion.cs index 4a9c9e73546bb..91e9c7e32630e 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_Recursion.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_Recursion.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { private static int s_s1 = 10; private static int s_s2 = 5; @@ -34,7 +35,8 @@ public static int A(int v) return ret; } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/Inline_Recursion.csproj b/src/tests/JIT/opt/Inline/tests/Inline_Recursion.csproj index d66b2dbe04de9..01873ce544b83 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_Recursion.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_Recursion.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.cs b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.cs index ac6e54a1e1c32..68cb160fef172 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public struct TestStruct { @@ -20,7 +21,8 @@ public static TestStruct RecursiveMethod_Inline(TestStruct teststruct, int c) } return teststruct; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int iret = 100; TestStruct ts; diff --git a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.csproj b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.csproj index 83cdc5840bc5d..e0033f461bb7e 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.cs b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.cs index 3c85b4743d7c6..3f6b46a7bc0cc 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public struct TestStruct { @@ -20,7 +21,8 @@ public static TestStruct RecursiveMethod_Inline(TestStruct teststruct, int c) } return teststruct; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int iret = 100; TestStruct ts; diff --git a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.csproj b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.csproj index cfff195d8528e..d251b5d642039 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_RecursiveMethod21.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_STARG.cs b/src/tests/JIT/opt/Inline/tests/Inline_STARG.cs index 7d51799cd1c89..e1231c677b724 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_STARG.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_STARG.cs @@ -3,17 +3,19 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { - public static void Foo_NoInline(string s) + internal static void Foo_NoInline(string s) { Console.WriteLine(s); s = "New string"; Console.WriteLine(s); } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/Inline_STARG.csproj b/src/tests/JIT/opt/Inline/tests/Inline_STARG.csproj index af192f3a46dd0..24b5658f9af6e 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_STARG.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_STARG.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.cs b/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.cs index b754a635a2d94..58900172e7dbb 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.cs @@ -4,10 +4,11 @@ using System; using System.Collections.Generic; using System.Text; +using Xunit; namespace Inline_SideAffects { - internal class Inline_SideAffects + public class Inline_SideAffects { private static int s_i = 0; private static bool Foo_Inline() @@ -22,7 +23,8 @@ private static bool Bar_Inline() s_i += 3; return false; } - private static int Main() + [Fact] + public static int TestEntryPoint() { if ((Foo_Inline()) && (Bar_Inline())) { diff --git a/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.csproj b/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.csproj index 0b01b9b124286..3c6271c222617 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_SideAffects.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_Vars.cs b/src/tests/JIT/opt/Inline/tests/Inline_Vars.cs index 8ede8b28afdd9..9690e4148c5ce 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_Vars.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_Vars.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using Xunit; #pragma warning disable 219 public class Test_Inline_Vars @@ -2815,7 +2816,8 @@ public int RunTest400_NoInline() Console.WriteLine(a400); return 100; } - private static int Main() + [Fact] + public static int TestEntryPoint() { (new Test_Inline_Vars()).RunTest0_Inline(); diff --git a/src/tests/JIT/opt/Inline/tests/Inline_Vars.csproj b/src/tests/JIT/opt/Inline/tests/Inline_Vars.csproj index d4b6acdf549ae..36a332856c53b 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_Vars.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_Vars.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inline_handler.cs b/src/tests/JIT/opt/Inline/tests/Inline_handler.cs index 6d2760461209e..3114c1c5244e0 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_handler.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_handler.cs @@ -3,30 +3,32 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { - public static void PrintA_NoInline() + internal static void PrintA_NoInline() { Console.WriteLine("A_NoInline"); throw new Exception("throw in method PrintA_Inline"); } - public static void PrintA_Inline() + internal static void PrintA_Inline() { Console.WriteLine("A"); } - public static void PrintB_Inline() + internal static void PrintB_Inline() { Console.WriteLine("B"); } - public static void PrintC_Inline() + internal static void PrintC_Inline() { Console.WriteLine("C"); } - public static int Main() + [Fact] + public static int TestEntryPoint() { int retval = 101; try diff --git a/src/tests/JIT/opt/Inline/tests/Inline_handler.csproj b/src/tests/JIT/opt/Inline/tests/Inline_handler.csproj index f8ab374c1f44a..06addf13c2479 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_handler.csproj +++ b/src/tests/JIT/opt/Inline/tests/Inline_handler.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/Inlinethrow.cs b/src/tests/JIT/opt/Inline/tests/Inlinethrow.cs index ce0d33fdb94a2..baa1ab08a0a18 100644 --- a/src/tests/JIT/opt/Inline/tests/Inlinethrow.cs +++ b/src/tests/JIT/opt/Inline/tests/Inlinethrow.cs @@ -3,18 +3,19 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -internal class MainApp +public class MainApp { private static int s_s = 0; - public static void MethodThatAlwaysThrows_NoInline() + internal static void MethodThatAlwaysThrows_NoInline() { Console.WriteLine("In method that always throws"); throw new Exception("methodthatalwaysthrows"); } - public static void MethodThatMightThrow_Inline() + internal static void MethodThatMightThrow_Inline() { if (s_s == 1) { @@ -22,7 +23,8 @@ public static void MethodThatMightThrow_Inline() } } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/LotsOfInlines.cs b/src/tests/JIT/opt/Inline/tests/LotsOfInlines.cs index d244cfe7a5187..0aebaa4865426 100644 --- a/src/tests/JIT/opt/Inline/tests/LotsOfInlines.cs +++ b/src/tests/JIT/opt/Inline/tests/LotsOfInlines.cs @@ -4,12 +4,14 @@ // Thanks to Alexander Speshilov (spechuric @ github). using System; +using Xunit; namespace Repro { public class Program { - public static int Main() + [Fact] + public static int TestEntryPoint() { Tst a = new Tst(); a.f30(); diff --git a/src/tests/JIT/opt/Inline/tests/LotsOfInlines.csproj b/src/tests/JIT/opt/Inline/tests/LotsOfInlines.csproj index e5938af6f6406..38d994d57c57f 100644 --- a/src/tests/JIT/opt/Inline/tests/LotsOfInlines.csproj +++ b/src/tests/JIT/opt/Inline/tests/LotsOfInlines.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.cs b/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.cs index 4519d85baf57d..8eeec3cad943e 100644 --- a/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.cs +++ b/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public struct MyStruct { @@ -16,7 +17,8 @@ public static MyStruct MakeString_Inline(string st) public class ReturnStruct { - public static int Main() + [Fact] + public static int TestEntryPoint() { int iret = 100; MyStruct st = MyStruct.MakeString_Inline("Hello!"); diff --git a/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.csproj b/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.csproj index df7a544e29ff4..93e55f0259596 100644 --- a/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.csproj +++ b/src/tests/JIT/opt/Inline/tests/ReturnStruct_Method.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.cs b/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.cs index 28c313523c74f..30bd2ab2c301f 100644 --- a/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.cs +++ b/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Text; +using Xunit; namespace ConsoleApplication1 { @@ -12,14 +13,15 @@ internal struct TheStruct public string fieldinStruct; } - internal class TestStruct + public class TestStruct { private static void StructTaker_Inline(TheStruct s) { s.fieldinStruct = "xyz"; } - private static int Main() + [Fact] + public static int TestEntryPoint() { TheStruct testStruct = new TheStruct(); diff --git a/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.csproj b/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.csproj index c432ef7bca149..d9f1c8ba38c1c 100644 --- a/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.csproj +++ b/src/tests/JIT/opt/Inline/tests/StructAsParam_Method.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/StructInClass.cs b/src/tests/JIT/opt/Inline/tests/StructInClass.cs index 013c407d2cfc6..751430011db63 100644 --- a/src/tests/JIT/opt/Inline/tests/StructInClass.cs +++ b/src/tests/JIT/opt/Inline/tests/StructInClass.cs @@ -4,13 +4,14 @@ using System; using System.Collections.Generic; using System.Text; +using Xunit; namespace StructInClass { internal class StructInClass { } - internal class TestClass + public class TestClass { public struct TheStruct { @@ -22,7 +23,8 @@ private static void StructTaker_Inline(TheStruct Struct) Struct.fieldinStruct = "xyz"; } - private static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/Inline/tests/StructInClass.csproj b/src/tests/JIT/opt/Inline/tests/StructInClass.csproj index aa73f80ed1e9e..dd9de59658ee2 100644 --- a/src/tests/JIT/opt/Inline/tests/StructInClass.csproj +++ b/src/tests/JIT/opt/Inline/tests/StructInClass.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.cs b/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.cs index f70244bd7dcf5..7f02609470452 100644 --- a/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.cs +++ b/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.cs @@ -3,12 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class Test_UnsafeBlockCopy +public class Test_UnsafeBlockCopy { static int SIZE = 100; - public static unsafe int Main() + [Fact] + public static unsafe int TestEntryPoint() { byte* source = stackalloc byte[SIZE]; byte* dest = stackalloc byte[SIZE]; diff --git a/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.csproj b/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.csproj index 85dc5f2beea7b..2bec71401967b 100644 --- a/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.csproj +++ b/src/tests/JIT/opt/Inline/tests/UnsafeBlockCopy.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/args1.cs b/src/tests/JIT/opt/Inline/tests/args1.cs index ab917f8e59149..6207c77ad522a 100644 --- a/src/tests/JIT/opt/Inline/tests/args1.cs +++ b/src/tests/JIT/opt/Inline/tests/args1.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { - internal class Args1 + public class Args1 { private static string f1a(bool a) { return a.ToString(); } private static string f1c(ref bool a) { return a.ToString(); } @@ -65,7 +66,8 @@ internal class Args1 - public static int Main() + [Fact] + public static int TestEntryPoint() { f1a(true); f2a('A'); diff --git a/src/tests/JIT/opt/Inline/tests/args1.csproj b/src/tests/JIT/opt/Inline/tests/args1.csproj index 8db166c372191..df6c2dd71e2ef 100644 --- a/src/tests/JIT/opt/Inline/tests/args1.csproj +++ b/src/tests/JIT/opt/Inline/tests/args1.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/args2.cs b/src/tests/JIT/opt/Inline/tests/args2.cs index 7289f541bad03..574c4e1009afd 100644 --- a/src/tests/JIT/opt/Inline/tests/args2.cs +++ b/src/tests/JIT/opt/Inline/tests/args2.cs @@ -2,17 +2,19 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { - internal class Args2 + public class Args2 { - static public void FillArray(out int[] myArray) + static internal void FillArray(out int[] myArray) { myArray = new int[5] { 1, 2, 3, 4, 5 }; } - static public int Main() + [Fact] + static public int TestEntryPoint() { int retval = 85; int[] myArray; diff --git a/src/tests/JIT/opt/Inline/tests/args2.csproj b/src/tests/JIT/opt/Inline/tests/args2.csproj index 996ee94edb599..fb00610cb0ce0 100644 --- a/src/tests/JIT/opt/Inline/tests/args2.csproj +++ b/src/tests/JIT/opt/Inline/tests/args2.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/args3.cs b/src/tests/JIT/opt/Inline/tests/args3.cs index 727783c55210d..8bc1c461aeb7c 100644 --- a/src/tests/JIT/opt/Inline/tests/args3.cs +++ b/src/tests/JIT/opt/Inline/tests/args3.cs @@ -2,12 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { - internal class Args3 + public class Args3 { - public static void FillArray(ref int[] arr) + internal static void FillArray(ref int[] arr) { if (arr == null) arr = new int[10]; @@ -15,7 +16,8 @@ public static void FillArray(ref int[] arr) arr[4] = 1024; } - static public int Main() + [Fact] + static public int TestEntryPoint() { int retval = -1056; int[] myArray = { 1, 2, 3, 4, 5 }; diff --git a/src/tests/JIT/opt/Inline/tests/args3.csproj b/src/tests/JIT/opt/Inline/tests/args3.csproj index ed02d4d4a90ba..0f718444a8cad 100644 --- a/src/tests/JIT/opt/Inline/tests/args3.csproj +++ b/src/tests/JIT/opt/Inline/tests/args3.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/array.cs b/src/tests/JIT/opt/Inline/tests/array.cs index 5f062adfa8fce..72b29de047261 100644 --- a/src/tests/JIT/opt/Inline/tests/array.cs +++ b/src/tests/JIT/opt/Inline/tests/array.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { public class array { - public static int Main() + [Fact] + public static int TestEntryPoint() { String s = ""; diff --git a/src/tests/JIT/opt/Inline/tests/array.csproj b/src/tests/JIT/opt/Inline/tests/array.csproj index 3bd9bc2fcf06f..de6a0e98dc37a 100644 --- a/src/tests/JIT/opt/Inline/tests/array.csproj +++ b/src/tests/JIT/opt/Inline/tests/array.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/calli.il b/src/tests/JIT/opt/Inline/tests/calli.il index ca5e422f1b32b..b36a56cbf5306 100644 --- a/src/tests/JIT/opt/Inline/tests/calli.il +++ b/src/tests/JIT/opt/Inline/tests/calli.il @@ -7,7 +7,7 @@ .assembly extern xunit.core {} .assembly legacy library 'calli' {} -.class private auto ansi beforefieldinit calli_test +.class public auto ansi beforefieldinit calli_test extends [mscorlib]System.Object { .field private static int32 a diff --git a/src/tests/JIT/opt/Inline/tests/calli.ilproj b/src/tests/JIT/opt/Inline/tests/calli.ilproj index 161e4cc805b11..c7ff4389ada7b 100644 --- a/src/tests/JIT/opt/Inline/tests/calli.ilproj +++ b/src/tests/JIT/opt/Inline/tests/calli.ilproj @@ -1,6 +1,5 @@ - Exe true diff --git a/src/tests/JIT/opt/Inline/tests/debug.cs b/src/tests/JIT/opt/Inline/tests/debug.cs index ec174825ce61e..c92eeaee6f9a6 100644 --- a/src/tests/JIT/opt/Inline/tests/debug.cs +++ b/src/tests/JIT/opt/Inline/tests/debug.cs @@ -4,6 +4,7 @@ // Getter and Setter, simple, compiled debug+, both should NOT be inlined. using System; +using Xunit; public class A { private int _prop; @@ -13,9 +14,10 @@ public int prop set { _prop = value; } } } -internal class debug +public class debug { - public static int Main() + [Fact] + public static int TestEntryPoint() { A a = new A(); a.prop = 100; diff --git a/src/tests/JIT/opt/Inline/tests/debug.csproj b/src/tests/JIT/opt/Inline/tests/debug.csproj index 9f7d2c94d7961..9526be447574f 100644 --- a/src/tests/JIT/opt/Inline/tests/debug.csproj +++ b/src/tests/JIT/opt/Inline/tests/debug.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/deepcall.cs b/src/tests/JIT/opt/Inline/tests/deepcall.cs index 16ecdadd4b04a..b1d5df6a1ffe9 100644 --- a/src/tests/JIT/opt/Inline/tests/deepcall.cs +++ b/src/tests/JIT/opt/Inline/tests/deepcall.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { - internal class DeepCall + public class DeepCall { private static long f1() { return 1; } private static long f2() { return f1() + 1; } @@ -107,7 +108,8 @@ internal class DeepCall private static long f98() { return f97() + 1; } private static long f99() { return f98() + 1; } private static long f100() { return f99() + 1; } - public static int Main() + [Fact] + public static int TestEntryPoint() { return (int)f100(); } diff --git a/src/tests/JIT/opt/Inline/tests/deepcall.csproj b/src/tests/JIT/opt/Inline/tests/deepcall.csproj index 3c710a4a51292..600f24d6ef391 100644 --- a/src/tests/JIT/opt/Inline/tests/deepcall.csproj +++ b/src/tests/JIT/opt/Inline/tests/deepcall.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/fact.cs b/src/tests/JIT/opt/Inline/tests/fact.cs index 03c2df8c187c8..1b63c848e7ab5 100644 --- a/src/tests/JIT/opt/Inline/tests/fact.cs +++ b/src/tests/JIT/opt/Inline/tests/fact.cs @@ -2,8 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; -class Fact { +public class Fact { static int factTR(int n, int a) { if (n <= 1) return a; return factTR(n - 1, a * n); @@ -23,7 +24,8 @@ static int factRx(int n, int a = 0, int b = 0, int c = 0) { return n * factRx(n - 1, a, b, c); } - public static int Main() { + [Fact] + public static int TestEntryPoint() { int resultTR = fact(6); int resultR = factR(6); int resultRx = factRx(6); diff --git a/src/tests/JIT/opt/Inline/tests/fact.csproj b/src/tests/JIT/opt/Inline/tests/fact.csproj index d055ef04fd38d..8d0255013234a 100644 --- a/src/tests/JIT/opt/Inline/tests/fact.csproj +++ b/src/tests/JIT/opt/Inline/tests/fact.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/ifelse.cs b/src/tests/JIT/opt/Inline/tests/ifelse.cs index 3596f7fc0cbe4..a4f980e6335d0 100644 --- a/src/tests/JIT/opt/Inline/tests/ifelse.cs +++ b/src/tests/JIT/opt/Inline/tests/ifelse.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { @@ -25,9 +26,10 @@ public int prop } } } - internal class IfElse + public class IfElse { - public static int Main() + [Fact] + public static int TestEntryPoint() { A a = new A(); a.prop = 1; diff --git a/src/tests/JIT/opt/Inline/tests/ifelse.csproj b/src/tests/JIT/opt/Inline/tests/ifelse.csproj index af40d82db1281..7709cd7d9b8b2 100644 --- a/src/tests/JIT/opt/Inline/tests/ifelse.csproj +++ b/src/tests/JIT/opt/Inline/tests/ifelse.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/indexer.cs b/src/tests/JIT/opt/Inline/tests/indexer.cs index 8062333dde49f..926221e6121b5 100644 --- a/src/tests/JIT/opt/Inline/tests/indexer.cs +++ b/src/tests/JIT/opt/Inline/tests/indexer.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { @@ -27,7 +28,8 @@ public int this[int index] public class Indexer { - public static int Main() + [Fact] + public static int TestEntryPoint() { int a = -1; IndexerClass b = new IndexerClass(); diff --git a/src/tests/JIT/opt/Inline/tests/indexer.csproj b/src/tests/JIT/opt/Inline/tests/indexer.csproj index efe0b199c7778..c4dab6da26b92 100644 --- a/src/tests/JIT/opt/Inline/tests/indexer.csproj +++ b/src/tests/JIT/opt/Inline/tests/indexer.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/interfaceCall.cs b/src/tests/JIT/opt/Inline/tests/interfaceCall.cs index d736b42665714..4f9857e0cbe22 100644 --- a/src/tests/JIT/opt/Inline/tests/interfaceCall.cs +++ b/src/tests/JIT/opt/Inline/tests/interfaceCall.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; namespace JitInliningTest { internal interface IDimensions @@ -37,9 +38,10 @@ float IDimensions.Width() } } - internal class InterfaceCall + public class InterfaceCall { - public static int Main() + [Fact] + public static int TestEntryPoint() { Box myBox = new Box(30.0f, 20.0f); IDimensions myDimensions = (IDimensions)myBox; diff --git a/src/tests/JIT/opt/Inline/tests/interfaceCall.csproj b/src/tests/JIT/opt/Inline/tests/interfaceCall.csproj index 9f004cf8ab5ed..bba523a071259 100644 --- a/src/tests/JIT/opt/Inline/tests/interfaceCall.csproj +++ b/src/tests/JIT/opt/Inline/tests/interfaceCall.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/interfaceProperty.cs b/src/tests/JIT/opt/Inline/tests/interfaceProperty.cs index 5ef57d734af62..6c8b0c04a8b1d 100644 --- a/src/tests/JIT/opt/Inline/tests/interfaceProperty.cs +++ b/src/tests/JIT/opt/Inline/tests/interfaceProperty.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { @@ -50,7 +51,8 @@ public Employee() public class interfaceProperty { - public static int Main() + [Fact] + public static int TestEntryPoint() { Employee.numberOfEmployees = 1; Employee e1 = new Employee(); diff --git a/src/tests/JIT/opt/Inline/tests/interfaceproperty.csproj b/src/tests/JIT/opt/Inline/tests/interfaceproperty.csproj index a3ed07dc11873..9fc0dc54f6c1e 100644 --- a/src/tests/JIT/opt/Inline/tests/interfaceproperty.csproj +++ b/src/tests/JIT/opt/Inline/tests/interfaceproperty.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/mathfunc.cs b/src/tests/JIT/opt/Inline/tests/mathfunc.cs index f7c077174152d..2bc636ac21a9c 100644 --- a/src/tests/JIT/opt/Inline/tests/mathfunc.cs +++ b/src/tests/JIT/opt/Inline/tests/mathfunc.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace JitInliningTest { - internal class MathFunc + public class MathFunc { public const int DefaultSeed = 20010415; public static int Seed = Environment.GetEnvironmentVariable("CORECLR_SEED") switch @@ -15,7 +16,8 @@ string seedStr when int.TryParse(seedStr, out int envSeed) => envSeed, _ => DefaultSeed }; - public static int Main() + [Fact] + public static int TestEntryPoint() { Random r = new Random(Seed); diff --git a/src/tests/JIT/opt/Inline/tests/mathfunc.csproj b/src/tests/JIT/opt/Inline/tests/mathfunc.csproj index b4e967707b172..69e9a41a29aad 100644 --- a/src/tests/JIT/opt/Inline/tests/mathfunc.csproj +++ b/src/tests/JIT/opt/Inline/tests/mathfunc.csproj @@ -1,7 +1,4 @@ - - Exe - None diff --git a/src/tests/JIT/opt/Inline/tests/mthdimpl.cs b/src/tests/JIT/opt/Inline/tests/mthdimpl.cs index fa9f1bd22b767..6d41ce56c7e06 100644 --- a/src/tests/JIT/opt/Inline/tests/mthdimpl.cs +++ b/src/tests/JIT/opt/Inline/tests/mthdimpl.cs @@ -3,7 +3,8 @@ using System; using System.Runtime.CompilerServices; -internal class MthdImpl +using Xunit; +public class MthdImpl { [MethodImplAttribute(MethodImplOptions.NoInlining)] public static int f(int a) @@ -11,7 +12,8 @@ public static int f(int a) return a + 3; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int retval = f(97); return retval; diff --git a/src/tests/JIT/opt/Inline/tests/mthdimpl.csproj b/src/tests/JIT/opt/Inline/tests/mthdimpl.csproj index b46b45eadce31..faaa51bbef318 100644 --- a/src/tests/JIT/opt/Inline/tests/mthdimpl.csproj +++ b/src/tests/JIT/opt/Inline/tests/mthdimpl.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/property.cs b/src/tests/JIT/opt/Inline/tests/property.cs index e63d64fa25fa4..e49e58fe982d8 100644 --- a/src/tests/JIT/opt/Inline/tests/property.cs +++ b/src/tests/JIT/opt/Inline/tests/property.cs @@ -4,6 +4,7 @@ // Getter and Setter, simple, both should be inlined. using System; +using Xunit; public class A { private int _prop; @@ -13,9 +14,10 @@ public int prop set { _prop = value; } } } -internal class Property +public class Property { - public static int Main() + [Fact] + public static int TestEntryPoint() { A a = new A(); a.prop = 100; diff --git a/src/tests/JIT/opt/Inline/tests/property.csproj b/src/tests/JIT/opt/Inline/tests/property.csproj index 8e37bb6acb81b..a1d710d171927 100644 --- a/src/tests/JIT/opt/Inline/tests/property.csproj +++ b/src/tests/JIT/opt/Inline/tests/property.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/size.cs b/src/tests/JIT/opt/Inline/tests/size.cs index af3b643af2893..bf9bf1b82d6fd 100644 --- a/src/tests/JIT/opt/Inline/tests/size.cs +++ b/src/tests/JIT/opt/Inline/tests/size.cs @@ -4,6 +4,7 @@ // Setter 34 bytes il (inlined), Getter 36 bytes il (not-inlined) using System; +using Xunit; namespace JitInliningTest { @@ -16,9 +17,10 @@ public int prop set { _prop = value * value + (value + 1) * (value - 1) - (value + 2) * (value - 2) + (value + 3) * (value - 3); } } } - internal class PropTest + public class PropTest { - public static int Main() + [Fact] + public static int TestEntryPoint() { A a = new A(); a.prop = 1; diff --git a/src/tests/JIT/opt/Inline/tests/size.csproj b/src/tests/JIT/opt/Inline/tests/size.csproj index 72d38e9a34853..565e3971d6494 100644 --- a/src/tests/JIT/opt/Inline/tests/size.csproj +++ b/src/tests/JIT/opt/Inline/tests/size.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/struct_opcodes.cs b/src/tests/JIT/opt/Inline/tests/struct_opcodes.cs index 595c5cdc99b4b..21b16b2a37202 100644 --- a/src/tests/JIT/opt/Inline/tests/struct_opcodes.cs +++ b/src/tests/JIT/opt/Inline/tests/struct_opcodes.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; internal struct SimpleStruct { @@ -25,9 +26,9 @@ public class SingleInt public int i1; } -internal class TestStruct +public class TestStruct { - public static SimpleStruct aMethod_Inline(SimpleStruct Struct) + internal static SimpleStruct aMethod_Inline(SimpleStruct Struct) { Struct.i = 10; Struct.str = "abc"; @@ -36,7 +37,7 @@ public static SimpleStruct aMethod_Inline(SimpleStruct Struct) return Struct; } - public static newStruct bMethod_Inline() + internal static newStruct bMethod_Inline() { newStruct nStruct; nStruct.S.i = 1; @@ -47,7 +48,7 @@ public static newStruct bMethod_Inline() return nStruct; } - public static newStruct cMethod_Inline() + internal static newStruct cMethod_Inline() { newStruct nStruct; nStruct.S.i = 1; @@ -55,13 +56,14 @@ public static newStruct cMethod_Inline() return nStruct; } - public static void dMethod_Inline() + internal static void dMethod_Inline() { X x; x.f = new SingleInt(); x.f.i1 = 77; } - public static int Main() + [Fact] + public static int TestEntryPoint() { SimpleStruct st; newStruct newst; diff --git a/src/tests/JIT/opt/Inline/tests/struct_opcodes.csproj b/src/tests/JIT/opt/Inline/tests/struct_opcodes.csproj index d350a83373dbe..59f912d4eb4d2 100644 --- a/src/tests/JIT/opt/Inline/tests/struct_opcodes.csproj +++ b/src/tests/JIT/opt/Inline/tests/struct_opcodes.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/throwTest.cs b/src/tests/JIT/opt/Inline/tests/throwTest.cs index 95ffd77b7e82e..f3c3348c5756f 100644 --- a/src/tests/JIT/opt/Inline/tests/throwTest.cs +++ b/src/tests/JIT/opt/Inline/tests/throwTest.cs @@ -4,6 +4,7 @@ // Getter and Setter: throw using System; +using Xunit; namespace JitInliningTest { @@ -26,9 +27,10 @@ public int prop } } } - internal class throwTest + public class throwTest { - public static int Main() + [Fact] + public static int TestEntryPoint() { A a = new A(); a.prop = 100; diff --git a/src/tests/JIT/opt/Inline/tests/throwtest.csproj b/src/tests/JIT/opt/Inline/tests/throwtest.csproj index 12eec7f8cbcd1..a79d2ee9187b7 100644 --- a/src/tests/JIT/opt/Inline/tests/throwtest.csproj +++ b/src/tests/JIT/opt/Inline/tests/throwtest.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Inline/tests/trycatch.cs b/src/tests/JIT/opt/Inline/tests/trycatch.cs index 1493ed3d4051c..edcd8ea346432 100644 --- a/src/tests/JIT/opt/Inline/tests/trycatch.cs +++ b/src/tests/JIT/opt/Inline/tests/trycatch.cs @@ -4,6 +4,7 @@ // Getter and Setter: SEH using System; +using Xunit; namespace JitInliningTest { @@ -24,9 +25,10 @@ public int prop } } } - internal class PropTest5 + public class PropTest5 { - public static int Main() + [Fact] + public static int TestEntryPoint() { A a = new A(); a.prop = 100; diff --git a/src/tests/JIT/opt/Inline/tests/trycatch.csproj b/src/tests/JIT/opt/Inline/tests/trycatch.csproj index abbdb1fd1abe2..5c405b20fa829 100644 --- a/src/tests/JIT/opt/Inline/tests/trycatch.csproj +++ b/src/tests/JIT/opt/Inline/tests/trycatch.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.cs b/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.cs index e6358cf7841ba..e548b5cd17e63 100644 --- a/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.cs +++ b/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.cs @@ -3,12 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class ArrayLengthArithmeticTests { private static int returnCode = 100; - public static int Main() + [Fact] + public static int TestEntryPoint() { for (int arrayLength = 0; arrayLength < 100; arrayLength++) { diff --git a/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.csproj b/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.csproj index 10e5a51b6a338..05057d84d4280 100644 --- a/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.csproj +++ b/src/tests/JIT/opt/InstructionCombining/ArrayLengthArithmetic.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/InstructionCombining/DivToMul.cs b/src/tests/JIT/opt/InstructionCombining/DivToMul.cs index 0c7c3efe442ec..ad8253dd5f802 100644 --- a/src/tests/JIT/opt/InstructionCombining/DivToMul.cs +++ b/src/tests/JIT/opt/InstructionCombining/DivToMul.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using Xunit; // JIT is able to replace "x / 2" with "x * 0.5" where 2 is a power of two float // Make sure this optimization doesn't change the results @@ -12,7 +13,8 @@ public class Program { private static int resultCode = 100; - public static int Main() + [Fact] + public static int TestEntryPoint() { // Some corner cases var testValues = new List(new [] diff --git a/src/tests/JIT/opt/InstructionCombining/DivToMul.csproj b/src/tests/JIT/opt/InstructionCombining/DivToMul.csproj index 1abe39de2754c..c58d40a40c573 100644 --- a/src/tests/JIT/opt/InstructionCombining/DivToMul.csproj +++ b/src/tests/JIT/opt/InstructionCombining/DivToMul.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/InstructionCombining/MulToAdd.cs b/src/tests/JIT/opt/InstructionCombining/MulToAdd.cs index 07a1692fd4b80..b9be20cc41a75 100644 --- a/src/tests/JIT/opt/InstructionCombining/MulToAdd.cs +++ b/src/tests/JIT/opt/InstructionCombining/MulToAdd.cs @@ -4,6 +4,7 @@ using System; using System.Linq; using System.Runtime.CompilerServices; +using Xunit; // Test "X * 2" to "X + X" @@ -11,7 +12,8 @@ public class Program { private static int resultCode = 100; - public static int Main() + [Fact] + public static int TestEntryPoint() { float[] testValues = { diff --git a/src/tests/JIT/opt/InstructionCombining/MulToAdd.csproj b/src/tests/JIT/opt/InstructionCombining/MulToAdd.csproj index 0e728157f743f..de74b3343b0cb 100644 --- a/src/tests/JIT/opt/InstructionCombining/MulToAdd.csproj +++ b/src/tests/JIT/opt/InstructionCombining/MulToAdd.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.cs b/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.cs index 63164f74a053f..65cfccd257e81 100644 --- a/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.cs +++ b/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.cs @@ -13,10 +13,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace TestIntLimits { - class Program + public class Program { [MethodImpl(MethodImplOptions.NoInlining)] static int CheckMulNeg() @@ -339,7 +340,8 @@ static int CheckNegDiv() [MethodImpl(MethodImplOptions.NoInlining)] static long LongNegDivMinus1(long a) => -(a / -1); - static int Main() + [Fact] + public static int TestEntryPoint() { if (CheckMulNeg() != 100) { diff --git a/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.csproj b/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.csproj index ae22c012409f4..3b915c89e78c9 100644 --- a/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.csproj +++ b/src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.cs b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.cs index 33cba49a0ab4a..0b40d3eee3f81 100644 --- a/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.cs +++ b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { @@ -11,14 +12,15 @@ public class Program [MethodImpl(MethodImplOptions.NoInlining)] public static T ToVar(T t) => t; - public static void AssertTrue(bool cond, [CallerLineNumber] int line = 0) + internal static void AssertTrue(bool cond, [CallerLineNumber] int line = 0) { if (!cond) throw new InvalidOperationException($"Test failed at line {line}."); } // Tests for https://github.com/dotnet/runtime/pull/61045 optimization - public static int Main() + [Fact] + public static int TestEntryPoint() { unchecked { @@ -719,4 +721,4 @@ public static bool Test_long_to_long(long x) return x << Program.ShiftBy == Program.ToVar(x) << Program.ToVar(Program.ShiftBy); } -} \ No newline at end of file +} diff --git a/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.csproj b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.csproj index ae422e19fd397..a4b9082da0aaa 100644 --- a/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.csproj +++ b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/IsKnownConstant/StringEquals.cs b/src/tests/JIT/opt/IsKnownConstant/StringEquals_IsKnownConstant.cs similarity index 98% rename from src/tests/JIT/opt/IsKnownConstant/StringEquals.cs rename to src/tests/JIT/opt/IsKnownConstant/StringEquals_IsKnownConstant.cs index 4a109ae5d6548..5bdebbbc1a5ff 100644 --- a/src/tests/JIT/opt/IsKnownConstant/StringEquals.cs +++ b/src/tests/JIT/opt/IsKnownConstant/StringEquals_IsKnownConstant.cs @@ -3,10 +3,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { - public static int Main() + [Fact] + public static int TestEntryPoint() { AssertEquals(true, TestEquals1("")); AssertEquals(false, TestEquals1(null)); diff --git a/src/tests/JIT/opt/IsKnownConstant/StringEquals_IsKnownConstant.csproj b/src/tests/JIT/opt/IsKnownConstant/StringEquals_IsKnownConstant.csproj new file mode 100644 index 0000000000000..de6d5e08882e8 --- /dev/null +++ b/src/tests/JIT/opt/IsKnownConstant/StringEquals_IsKnownConstant.csproj @@ -0,0 +1,8 @@ + + + True + + + + + diff --git a/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.cs b/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.cs index d27b6630120d4..a7bbcf534398b 100644 --- a/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.cs +++ b/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.cs @@ -3,10 +3,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { - public static int Main() + [Fact] + public static int TestEntryPoint() { AreSame(Type.GetTypeCode(null), TypeCode.Empty); AreSame(Type.GetTypeCode(typeof(void*)), TypeCode.Object); diff --git a/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.csproj b/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.csproj index 5d3631a5de7f5..cd8f42ed6df84 100644 --- a/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.csproj +++ b/src/tests/JIT/opt/IsKnownConstant/TypeGetTypeCode.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/JIT.opt.csproj b/src/tests/JIT/opt/JIT.opt.csproj new file mode 100644 index 0000000000000..f751282d127da --- /dev/null +++ b/src/tests/JIT/opt/JIT.opt.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il index 36c6b8b5f3bf9..59a35e72e2038 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il @@ -12,7 +12,7 @@ .ver 4:0:0:0 } .assembly BBCnt0 {} -.class private auto ansi beforefieldinit BBCnt0 +.class public auto ansi beforefieldinit BBCnt0 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.ilproj index d9c521662e520..e30cf80da0f89 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il index 63b387f60a3e7..7394d549c05e9 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il @@ -11,8 +11,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly BBCnt1 {} -.class private auto ansi beforefieldinit BBCnt0 +.assembly BBCnt1_Perf {} +.class public auto ansi beforefieldinit BBCnt0 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1_Perf.ilproj similarity index 89% rename from src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.ilproj rename to src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1_Perf.ilproj index 9056251dd3990..8819e126ace2c 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1_Perf.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il index 5aa7c5abee6d5..3bc1951464bd2 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il @@ -13,7 +13,7 @@ .ver 4:0:0:0 } .assembly CodeSize0 {} -.class private auto ansi beforefieldinit CodeSize0 +.class public auto ansi beforefieldinit CodeSize0 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.ilproj index 864b01902b9a3..fb1b2a9873349 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il index a71e2fb3c2258..b705d821c56c7 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il @@ -13,8 +13,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly CodeSize1 {} -.class private auto ansi beforefieldinit CodeSize1 +.assembly CodeSize1_Perf {} +.class public auto ansi beforefieldinit CodeSize1 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1_Perf.ilproj similarity index 89% rename from src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.ilproj rename to src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1_Perf.ilproj index a04764310e762..65cfc3ba7ff40 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1_Perf.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.il b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.il index cfdd2c849d9e4..b30abaf835df3 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.il @@ -6,15 +6,19 @@ // TID ad4: IL Code Size,Instr 20006,19998, Basic Block count 1, Local Variable Num,Ref count 0, 0 for method .f():int .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly InstrCnt0 {} -.module InstrCnt0.exe +.class public auto ansi InstrCnt0 { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 12 (0xc) .maxstack 8 @@ -23,6 +27,7 @@ IL_000a: add IL_000b: ret } // end of global method Main +} .method public static int32 f() cil managed { diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.ilproj index 807a8a2b156dd..de341d4329265 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt0.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1.il b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1.il index 4b101ca3ac01d..69b3d8d403cde 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1.il @@ -7,15 +7,19 @@ // TID ab0: IL Code Size,Instr 20018,20002, Basic Block count 1, Local Variable Num,Ref count 0, 0 for method .f():int .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly InstrCnt0 {} -.module InstrCnt0.exe +.assembly InstrCnt1_Perf {} +.class public auto ansi InstrCnt1 { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 12 (0xc) .maxstack 8 @@ -24,6 +28,7 @@ IL_000a: add IL_000b: ret } // end of global method Main +} .method public static int32 f() cil managed { diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1_Perf.ilproj similarity index 89% rename from src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1.ilproj rename to src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1_Perf.ilproj index 0fef9b8de499a..edc080ae0c0c6 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/InstrCnt1_Perf.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.il b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.il index 972cac4b05af8..14a3ca0ede301 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.il @@ -6,15 +6,19 @@ // TID 330: IL Code Size,Instr 1893, 560, Basic Block count 1, Local Variable Num,Ref count 2000,279 for method .f():int .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly LVNumCnt0 {} -.module LVNumCnt0.exe +.class public auto ansi LVNumCnt0 { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 12 (0xc) .maxstack 8 @@ -23,6 +27,7 @@ IL_000a: add IL_000b: ret } // end of global method Main +} .method public static int32 f() cil managed { diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.ilproj index 763f7b028e71b..17305e8156735 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt0.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1.il b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1.il index 45cbca505c655..d8fb0d95ef75c 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1.il @@ -7,15 +7,19 @@ // TID f90: IL Code Size,Instr 1893, 560, Basic Block count 1, Local Variable Num,Ref count 2001,279 for method .f():int .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly LVNumCnt1 {} -.module LVNumCnt1.exe +.assembly LVNumCnt1_Perf {} +.class public auto ansi LVNumCnt1 { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 12 (0xc) .maxstack 8 @@ -24,6 +28,7 @@ IL_000a: add IL_000b: ret } // end of global method Main +} .method public static int32 f() cil managed { diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1_Perf.ilproj similarity index 89% rename from src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1.ilproj rename to src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1_Perf.ilproj index 0802139d9f482..ba32603baafff 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/LVNumCnt1.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVNumCnt1_Perf.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.il b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.il index 1557e21273d49..a27a33b2cfbeb 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.il @@ -5,20 +5,26 @@ // New refCnts for V00: refCnt = 8000 // OPTIONS: opts.MinOpts() == false .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly LVRefCnt0 {} +.class public auto ansi LVRefCnt0 { .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint call int32 f() ldc.i4 100 sub ret } +} .method public static int32 f() { .locals init (int32 V_0) diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.ilproj index 7f70d69f9491c..e5f3f6e7d7bd9 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt0.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1.il b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1.il index b5c4b25ae330d..a0d2c8a23c33a 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1.il @@ -5,20 +5,26 @@ // New refCnts for V00: refCnt = 8001 // OPTIONS: opts.MinOpts() == true .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly LVRefCnt1 {} +.assembly LVRefCnt1_Perf {} +.class public auto ansi LVRefCnt1 { .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint call int32 f() ldc.i4 100 sub ret } +} .method public static int32 f() { .locals init (int32 V_0) diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1.ilproj b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1_Perf.ilproj similarity index 89% rename from src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1.ilproj rename to src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1_Perf.ilproj index 2a6adc319f61d..5272c51cf9eae 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Perf/LVRefCnt1_Perf.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719.il b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719.il index 07f37c96b9b19..d7e5c6b626489 100644 --- a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719.il +++ b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719.il @@ -2,10 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } -.assembly GitHub_42719 {} -.module GitHub_42719.exe +.assembly extern xunit.core {} +.assembly ASSEMBLY_NAME {} +.class public auto ansi GitHub_42719 { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 // "0 u> -1" shouldn't be optimized into "-1 >> 31" @@ -16,3 +20,4 @@ add ret } +} diff --git a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_r.il b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_r.il new file mode 100644 index 0000000000000..6e0d83ea72ea1 --- /dev/null +++ b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_r.il @@ -0,0 +1 @@ +#define ASSEMBLY_NAME "GitHub_42719_r" diff --git a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719.ilproj b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_r.ilproj similarity index 80% rename from src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719.ilproj rename to src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_r.ilproj index ad6d87becfd14..2ee2d19097448 100644 --- a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_r.ilproj @@ -1,9 +1,9 @@ - Exe False + diff --git a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_ro.il b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_ro.il new file mode 100644 index 0000000000000..f9dabbc680b79 --- /dev/null +++ b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_ro.il @@ -0,0 +1 @@ +#define ASSEMBLY_NAME "GitHub_42719_ro" diff --git a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_il_r.ilproj b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_ro.ilproj similarity index 80% rename from src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_il_r.ilproj rename to src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_ro.ilproj index f09b3428e3f15..de4d483071041 100644 --- a/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_il_r.ilproj +++ b/src/tests/JIT/opt/JitMinOpts/Regression/GitHub_42719_ro.ilproj @@ -1,9 +1,9 @@ - Exe True + diff --git a/src/tests/JIT/opt/LocAlloc/inloop.cs b/src/tests/JIT/opt/LocAlloc/inloop.cs index 19cceaee1e880..31f4f0a4bb644 100644 --- a/src/tests/JIT/opt/LocAlloc/inloop.cs +++ b/src/tests/JIT/opt/LocAlloc/inloop.cs @@ -5,8 +5,9 @@ // to local buffer using System; +using Xunit; -unsafe class Program +public unsafe class Program { struct Element { @@ -35,7 +36,8 @@ static int foo(int n) return sum; } - static int Main() + [Fact] + public static int TestEntryPoint() { return foo(10) + 55; } diff --git a/src/tests/JIT/opt/LocAlloc/inloop.csproj b/src/tests/JIT/opt/LocAlloc/inloop.csproj index 05b0fc5fcb825..ecdf274583eb6 100644 --- a/src/tests/JIT/opt/LocAlloc/inloop.csproj +++ b/src/tests/JIT/opt/LocAlloc/inloop.csproj @@ -1,7 +1,4 @@ - - Exe - true None diff --git a/src/tests/JIT/opt/LocAlloc/localloc.cs b/src/tests/JIT/opt/LocAlloc/localloc.cs index e56d1179844d6..8270ea124f269 100644 --- a/src/tests/JIT/opt/LocAlloc/localloc.cs +++ b/src/tests/JIT/opt/LocAlloc/localloc.cs @@ -5,8 +5,9 @@ // and inlining of localloc callees using System; +using Xunit; -class L +public class L { unsafe static int Use4() { @@ -22,7 +23,8 @@ unsafe static int Use(int x) return i[1] * 2; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int v0 = Use4(); int v1 = Use(10); diff --git a/src/tests/JIT/opt/LocAlloc/localloc.csproj b/src/tests/JIT/opt/LocAlloc/localloc.csproj index f31c397818607..8db7747ee19ba 100644 --- a/src/tests/JIT/opt/LocAlloc/localloc.csproj +++ b/src/tests/JIT/opt/LocAlloc/localloc.csproj @@ -1,7 +1,4 @@ - - Exe - true None diff --git a/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.cs b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.cs index b07f347e6c124..3a99365bcce6b 100644 --- a/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.cs +++ b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.cs @@ -5,10 +5,12 @@ using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; using System.Runtime.Intrinsics.Arm; +using Xunit; -unsafe class LoopSideEffectsForHwiStores +public unsafe class LoopSideEffectsForHwiStores { - public static int Main() + [Fact] + public static int TestEntryPoint() { static bool VerifyExpectedVtor(Vector128 a) => a.Equals(Vector128.Create(4)); diff --git a/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.csproj b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.csproj index 7e343802d9e7a..efb31911b7afc 100644 --- a/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.csproj +++ b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.csproj @@ -1,6 +1,5 @@ - Exe true 1 diff --git a/src/tests/JIT/opt/Loops/SearchLoopTail.cs b/src/tests/JIT/opt/Loops/SearchLoopTail.cs index dff11b7b03da7..53bf2763b1784 100644 --- a/src/tests/JIT/opt/Loops/SearchLoopTail.cs +++ b/src/tests/JIT/opt/Loops/SearchLoopTail.cs @@ -4,6 +4,7 @@ // Test for tail merging/duplication of search loops returning constants. using System.Runtime.CompilerServices; +using Xunit; namespace N { @@ -135,7 +136,8 @@ static bool FalseTrueAnd(int[] input) return (n == 9 && m == 13); } - public static int Main() + [Fact] + public static int TestEntryPoint() { if (HasPrimeUnderTwenty(22, 36) || !HasPrimeUnderTwenty(-1, 4)) { diff --git a/src/tests/JIT/opt/Loops/SearchLoopTail.csproj b/src/tests/JIT/opt/Loops/SearchLoopTail.csproj index fe4a2822d7cab..4ee2e5892f225 100644 --- a/src/tests/JIT/opt/Loops/SearchLoopTail.csproj +++ b/src/tests/JIT/opt/Loops/SearchLoopTail.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/Multiply/IntMultiply.cs b/src/tests/JIT/opt/Multiply/IntMultiply.cs index b67ef6cf5d2d8..4221292db7560 100644 --- a/src/tests/JIT/opt/Multiply/IntMultiply.cs +++ b/src/tests/JIT/opt/Multiply/IntMultiply.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - static class IntMultiply + public static class IntMultiply { [MethodImpl(MethodImplOptions.NoInlining)] static uint UInt32_MultiplyWithUInt32MaxValue(uint value) @@ -257,7 +258,8 @@ static void UInt64_AddressExposed(ref ulong value) } - static int Main() + [Fact] + public static int TestEntryPoint() { if (UInt32_MultiplyWithUInt32MaxValue(1) != UInt32.MaxValue) return 0; diff --git a/src/tests/JIT/opt/Multiply/IntMultiply.csproj b/src/tests/JIT/opt/Multiply/IntMultiply.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Multiply/IntMultiply.csproj +++ b/src/tests/JIT/opt/Multiply/IntMultiply.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/OSR/Runtime_69032.cs b/src/tests/JIT/opt/OSR/Runtime_69032.cs index 93bdc1db91b30..c36f3c322f4fc 100644 --- a/src/tests/JIT/opt/OSR/Runtime_69032.cs +++ b/src/tests/JIT/opt/OSR/Runtime_69032.cs @@ -4,10 +4,11 @@ using System; using System.Linq; using System.Runtime.CompilerServices; +using Xunit; // Assert in F() with OSR+PGO -class Runtime_69032 +public class Runtime_69032 { [MethodImpl(MethodImplOptions.NoInlining)] static int F(int n) @@ -21,7 +22,8 @@ static int F(int n) return n; } - public static int Main() + [Fact] + public static int TestEntryPoint() { return F(10_000) / 100; } diff --git a/src/tests/JIT/opt/OSR/Runtime_69032.csproj b/src/tests/JIT/opt/OSR/Runtime_69032.csproj index 42ba8b6fec60f..c1f1286cd5b61 100644 --- a/src/tests/JIT/opt/OSR/Runtime_69032.csproj +++ b/src/tests/JIT/opt/OSR/Runtime_69032.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/addressexposedlocal.cs b/src/tests/JIT/opt/OSR/addressexposedlocal.cs index d688ac9a31163..d7e8f0080c140 100644 --- a/src/tests/JIT/opt/OSR/addressexposedlocal.cs +++ b/src/tests/JIT/opt/OSR/addressexposedlocal.cs @@ -3,16 +3,17 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // OSR method has address exposed local -class AddressExposedLocal +public class AddressExposedLocal { // [MethodImpl(MethodImplOptions.NoInlining)] public static unsafe int I(ref int p) => p; [MethodImpl(MethodImplOptions.NoInlining)] - public static unsafe void J(ref int p) {} + internal static unsafe void J(ref int p) {} [MethodImpl(MethodImplOptions.NoInlining)] public static unsafe int F(int from, int to) @@ -26,7 +27,8 @@ public static unsafe int F(int from, int to) return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = F(0, 1_000_000); diff --git a/src/tests/JIT/opt/OSR/addressexposedlocal.csproj b/src/tests/JIT/opt/OSR/addressexposedlocal.csproj index 631468733d528..b07fc4f3823f3 100644 --- a/src/tests/JIT/opt/OSR/addressexposedlocal.csproj +++ b/src/tests/JIT/opt/OSR/addressexposedlocal.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/doublestackalloc.cs b/src/tests/JIT/opt/OSR/doublestackalloc.cs index 85648769a7dbd..2fde618629c08 100644 --- a/src/tests/JIT/opt/OSR/doublestackalloc.cs +++ b/src/tests/JIT/opt/OSR/doublestackalloc.cs @@ -7,12 +7,14 @@ // OSR method frame is also variable sized. using System; +using Xunit; -class DoubleStackAlloc +public class DoubleStackAlloc { static int outerSize = 1000; static int innerSize = 1; - public static unsafe int Main() + [Fact] + public static unsafe int TestEntryPoint() { long* result = stackalloc long[outerSize]; *result = 0; diff --git a/src/tests/JIT/opt/OSR/doublestackalloc.csproj b/src/tests/JIT/opt/OSR/doublestackalloc.csproj index 631468733d528..b07fc4f3823f3 100644 --- a/src/tests/JIT/opt/OSR/doublestackalloc.csproj +++ b/src/tests/JIT/opt/OSR/doublestackalloc.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/example.cs b/src/tests/JIT/opt/OSR/example.cs index 2bb9fde89be64..c214c39359747 100644 --- a/src/tests/JIT/opt/OSR/example.cs +++ b/src/tests/JIT/opt/OSR/example.cs @@ -4,10 +4,11 @@ using System; using System.Diagnostics; using System.Runtime.CompilerServices; +using Xunit; // Example from the OSR doc -class OSR_Example +public class OSR_Example { [MethodImpl(MethodImplOptions.NoInlining)] public static double F(int from, int to) @@ -20,9 +21,10 @@ public static double F(int from, int to) return result; } - public static int Main(string[] args) + [MethodImpl(MethodImplOptions.NoInlining)] + public static int Test(int? arg) { - int final = args.Length <= 0 ? 1_000_000 : Int32.Parse(args[0]); + int final = arg ?? 1_000_000; long frequency = Stopwatch.Frequency; long nanosecPerTick = (1000L*1000L*1000L) / frequency; // Console.WriteLine($"computing sum over {final} ints"); @@ -38,5 +40,11 @@ public static int Main(string[] args) double elapsedTime = 1000.0 * (double) s.ElapsedTicks / (double) frequency; Console.WriteLine($"{final} iterations took {elapsedTime:F2}ms"); return result == 499999500000 ? 100 : -1; - } + } + + [Fact] + public static int TestEntryPoint() + { + return Test(null); + } } diff --git a/src/tests/JIT/opt/OSR/example.csproj b/src/tests/JIT/opt/OSR/example.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/example.csproj +++ b/src/tests/JIT/opt/OSR/example.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/exposure1.cs b/src/tests/JIT/opt/OSR/exposure1.cs index a21459b6ee289..d497e7883822d 100644 --- a/src/tests/JIT/opt/OSR/exposure1.cs +++ b/src/tests/JIT/opt/OSR/exposure1.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Runtime 83738: need to ensure that 's' in 'Foo' // is marked as address exposed during OSR compiles. @@ -35,7 +36,8 @@ static bool Foo(int n) return (abc == eabc && def == edef); } - public static int Main() + [Fact] + public static int TestEntryPoint() { return Foo(50000) ? 100 : -1; } diff --git a/src/tests/JIT/opt/OSR/exposure1.csproj b/src/tests/JIT/opt/OSR/exposure1.csproj index fe316c4b40a18..6b6dff02e3aae 100644 --- a/src/tests/JIT/opt/OSR/exposure1.csproj +++ b/src/tests/JIT/opt/OSR/exposure1.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/exposure2.cs b/src/tests/JIT/opt/OSR/exposure2.cs index 12abe16b965f4..02a09a3962ba4 100644 --- a/src/tests/JIT/opt/OSR/exposure2.cs +++ b/src/tests/JIT/opt/OSR/exposure2.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Runtime 83738: need to ensure that 's' in 'Foo' // is marked as address exposed during OSR compiles. @@ -35,7 +36,8 @@ static bool Foo(int n) return (abc == eabc && def == edef); } - public static int Main() + [Fact] + public static int TestEntryPoint() { return Foo(50000) ? 100 : -1; } diff --git a/src/tests/JIT/opt/OSR/exposure2.csproj b/src/tests/JIT/opt/OSR/exposure2.csproj index fe316c4b40a18..6b6dff02e3aae 100644 --- a/src/tests/JIT/opt/OSR/exposure2.csproj +++ b/src/tests/JIT/opt/OSR/exposure2.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/genericmethodpatchpoint.cs b/src/tests/JIT/opt/OSR/genericmethodpatchpoint.cs index 323777985142c..fd19535e6d99c 100644 --- a/src/tests/JIT/opt/OSR/genericmethodpatchpoint.cs +++ b/src/tests/JIT/opt/OSR/genericmethodpatchpoint.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Patchpoint in generic method -class GenericMethodPatchpoint +public class GenericMethodPatchpoint { [MethodImpl(MethodImplOptions.NoInlining)] public static int F(T[] data, int from, int to) where T : class @@ -19,7 +20,8 @@ public static int F(T[] data, int from, int to) where T : class return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { string[] a = new string[1000]; a[111] = "hello, world"; diff --git a/src/tests/JIT/opt/OSR/genericmethodpatchpoint.csproj b/src/tests/JIT/opt/OSR/genericmethodpatchpoint.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/genericmethodpatchpoint.csproj +++ b/src/tests/JIT/opt/OSR/genericmethodpatchpoint.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/handlerloop.cs b/src/tests/JIT/opt/OSR/handlerloop.cs index 01429b553c139..6150a566e057d 100644 --- a/src/tests/JIT/opt/OSR/handlerloop.cs +++ b/src/tests/JIT/opt/OSR/handlerloop.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // OSR can't bail us out of a loop in a handler // -class OSRHandlerLoop +public class OSRHandlerLoop { - public static int Main() + [Fact] + public static int TestEntryPoint() { int result = 0; int expected = 0; diff --git a/src/tests/JIT/opt/OSR/handlerloop.csproj b/src/tests/JIT/opt/OSR/handlerloop.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/handlerloop.csproj +++ b/src/tests/JIT/opt/OSR/handlerloop.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/innerloop.cs b/src/tests/JIT/opt/OSR/innerloop.cs index 7e5dc32b22426..390fc030a3b97 100644 --- a/src/tests/JIT/opt/OSR/innerloop.cs +++ b/src/tests/JIT/opt/OSR/innerloop.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; -class InnerLoop +public class InnerLoop { - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] a = new int[1000]; a[555] = 1; diff --git a/src/tests/JIT/opt/OSR/innerloop.csproj b/src/tests/JIT/opt/OSR/innerloop.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/innerloop.csproj +++ b/src/tests/JIT/opt/OSR/innerloop.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/integersumloop.cs b/src/tests/JIT/opt/OSR/integersumloop.cs index 67bdfadb8d6cc..db3296158d292 100644 --- a/src/tests/JIT/opt/OSR/integersumloop.cs +++ b/src/tests/JIT/opt/OSR/integersumloop.cs @@ -4,8 +4,9 @@ using System; using System.Diagnostics; using System.Runtime.CompilerServices; +using Xunit; -class IntegerSumLoop +public class IntegerSumLoop { [MethodImpl(MethodImplOptions.NoInlining)] public static int F(int from, int to) @@ -18,7 +19,8 @@ public static int F(int from, int to) return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int final = 1_000_000; long frequency = Stopwatch.Frequency; diff --git a/src/tests/JIT/opt/OSR/integersumloop.csproj b/src/tests/JIT/opt/OSR/integersumloop.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/integersumloop.csproj +++ b/src/tests/JIT/opt/OSR/integersumloop.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/invalidpromotion.cs b/src/tests/JIT/opt/OSR/invalidpromotion.cs index 5aeb724281475..e9fc57f323bec 100644 --- a/src/tests/JIT/opt/OSR/invalidpromotion.cs +++ b/src/tests/JIT/opt/OSR/invalidpromotion.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; interface IFoo { @@ -64,7 +65,8 @@ static bool G(int n) where T : IFoo return false; } - public static int Main() + [Fact] + public static int TestEntryPoint() { return G(1) ? 100 : -1; } diff --git a/src/tests/JIT/opt/OSR/invalidpromotion.csproj b/src/tests/JIT/opt/OSR/invalidpromotion.csproj index 52d3b20e5efbd..c5c2200ef2f1b 100644 --- a/src/tests/JIT/opt/OSR/invalidpromotion.csproj +++ b/src/tests/JIT/opt/OSR/invalidpromotion.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/largefuncletframe.cs b/src/tests/JIT/opt/OSR/largefuncletframe.cs index 76c982211cbce..72e9371cf8a81 100644 --- a/src/tests/JIT/opt/OSR/largefuncletframe.cs +++ b/src/tests/JIT/opt/OSR/largefuncletframe.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using Xunit; public class LargeFuncletFrame { @@ -188,7 +189,7 @@ public S1 Method3(out S1.S1_D1_F2 p_s1_s1_d1_f2_90, ref double p_double_91, uint return s1_44; } } - public void Method0() + internal void Method0() { unchecked { @@ -203,10 +204,10 @@ public void Method0() } } - public static int Main() + [Fact] + public static void TestEntryPoint() { new LargeFuncletFrame().Method0(); - return 100; } } /* diff --git a/src/tests/JIT/opt/OSR/largefuncletframe.csproj b/src/tests/JIT/opt/OSR/largefuncletframe.csproj index 6a943fa49d91f..9777246ee0815 100644 --- a/src/tests/JIT/opt/OSR/largefuncletframe.csproj +++ b/src/tests/JIT/opt/OSR/largefuncletframe.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/livelocaladdress.cs b/src/tests/JIT/opt/OSR/livelocaladdress.cs index d632596a6d079..5b5597605cdfa 100644 --- a/src/tests/JIT/opt/OSR/livelocaladdress.cs +++ b/src/tests/JIT/opt/OSR/livelocaladdress.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // An example where OSR must preserve original method addreses for locals -class LiveLocalAddress +public class LiveLocalAddress { - public static unsafe int Main() + [Fact] + public static unsafe int TestEntryPoint() { long result = 0; int a = 0; diff --git a/src/tests/JIT/opt/OSR/livelocaladdress.csproj b/src/tests/JIT/opt/OSR/livelocaladdress.csproj index 59efb3ecb8101..c99ef44a02ddd 100644 --- a/src/tests/JIT/opt/OSR/livelocaladdress.csproj +++ b/src/tests/JIT/opt/OSR/livelocaladdress.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/livelocalstackalloc.cs b/src/tests/JIT/opt/OSR/livelocalstackalloc.cs index e584f972a6c83..8346b54a03c6b 100644 --- a/src/tests/JIT/opt/OSR/livelocalstackalloc.cs +++ b/src/tests/JIT/opt/OSR/livelocalstackalloc.cs @@ -2,15 +2,17 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // Example where local address is live in a stackalloc region -class LiveLocalStackalloc +public class LiveLocalStackalloc { static int n = 100; static int j = 30; - public static unsafe int Main() + [Fact] + public static unsafe int TestEntryPoint() { int nn = n; int** ptrs = stackalloc int*[nn]; diff --git a/src/tests/JIT/opt/OSR/livelocalstackalloc.csproj b/src/tests/JIT/opt/OSR/livelocalstackalloc.csproj index 631468733d528..b07fc4f3823f3 100644 --- a/src/tests/JIT/opt/OSR/livelocalstackalloc.csproj +++ b/src/tests/JIT/opt/OSR/livelocalstackalloc.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/mainloop.cs b/src/tests/JIT/opt/OSR/mainloop.cs index 7cc54cc63bc04..c35bca98c5d9f 100644 --- a/src/tests/JIT/opt/OSR/mainloop.cs +++ b/src/tests/JIT/opt/OSR/mainloop.cs @@ -2,12 +2,15 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Runtime.CompilerServices; +using Xunit; // Simple OSR test case -- long running loop in Main -class MainLoop +public class MainLoop { - public static int Main() + [Fact] + public static int TestEntryPoint() { long result = 0; for (int i = 0; i < 1_000_000; i++) diff --git a/src/tests/JIT/opt/OSR/mainloop.csproj b/src/tests/JIT/opt/OSR/mainloop.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/mainloop.csproj +++ b/src/tests/JIT/opt/OSR/mainloop.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/mainloop2.cs b/src/tests/JIT/opt/OSR/mainloop2.cs index bb7c6cec83bf0..ca1f23a24e11e 100644 --- a/src/tests/JIT/opt/OSR/mainloop2.cs +++ b/src/tests/JIT/opt/OSR/mainloop2.cs @@ -2,12 +2,15 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Runtime.CompilerServices; +using Xunit; // Simple OSR test case -- nested loop in Main -class MainNestedLoop +public class MainNestedLoop { - public static int Main() + [Fact] + public static int TestEntryPoint() { long result = 0; for (int i = 0; i < 1_000; i++) diff --git a/src/tests/JIT/opt/OSR/mainloop2.csproj b/src/tests/JIT/opt/OSR/mainloop2.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/mainloop2.csproj +++ b/src/tests/JIT/opt/OSR/mainloop2.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/mainlooptry.cs b/src/tests/JIT/opt/OSR/mainlooptry.cs index ed5a94d9a2912..a4172c9fb3e62 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry.cs +++ b/src/tests/JIT/opt/OSR/mainlooptry.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // OSR entry in a try region -class MainLoopTry +public class MainLoopTry { - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = 0; diff --git a/src/tests/JIT/opt/OSR/mainlooptry.csproj b/src/tests/JIT/opt/OSR/mainlooptry.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry.csproj +++ b/src/tests/JIT/opt/OSR/mainlooptry.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/mainlooptry2.cs b/src/tests/JIT/opt/OSR/mainlooptry2.cs index f62f299b47e89..3365cb5668e6a 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry2.cs +++ b/src/tests/JIT/opt/OSR/mainlooptry2.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // Multiple patchpoints each in a try -class MainLoopTry2 +public class MainLoopTry2 { - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = 0; diff --git a/src/tests/JIT/opt/OSR/mainlooptry2.csproj b/src/tests/JIT/opt/OSR/mainlooptry2.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry2.csproj +++ b/src/tests/JIT/opt/OSR/mainlooptry2.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/mainlooptry3.cs b/src/tests/JIT/opt/OSR/mainlooptry3.cs index ca3c1b1e2186d..84b26f35a59f5 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry3.cs +++ b/src/tests/JIT/opt/OSR/mainlooptry3.cs @@ -9,10 +9,12 @@ // entry point is not from the OSR entry. using System; +using Xunit; -class MainLoopCloselyNestedTry +public class MainLoopCloselyNestedTry { - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = 0; diff --git a/src/tests/JIT/opt/OSR/mainlooptry3.csproj b/src/tests/JIT/opt/OSR/mainlooptry3.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry3.csproj +++ b/src/tests/JIT/opt/OSR/mainlooptry3.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/mainlooptry4.cs b/src/tests/JIT/opt/OSR/mainlooptry4.cs index 85c1352e1000e..226a87ffddb79 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry4.cs +++ b/src/tests/JIT/opt/OSR/mainlooptry4.cs @@ -9,12 +9,14 @@ // Mutually protective try example. using System; +using Xunit; class E : Exception {} -class MainLoopMutuallyProtectiveTry +public class MainLoopMutuallyProtectiveTry { - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = 0; diff --git a/src/tests/JIT/opt/OSR/mainlooptry4.csproj b/src/tests/JIT/opt/OSR/mainlooptry4.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/mainlooptry4.csproj +++ b/src/tests/JIT/opt/OSR/mainlooptry4.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/memoryargument.cs b/src/tests/JIT/opt/OSR/memoryargument.cs index 6e0db0156e1a1..59ded6fcc076a 100644 --- a/src/tests/JIT/opt/OSR/memoryargument.cs +++ b/src/tests/JIT/opt/OSR/memoryargument.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // OSR method must access memory argument -class MemoryArgument +public class MemoryArgument { [MethodImpl(MethodImplOptions.NoInlining)] public static int F(int a, int b, int c, int d, int from, int to) @@ -19,7 +20,8 @@ public static int F(int a, int b, int c, int d, int from, int to) return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int final = 1_000_000; int result = F(0, 0, 0, 0, 0, final); diff --git a/src/tests/JIT/opt/OSR/memoryargument.csproj b/src/tests/JIT/opt/OSR/memoryargument.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/memoryargument.csproj +++ b/src/tests/JIT/opt/OSR/memoryargument.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/nesteddoloops.cs b/src/tests/JIT/opt/OSR/nesteddoloops.cs index b6186758c7491..11cc36f803824 100644 --- a/src/tests/JIT/opt/OSR/nesteddoloops.cs +++ b/src/tests/JIT/opt/OSR/nesteddoloops.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Nested do lops -class NestedDoLoops +public class NestedDoLoops { [MethodImpl(MethodImplOptions.NoInlining)] public static int F(int inner, int outer, int innerTo, int outerTo) @@ -20,7 +21,8 @@ public static int F(int inner, int outer, int innerTo, int outerTo) return outer; } - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result1 = F(0, 10, 0, 100_000); diff --git a/src/tests/JIT/opt/OSR/nesteddoloops.csproj b/src/tests/JIT/opt/OSR/nesteddoloops.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/nesteddoloops.csproj +++ b/src/tests/JIT/opt/OSR/nesteddoloops.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/normalizeonload.cs b/src/tests/JIT/opt/OSR/normalizeonload.cs index 31b6a12d5a118..2f085f1e97a80 100644 --- a/src/tests/JIT/opt/OSR/normalizeonload.cs +++ b/src/tests/JIT/opt/OSR/normalizeonload.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Ensure small OSR locals are marked as normalize on load -class Runtime_83959 +public class Runtime_83959 { static bool B(out byte b) { @@ -42,7 +43,8 @@ static void FillStack(int n) } } - public static int Main() + [Fact] + public static int TestEntryPoint() { char c = (char) 0; FillStack(100); diff --git a/src/tests/JIT/opt/OSR/normalizeonload.csproj b/src/tests/JIT/opt/OSR/normalizeonload.csproj index b3bc14e098a82..a5c97d8b83ecd 100644 --- a/src/tests/JIT/opt/OSR/normalizeonload.csproj +++ b/src/tests/JIT/opt/OSR/normalizeonload.csproj @@ -1,6 +1,7 @@ - Exe + + true True True diff --git a/src/tests/JIT/opt/OSR/originalstackalloc.cs b/src/tests/JIT/opt/OSR/originalstackalloc.cs index 15fe30e562f24..320702d45be33 100644 --- a/src/tests/JIT/opt/OSR/originalstackalloc.cs +++ b/src/tests/JIT/opt/OSR/originalstackalloc.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Original method has stackalloc, osr does not -class OriginalStackalloc +public class OriginalStackalloc { [MethodImpl(MethodImplOptions.NoInlining)] public static unsafe int F(int from, int to, int s) @@ -20,7 +21,8 @@ public static unsafe int F(int from, int to, int s) return *result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = F(0, 1_000_000, 1); diff --git a/src/tests/JIT/opt/OSR/originalstackalloc.csproj b/src/tests/JIT/opt/OSR/originalstackalloc.csproj index 631468733d528..b07fc4f3823f3 100644 --- a/src/tests/JIT/opt/OSR/originalstackalloc.csproj +++ b/src/tests/JIT/opt/OSR/originalstackalloc.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/osrcontainstry.cs b/src/tests/JIT/opt/OSR/osrcontainstry.cs index f390815f96bf1..8e49e89a45f65 100644 --- a/src/tests/JIT/opt/OSR/osrcontainstry.cs +++ b/src/tests/JIT/opt/OSR/osrcontainstry.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // OSR method contains try -class OSRContainsTry +public class OSRContainsTry { [MethodImpl(MethodImplOptions.NoInlining)] public static unsafe int I(ref int p) => p; @@ -28,7 +29,8 @@ public static unsafe int F(int from, int to) return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = F(0, 1_000_000); diff --git a/src/tests/JIT/opt/OSR/osrcontainstry.csproj b/src/tests/JIT/opt/OSR/osrcontainstry.csproj index 631468733d528..b07fc4f3823f3 100644 --- a/src/tests/JIT/opt/OSR/osrcontainstry.csproj +++ b/src/tests/JIT/opt/OSR/osrcontainstry.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/pinnedlocal.cs b/src/tests/JIT/opt/OSR/pinnedlocal.cs index 493b3ab2f0223..2be913e6e3e43 100644 --- a/src/tests/JIT/opt/OSR/pinnedlocal.cs +++ b/src/tests/JIT/opt/OSR/pinnedlocal.cs @@ -2,17 +2,19 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // Run under DOTNET_GCStress=3 -class PinnedLocal +public class PinnedLocal { static int F(char c) { return (int) c; } - public static unsafe int Main() + [Fact] + public static unsafe int TestEntryPoint() { string ss = "goodbye, world\n"; string s = "hello, world\n"; diff --git a/src/tests/JIT/opt/OSR/pinnedlocal.csproj b/src/tests/JIT/opt/OSR/pinnedlocal.csproj index e515f7d4f3a12..36e30677dedfb 100644 --- a/src/tests/JIT/opt/OSR/pinnedlocal.csproj +++ b/src/tests/JIT/opt/OSR/pinnedlocal.csproj @@ -1,6 +1,7 @@ - Exe + + true True True diff --git a/src/tests/JIT/opt/OSR/promoted.cs b/src/tests/JIT/opt/OSR/promoted.cs index f5b10bec40ff1..a72878831478d 100644 --- a/src/tests/JIT/opt/OSR/promoted.cs +++ b/src/tests/JIT/opt/OSR/promoted.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics; using System.Runtime.CompilerServices; +using Xunit; // OSR complications with promoted structs @@ -26,7 +27,7 @@ public static void Init(int _a, int _b) public int b; } -class OSRMethodStructPromotion +public class OSRMethodStructPromotion { [MethodImpl(MethodImplOptions.NoInlining)] public static int F(int from, int to) @@ -41,7 +42,8 @@ public static int F(int from, int to) return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int final = 1_000_000; F(0, 10); diff --git a/src/tests/JIT/opt/OSR/promoted.csproj b/src/tests/JIT/opt/OSR/promoted.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/promoted.csproj +++ b/src/tests/JIT/opt/OSR/promoted.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/shadowparam.cs b/src/tests/JIT/opt/OSR/shadowparam.cs index d43b2b809a5fe..a4ae8bf4d6ab5 100644 --- a/src/tests/JIT/opt/OSR/shadowparam.cs +++ b/src/tests/JIT/opt/OSR/shadowparam.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // F is an OSR method with parameter shadowing @@ -28,7 +29,8 @@ public static int F(int x, string sa, ShadowParam u, string sb, int a, int b, in return x + y + u.a + u.b + sb.Length - sa.Length; } - public static int Main() + [Fact] + public static int TestEntryPoint() { var u = new ShadowParam(); u.data[0] = 1; diff --git a/src/tests/JIT/opt/OSR/shadowparam.csproj b/src/tests/JIT/opt/OSR/shadowparam.csproj index 2ab2ec62439f7..b54fcc5b5436d 100644 --- a/src/tests/JIT/opt/OSR/shadowparam.csproj +++ b/src/tests/JIT/opt/OSR/shadowparam.csproj @@ -1,6 +1,5 @@ - Exe True True diff --git a/src/tests/JIT/opt/OSR/shortenregisteredlocal.cs b/src/tests/JIT/opt/OSR/shortenregisteredlocal.cs index f98ad5e4f035a..45f72f5d42c72 100644 --- a/src/tests/JIT/opt/OSR/shortenregisteredlocal.cs +++ b/src/tests/JIT/opt/OSR/shortenregisteredlocal.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using Xunit; public class ShortEnregisteredLocal { public struct S2 @@ -46,7 +47,7 @@ public float Method1(ref float p_float_34, out S2 p_s2_35, byte p_byte_36, S2 p_ return float_27 /= 15+4; } } - public void Method0() + internal void Method0() { unchecked { @@ -58,13 +59,14 @@ public void Method0() return; } } - public static int Main() + [Fact] + public static int TestEntryPoint() { new ShortEnregisteredLocal().Method0(); return 100; } [MethodImpl(MethodImplOptions.NoInlining)] - public static void Log(string varName, object varValue) + internal static void Log(string varName, object varValue) { } -} \ No newline at end of file +} diff --git a/src/tests/JIT/opt/OSR/shortenregisteredlocal.csproj b/src/tests/JIT/opt/OSR/shortenregisteredlocal.csproj index 0e5d146d59f76..5b958079e77f1 100644 --- a/src/tests/JIT/opt/OSR/shortenregisteredlocal.csproj +++ b/src/tests/JIT/opt/OSR/shortenregisteredlocal.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/synchronized.cs b/src/tests/JIT/opt/OSR/synchronized.cs index 4a0b8629d49aa..550ec029b5560 100644 --- a/src/tests/JIT/opt/OSR/synchronized.cs +++ b/src/tests/JIT/opt/OSR/synchronized.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; struct S { @@ -22,12 +23,12 @@ virtual public S F() } } -class X +public class X { Z z; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Synchronized)] - public S G() + internal S G() { S s = new S(); @@ -43,7 +44,8 @@ public S G() return s; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int result = -1; try diff --git a/src/tests/JIT/opt/OSR/synchronized.csproj b/src/tests/JIT/opt/OSR/synchronized.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/synchronized.csproj +++ b/src/tests/JIT/opt/OSR/synchronized.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/tailpgo.cs b/src/tests/JIT/opt/OSR/tailpgo.cs index 1646cde723442..b2282d5c1ac52 100644 --- a/src/tests/JIT/opt/OSR/tailpgo.cs +++ b/src/tests/JIT/opt/OSR/tailpgo.cs @@ -3,13 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class X +public class X { static int s; static int N; - public static void F(int[] a) + internal static void F(int[] a) { for (int j = 0; j < N; j++) { @@ -27,7 +28,7 @@ public static void F(int[] a) // the return to happen before the // tail calls. // - public static void T(bool p, int[] a) + internal static void T(bool p, int[] a) { if (p) { @@ -44,7 +45,8 @@ public static void T(bool p, int[] a) } [MethodImpl(MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] a = new int[1000]; N = 100; diff --git a/src/tests/JIT/opt/OSR/tailpgo.csproj b/src/tests/JIT/opt/OSR/tailpgo.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/tailpgo.csproj +++ b/src/tests/JIT/opt/OSR/tailpgo.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/tailpgo2.cs b/src/tests/JIT/opt/OSR/tailpgo2.cs index 6924694c030c1..181f296a3cdfb 100644 --- a/src/tests/JIT/opt/OSR/tailpgo2.cs +++ b/src/tests/JIT/opt/OSR/tailpgo2.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class X +public class X { static int s; static int N; @@ -16,7 +17,7 @@ class X // the return to happen before the // tail calls. // - public static void T(int x, int[] a) + internal static void T(int x, int[] a) { for (int j = 0; j < N; j++) { @@ -37,7 +38,8 @@ public static void T(int x, int[] a) } [MethodImpl(MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] a = new int[1000]; N = 100; diff --git a/src/tests/JIT/opt/OSR/tailpgo2.csproj b/src/tests/JIT/opt/OSR/tailpgo2.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/tailpgo2.csproj +++ b/src/tests/JIT/opt/OSR/tailpgo2.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/tailrecurse.cs b/src/tests/JIT/opt/OSR/tailrecurse.cs index 56c390be54675..0522007f234ca 100644 --- a/src/tests/JIT/opt/OSR/tailrecurse.cs +++ b/src/tests/JIT/opt/OSR/tailrecurse.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // OSR and tail recursion -class OSRTailRecursion +public class OSRTailRecursion { public static int F(int from, int to, int n, int a) { @@ -22,7 +23,8 @@ public static int F(int from, int to, int n, int a) return F(to, to + to - from, n-1, result); } - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = F(0, 100_000, 9, 0); diff --git a/src/tests/JIT/opt/OSR/tailrecurse.csproj b/src/tests/JIT/opt/OSR/tailrecurse.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/tailrecurse.csproj +++ b/src/tests/JIT/opt/OSR/tailrecurse.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/tailrecursetry.cs b/src/tests/JIT/opt/OSR/tailrecursetry.cs index 7a2e788656d8b..89e89f4f15aed 100644 --- a/src/tests/JIT/opt/OSR/tailrecursetry.cs +++ b/src/tests/JIT/opt/OSR/tailrecursetry.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // Tail recursion, OSR entry in try region -class TailRecursionWithOsrEntryInTry +public class TailRecursionWithOsrEntryInTry { public static int F(int from, int to, int n, int a) { @@ -29,7 +30,8 @@ public static int F(int from, int to, int n, int a) return F(to, to + to - from, n-1, result); } - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine($"starting sum"); int result = F(0, 100_000, 9, 0); diff --git a/src/tests/JIT/opt/OSR/tailrecursetry.csproj b/src/tests/JIT/opt/OSR/tailrecursetry.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/tailrecursetry.csproj +++ b/src/tests/JIT/opt/OSR/tailrecursetry.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/tailrecursetry2.cs b/src/tests/JIT/opt/OSR/tailrecursetry2.cs index c92fcc82bef82..605257eb51fba 100644 --- a/src/tests/JIT/opt/OSR/tailrecursetry2.cs +++ b/src/tests/JIT/opt/OSR/tailrecursetry2.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Tail recursion candidate with OSR entry in a try region -class TailRecursionCandidateOSREntryInTry +public class TailRecursionCandidateOSREntryInTry { public unsafe static int F(int from, int to, int n, int result, int *x) { @@ -29,7 +30,8 @@ public unsafe static int F(int from, int to, int n, int result, int *x) return F(to, to + delta, n-1, result, &result); } - public static unsafe int Main() + [Fact] + public static unsafe int TestEntryPoint() { int x = 0; int result = F(0, 100_000, 9, 0, &x); diff --git a/src/tests/JIT/opt/OSR/tailrecursetry2.csproj b/src/tests/JIT/opt/OSR/tailrecursetry2.csproj index 631468733d528..b07fc4f3823f3 100644 --- a/src/tests/JIT/opt/OSR/tailrecursetry2.csproj +++ b/src/tests/JIT/opt/OSR/tailrecursetry2.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/JIT/opt/OSR/twoosrmethods.cs b/src/tests/JIT/opt/OSR/twoosrmethods.cs index edaf09e2806a0..27dd2bd78608a 100644 --- a/src/tests/JIT/opt/OSR/twoosrmethods.cs +++ b/src/tests/JIT/opt/OSR/twoosrmethods.cs @@ -3,13 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Method creates has two OSR methods -class TwoOSRMethods +public class TwoOSRMethods { [MethodImpl(MethodImplOptions.NoInlining)] - public static void I(ref int p, int i) => p = p + i; + internal static void I(ref int p, int i) => p = p + i; [MethodImpl(MethodImplOptions.NoInlining)] public static int F(int from, int to, bool b) @@ -34,7 +35,8 @@ public static int F(int from, int to, bool b) return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int final = 1_000_000; int result1 = F(0, final, true); diff --git a/src/tests/JIT/opt/OSR/twoosrmethods.csproj b/src/tests/JIT/opt/OSR/twoosrmethods.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/twoosrmethods.csproj +++ b/src/tests/JIT/opt/OSR/twoosrmethods.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/OSR/twoosrmethods1.cs b/src/tests/JIT/opt/OSR/twoosrmethods1.cs index bf4fa69a4d91f..0d8989b1e535a 100644 --- a/src/tests/JIT/opt/OSR/twoosrmethods1.cs +++ b/src/tests/JIT/opt/OSR/twoosrmethods1.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Two OSR methods from one original method -class X +public class X { [MethodImpl(MethodImplOptions.NoInlining)] public static int F(int from, int to, bool sumUp) @@ -31,7 +32,8 @@ public static int F(int from, int to, bool sumUp) return result; } - public static int Main() + [Fact] + public static int TestEntryPoint() { int final = 1_000_000; int result1 = F(0, final, true); diff --git a/src/tests/JIT/opt/OSR/twoosrmethods1.csproj b/src/tests/JIT/opt/OSR/twoosrmethods1.csproj index f48532f840890..13fe7de074f95 100644 --- a/src/tests/JIT/opt/OSR/twoosrmethods1.csproj +++ b/src/tests/JIT/opt/OSR/twoosrmethods1.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.cs b/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.cs index eadbc06d91033..9faf9b4cce4f0 100644 --- a/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.cs +++ b/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Diagnostics; using System.Runtime.CompilerServices; +using Xunit; namespace ObjectStackAllocation { @@ -87,7 +88,7 @@ enum AllocationKind Undefined } - class Tests + public class Tests { static volatile int f1 = 5; static volatile int f2 = 7; @@ -103,7 +104,8 @@ class Tests static int methodResult = 100; - public static int Main() + [Fact] + public static int TestEntryPoint() { AllocationKind expectedAllocationKind = AllocationKind.Stack; if (GCStressEnabled()) { diff --git a/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.csproj b/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.csproj index fd0e1261b0905..4cbcbd0da97cd 100644 --- a/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.csproj +++ b/src/tests/JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/OptimizeBools/optboolsreturn.cs b/src/tests/JIT/opt/OptimizeBools/optboolsreturn.cs index 2144be73aedca..a3c1b7c84f542 100644 --- a/src/tests/JIT/opt/OptimizeBools/optboolsreturn.cs +++ b/src/tests/JIT/opt/OptimizeBools/optboolsreturn.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class CBoolTest { @@ -191,7 +192,8 @@ private static bool IsEitherNonZero(int x, int y) return b; } - public static int Main() + [Fact] + public static int TestEntryPoint() { // Optimize boolean diff --git a/src/tests/JIT/opt/OptimizeBools/optboolsreturn.csproj b/src/tests/JIT/opt/OptimizeBools/optboolsreturn.csproj index 5e5fbae5cb863..b47c3e8e8d9f5 100644 --- a/src/tests/JIT/opt/OptimizeBools/optboolsreturn.csproj +++ b/src/tests/JIT/opt/OptimizeBools/optboolsreturn.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Or/IntOr.cs b/src/tests/JIT/opt/Or/IntOr.cs index 7ea7d89b76f2b..620ab4fe9c83e 100644 --- a/src/tests/JIT/opt/Or/IntOr.cs +++ b/src/tests/JIT/opt/Or/IntOr.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - class IntOr + public class IntOr { [MethodImpl(MethodImplOptions.NoInlining)] static void SideEffect() @@ -45,7 +46,8 @@ public static bool Test_UInt32_ByRef_CastByte_CastByte_Or(uint x, ref uint y) return false; } - static int Main() + [Fact] + public static int TestEntryPoint() { uint leftMostBit = 0b10000000000000000000000000000000; uint rightMostBit = 0b00000000000000000000000000000001; diff --git a/src/tests/JIT/opt/Or/IntOr.csproj b/src/tests/JIT/opt/Or/IntOr.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Or/IntOr.csproj +++ b/src/tests/JIT/opt/Or/IntOr.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/RangeChecks/ModLength.cs b/src/tests/JIT/opt/RangeChecks/ModLength.cs index 765a99dd7d85d..8a7e582119224 100644 --- a/src/tests/JIT/opt/RangeChecks/ModLength.cs +++ b/src/tests/JIT/opt/RangeChecks/ModLength.cs @@ -3,10 +3,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class ModLength { - public static int Main() + [Fact] + public static int TestEntryPoint() { Throws(() => Test1(new int[0], 0)); Throws(() => Test2(new int[0], 1)); diff --git a/src/tests/JIT/opt/RangeChecks/ModLength.csproj b/src/tests/JIT/opt/RangeChecks/ModLength.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/RangeChecks/ModLength.csproj +++ b/src/tests/JIT/opt/RangeChecks/ModLength.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.cs b/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.cs index c8dcb6087e290..6761c6b9b07e9 100644 --- a/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.cs +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class RedundantBranchAnd +public class RedundantBranchAnd { [MethodImpl(MethodImplOptions.NoInlining)] static int And_00(int a, int b) @@ -116,7 +117,8 @@ static int And_06(int a, int b) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Func[] funcs = {And_00, And_01, And_02, And_03, And_04, And_05, And_06}; int funcNum = 0; diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.csproj b/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.csproj +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchAnd.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.cs b/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.cs index 250ba021a1a31..d5525fa0a6930 100644 --- a/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.cs +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.cs @@ -3,8 +3,9 @@ using System; using System.Runtime.CompilerServices; +using Xunit; -class RedundantBranchOr +public class RedundantBranchOr { [MethodImpl(MethodImplOptions.NoInlining)] static int Or_00(int a, int b) @@ -112,7 +113,8 @@ static int Or_06(int a, int b) return 3; } - public static int Main() + [Fact] + public static int TestEntryPoint() { Func[] funcs = {Or_00, Or_01, Or_02, Or_03, Or_04, Or_05, Or_06}; int funcNum = 0; diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.csproj b/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.csproj +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchOr.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.cs b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.cs index 788d487af22b2..85384ca866b8e 100644 --- a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.cs +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Runtime 65327 // M1 and M2 should generate the same code @@ -31,7 +32,8 @@ public ReadOnlySpan M2(ReadOnlySpan span, int i) return default; } - public static int Main() + [Fact] + public static int TestEntryPoint() { var rbu = new RedundantBranchUnsigned(); var m1 = rbu.M1("hello", 2); diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.csproj b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.csproj index 19781e26c20d8..4f39869373b77 100644 --- a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.csproj +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Regressions/Regression1.cs b/src/tests/JIT/opt/Regressions/Regression1_Regressions.cs similarity index 95% rename from src/tests/JIT/opt/Regressions/Regression1.cs rename to src/tests/JIT/opt/Regressions/Regression1_Regressions.cs index d6961c7fd8886..2f188bea997fe 100644 --- a/src/tests/JIT/opt/Regressions/Regression1.cs +++ b/src/tests/JIT/opt/Regressions/Regression1_Regressions.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class C0 { @@ -22,7 +23,8 @@ public class Program public static IRuntime s_rt; public static int[][] s_13 = new int[][] { new int[] { 0 } }; - public static int Main() + [Fact] + public static int TestEntryPoint() { s_rt = new Runtime(); var result = M74(0); diff --git a/src/tests/JIT/opt/Regressions/Regression1.csproj b/src/tests/JIT/opt/Regressions/Regression1_Regressions.csproj similarity index 78% rename from src/tests/JIT/opt/Regressions/Regression1.csproj rename to src/tests/JIT/opt/Regressions/Regression1_Regressions.csproj index c053e59c003e0..22f18fe8c30dd 100644 --- a/src/tests/JIT/opt/Regressions/Regression1.csproj +++ b/src/tests/JIT/opt/Regressions/Regression1_Regressions.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/Regressions/Regression2.cs b/src/tests/JIT/opt/Regressions/Regression2_Regressions.cs similarity index 96% rename from src/tests/JIT/opt/Regressions/Regression2.cs rename to src/tests/JIT/opt/Regressions/Regression2_Regressions.cs index 5e8f36a4730ab..3ab65fd374720 100644 --- a/src/tests/JIT/opt/Regressions/Regression2.cs +++ b/src/tests/JIT/opt/Regressions/Regression2_Regressions.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { @@ -60,7 +61,8 @@ static void Div_SmallType_Correctness(int i, int j) } } - static int Main() + [Fact] + public static int TestEntryPoint() { Add_SmallType_Correctness(); Sub_SmallType_Correctness(); diff --git a/src/tests/JIT/opt/Regressions/Regression2.csproj b/src/tests/JIT/opt/Regressions/Regression2_Regressions.csproj similarity index 91% rename from src/tests/JIT/opt/Regressions/Regression2.csproj rename to src/tests/JIT/opt/Regressions/Regression2_Regressions.csproj index 675d36d50e8db..62c39f42fd674 100644 --- a/src/tests/JIT/opt/Regressions/Regression2.csproj +++ b/src/tests/JIT/opt/Regressions/Regression2_Regressions.csproj @@ -1,6 +1,5 @@ - Exe true diff --git a/src/tests/JIT/opt/Regressions/Regression3.cs b/src/tests/JIT/opt/Regressions/Regression3_Regressions.cs similarity index 86% rename from src/tests/JIT/opt/Regressions/Regression3.cs rename to src/tests/JIT/opt/Regressions/Regression3_Regressions.cs index 78b6910c0c8db..b2f853c0a0afb 100644 --- a/src/tests/JIT/opt/Regressions/Regression3.cs +++ b/src/tests/JIT/opt/Regressions/Regression3_Regressions.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class C1 { @@ -21,7 +22,8 @@ public class Program public static bool s_25; public static short[] s_42; public static S0[][] s_43 = new S0[][]{new S0[]{new S0()}}; - public static int Main() + [Fact] + public static int TestEntryPoint() { CollectibleALC alc = new CollectibleALC(); System.Reflection.Assembly asm = alc.LoadFromAssemblyPath(System.Reflection.Assembly.GetExecutingAssembly().Location); @@ -31,6 +33,7 @@ public static int Main() return 100; } +#pragma warning disable xUnit1013 public static void MainInner(IRuntime rt) { s_rt = rt; @@ -39,12 +42,13 @@ public static void MainInner(IRuntime rt) bool vr10 = vr8.F2 == vr8.F2; M6(vr3, vr10); } +#pragma warning restore xUnit1013 - public static void M60(ref sbyte arg1, ref short[] arg2) + internal static void M60(ref sbyte arg1, ref short[] arg2) { } - public static void M6(C1 argThis, bool arg0) + internal static void M6(C1 argThis, bool arg0) { arg0 = s_25; M60(ref argThis.F1, ref s_42); diff --git a/src/tests/JIT/opt/Regressions/Regression3.csproj b/src/tests/JIT/opt/Regressions/Regression3_Regressions.csproj similarity index 91% rename from src/tests/JIT/opt/Regressions/Regression3.csproj rename to src/tests/JIT/opt/Regressions/Regression3_Regressions.csproj index 675d36d50e8db..62c39f42fd674 100644 --- a/src/tests/JIT/opt/Regressions/Regression3.csproj +++ b/src/tests/JIT/opt/Regressions/Regression3_Regressions.csproj @@ -1,6 +1,5 @@ - Exe true diff --git a/src/tests/JIT/opt/Regressions/Regression4.cs b/src/tests/JIT/opt/Regressions/Regression4.cs index b39ff25e82933..06c495bd9fba9 100644 --- a/src/tests/JIT/opt/Regressions/Regression4.cs +++ b/src/tests/JIT/opt/Regressions/Regression4.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { @@ -10,7 +11,8 @@ public class Program public static int s_58; public static uint s_66; public static byte[] s_126 = new byte[] { 0 }; - public static int Main() + [Fact] + public static int TestEntryPoint() { CollectibleALC alc = new CollectibleALC(); System.Reflection.Assembly asm = alc.LoadFromAssemblyPath(System.Reflection.Assembly.GetExecutingAssembly().Location); @@ -33,7 +35,7 @@ public static int MainInner(IRuntime rt) return s_rt.Count; } - public static void M59(byte arg2, bool arg3, ref uint arg4) + internal static void M59(byte arg2, bool arg3, ref uint arg4) { for (int var0 = 0; var0 < 2; var0++) { diff --git a/src/tests/JIT/opt/Regressions/Regression4.csproj b/src/tests/JIT/opt/Regressions/Regression4.csproj index 675d36d50e8db..62c39f42fd674 100644 --- a/src/tests/JIT/opt/Regressions/Regression4.csproj +++ b/src/tests/JIT/opt/Regressions/Regression4.csproj @@ -1,6 +1,5 @@ - Exe true diff --git a/src/tests/JIT/opt/Regressions/Regression5.cs b/src/tests/JIT/opt/Regressions/Regression5.cs index 346b2503ef34e..7cd4e5ca50dd0 100644 --- a/src/tests/JIT/opt/Regressions/Regression5.cs +++ b/src/tests/JIT/opt/Regressions/Regression5.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class Program { @@ -10,7 +11,8 @@ public class Program public static bool[,] s_32 = new bool[,] { { false } }; public static sbyte[] s_53 = new sbyte[] { 0 }; public static ushort s_62; - public static int Main() + [Fact] + public static int TestEntryPoint() { s_rt = new Runtime(); var vr9 = s_32[0, 0]; diff --git a/src/tests/JIT/opt/Regressions/Regression5.csproj b/src/tests/JIT/opt/Regressions/Regression5.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Regressions/Regression5.csproj +++ b/src/tests/JIT/opt/Regressions/Regression5.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Regressions/Regression6.cs b/src/tests/JIT/opt/Regressions/Regression6.cs index f19dd733cc3a0..ac5014c129dee 100644 --- a/src/tests/JIT/opt/Regressions/Regression6.cs +++ b/src/tests/JIT/opt/Regressions/Regression6.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2023-02-26 16:54:59 // Run on X64 Linux // Seed: 15812590312404596729 @@ -18,7 +19,8 @@ public class Program { public static ushort s_2; public static C0 s_7; - public static int Main() + [Fact] + public static int TestEntryPoint() { ulong result = 1234; for (int vr0 = 0; vr0 < 2; vr0++) diff --git a/src/tests/JIT/opt/Regressions/Regression6.csproj b/src/tests/JIT/opt/Regressions/Regression6.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Regressions/Regression6.csproj +++ b/src/tests/JIT/opt/Regressions/Regression6.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Regressions/Regression7.cs b/src/tests/JIT/opt/Regressions/Regression7.cs index da4ba23bebe32..f17c33a297871 100644 --- a/src/tests/JIT/opt/Regressions/Regression7.cs +++ b/src/tests/JIT/opt/Regressions/Regression7.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; // Generated by Fuzzlyn v1.5 on 2023-03-19 17:44:38 // Run on Arm64 Linux // Seed: 516098027771570682 @@ -16,7 +17,8 @@ public C0(uint f1) public class Program { // This test was testing an ARM64 regression when optimizing 'x < 0' when it didn't take into account an unsigned operation. - public static int Main() + [Fact] + public static int TestEntryPoint() { var vr1 = new C0(4294967295U); bool vr3 = !(vr1.F1 > -1); diff --git a/src/tests/JIT/opt/Regressions/Regression7.csproj b/src/tests/JIT/opt/Regressions/Regression7.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Regressions/Regression7.csproj +++ b/src/tests/JIT/opt/Regressions/Regression7.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Remainder/IntRemainder.cs b/src/tests/JIT/opt/Remainder/IntRemainder.cs index cf5c37e9465ab..8d3cb3cf52010 100644 --- a/src/tests/JIT/opt/Remainder/IntRemainder.cs +++ b/src/tests/JIT/opt/Remainder/IntRemainder.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - static class IntRemainder + public static class IntRemainder { static int _fieldValue = 123; static uint _fieldValueUnsigned = 123; @@ -71,7 +72,8 @@ static byte Byte_RemainderByMaxValuePlusOne_WithField() return (byte)(_fieldValueUnsigned % (Byte.MaxValue + 1)); } - static int Main() + [Fact] + public static int TestEntryPoint() { if (Int32_RemainderByOneWithValue(-123) != 0) return 0; diff --git a/src/tests/JIT/opt/Remainder/IntRemainder.csproj b/src/tests/JIT/opt/Remainder/IntRemainder.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Remainder/IntRemainder.csproj +++ b/src/tests/JIT/opt/Remainder/IntRemainder.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.cs b/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.cs index 1cb829af3de5b..7a025624267b2 100644 --- a/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.cs +++ b/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.cs @@ -1,10 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Xunit; public class Program { public static ulong[,] s_1; - public static int Main() + [Fact] + public static int TestEntryPoint() { // This should not assert. try diff --git a/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.csproj b/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.csproj +++ b/src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Structs/structcopies.cs b/src/tests/JIT/opt/Structs/structcopies.cs index f36443fcee183..8abde404e7eca 100644 --- a/src/tests/JIT/opt/Structs/structcopies.cs +++ b/src/tests/JIT/opt/Structs/structcopies.cs @@ -10,11 +10,12 @@ using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; using System.Numerics; +using Xunit; namespace TestStructFields { - class Program + public class Program { [MethodImpl(MethodImplOptions.NoInlining)] static void blockPromotion(ref T s) @@ -1713,7 +1714,8 @@ static int Test() return 100; } - static int Main() + [Fact] + public static int TestEntryPoint() { return Test(); } diff --git a/src/tests/JIT/opt/Structs/structcopies.csproj b/src/tests/JIT/opt/Structs/structcopies.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Structs/structcopies.csproj +++ b/src/tests/JIT/opt/Structs/structcopies.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Structs/structpop.cs b/src/tests/JIT/opt/Structs/structpop.cs index 2cc7b687f3d25..d77552aa04149 100644 --- a/src/tests/JIT/opt/Structs/structpop.cs +++ b/src/tests/JIT/opt/Structs/structpop.cs @@ -9,6 +9,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; [StructLayout(LayoutKind.Sequential)] struct VT @@ -26,7 +27,7 @@ public void Get(out int v1, out int v2, out int v3) } } -class P +public class P { [MethodImpl(MethodImplOptions.NoInlining)] unsafe static int TestMethodInlining(VT* pVT) @@ -56,7 +57,8 @@ unsafe static int TestByPtr(VT* pVT) return Do(v1, v2); } - unsafe static int Main() + [Fact] + public unsafe static int TestEntryPoint() { byte* pDataBytes = stackalloc byte[VT.Size]; VT* pVT = (VT*)pDataBytes; diff --git a/src/tests/JIT/opt/Structs/structpop.csproj b/src/tests/JIT/opt/Structs/structpop.csproj index d10bfcb76e2c0..ec9fd3dcf66cd 100644 --- a/src/tests/JIT/opt/Structs/structpop.csproj +++ b/src/tests/JIT/opt/Structs/structpop.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Structs/structpop2.cs b/src/tests/JIT/opt/Structs/structpop2.cs index 2e8666e9e544f..6eb93ecc11e4d 100644 --- a/src/tests/JIT/opt/Structs/structpop2.cs +++ b/src/tests/JIT/opt/Structs/structpop2.cs @@ -9,6 +9,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; [StructLayout(LayoutKind.Sequential)] struct VT @@ -18,7 +19,7 @@ struct VT public int F1, F2, F3, F4, F5, F6, F7, F8; } -class P +public class P { [MethodImpl(MethodImplOptions.NoInlining)] static int Do(int v1) @@ -42,7 +43,8 @@ unsafe static int TestByPtr(VT* pVT) return Do(v1); } - unsafe static int Main() + [Fact] + public unsafe static int TestEntryPoint() { byte* pDataBytes = stackalloc byte[VT.Size]; VT* pVT = (VT*)pDataBytes; diff --git a/src/tests/JIT/opt/Structs/structpop2.csproj b/src/tests/JIT/opt/Structs/structpop2.csproj index f2bc39e7e390e..5ceefff174a17 100644 --- a/src/tests/JIT/opt/Structs/structpop2.csproj +++ b/src/tests/JIT/opt/Structs/structpop2.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Subtract/IntSubtract.cs b/src/tests/JIT/opt/Subtract/IntSubtract.cs index fd9e8042beda1..fc133e2518bcd 100644 --- a/src/tests/JIT/opt/Subtract/IntSubtract.cs +++ b/src/tests/JIT/opt/Subtract/IntSubtract.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - static class IntSubtract + public static class IntSubtract { [MethodImpl(MethodImplOptions.NoInlining)] static sbyte Int8_Subtract(sbyte x, sbyte y) @@ -102,7 +103,8 @@ static ulong UInt64_Subtract(ulong x, ulong y) return x - y; } - static int Main() + [Fact] + public static int TestEntryPoint() { // Int8 if (Int8_Subtract(SByte.MinValue, 15) != 113) diff --git a/src/tests/JIT/opt/Subtract/IntSubtract.csproj b/src/tests/JIT/opt/Subtract/IntSubtract.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Subtract/IntSubtract.csproj +++ b/src/tests/JIT/opt/Subtract/IntSubtract.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.cs b/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.cs index 0481a75edb65f..8c4b5456645d9 100644 --- a/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.cs +++ b/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Test case showing that we can have "more complex" // IR after a tail call if we do early flow opts. @@ -11,7 +12,7 @@ interface IX { } -class X : IX +public class X : IX { [MethodImpl(MethodImplOptions.NoInlining)] bool P1(object o) => false; @@ -85,7 +86,8 @@ bool F0(object o) // This stops F0 from being inlined [MethodImpl(MethodImplOptions.NoOptimization)] - public static int Main() + [Fact] + public static int TestEntryPoint() { X x = new X(); bool b = x.F0(x); diff --git a/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.csproj b/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.csproj +++ b/src/tests/JIT/opt/Tailcall/EarlyFlowOptExample.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.cs b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.cs index 3f627a772174d..6783c9fe4236e 100644 --- a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.cs +++ b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // Tail calls with implicit byref parameters as arguments. // @@ -11,7 +12,7 @@ public class ImplicitByrefTailCalls { - public static void Z() { } + internal static void Z() { } public static bool Z(bool b) => b; [MethodImpl(MethodImplOptions.NoOptimization)] @@ -205,7 +206,8 @@ public static int N(Span x) static bool p; - public static int Main() + [Fact] + public static int TestEntryPoint() { int[] a = new int[100]; a[45] = 55; diff --git a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.csproj b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.csproj index bf6f589eb325b..f5f3ecae247d5 100644 --- a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.csproj +++ b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCalls.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.cs b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.cs index e35e06dd7d5cf..9c629b46b3f1d 100644 --- a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.cs +++ b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public struct S { @@ -24,7 +25,7 @@ public struct R public class ImplicitByrefTailCalls { // Helper method to make callees unattractive for inlining. - public static void Z() { } + internal static void Z() { } // Will return different answers if x and y refer to the same struct. [MethodImpl(MethodImplOptions.NoOptimization)] @@ -236,7 +237,8 @@ public static long L(S s) return Alias7(s, ref s); } - public static int Main() + [Fact] + public static int TestEntryPoint() { S s = new S(); s.s_x = 1; diff --git a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.csproj b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.csproj index bf6f589eb325b..f5f3ecae247d5 100644 --- a/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.csproj +++ b/src/tests/JIT/opt/Tailcall/ImplicitByrefTailCallsAliasing.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il b/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il index a7cba49915e88..f2fadbbb666e4 100644 --- a/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il +++ b/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il @@ -4,7 +4,6 @@ // Metadata version: v2.0.50727 -.module extern libc .assembly extern mscorlib { } .assembly extern xunit.core {} @@ -13,11 +12,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly extern System.Runtime -{ - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) - .ver 4:2:1:0 -} +.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } .assembly extern System.Runtime.Extensions { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -60,7 +55,6 @@ .hash algorithm 0x00008004 .ver 1:0:0:0 } -.module TailcallVerifyWithPrefix.exe // MVID: {D1242658-CA16-4D11-A740-6635F112F4B5} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .imagebase 0x00400000 @@ -1412,7 +1406,7 @@ } // end of class TailcallVerify.MyCompare -.class private auto ansi beforefieldinit TailcallVerify.Program +.class public auto ansi beforefieldinit TailcallVerify.Program extends [mscorlib]System.Object { .field private static int32 result @@ -2250,7 +2244,7 @@ IL_07ab: ret } // end of method Program::Run - .method private hidebysig static int32 + .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( diff --git a/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.ilproj b/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.ilproj index 69c53a3d21497..fbf5d60675718 100644 --- a/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.ilproj +++ b/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.ilproj @@ -1,6 +1,7 @@ - Exe + + true true diff --git a/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.cs b/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.cs index c6b0e9e527f14..3962acb1cc2a3 100644 --- a/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.cs +++ b/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using Xunit; public class ProgramException : Exception {} @@ -155,7 +156,8 @@ private static IntPtr TestTailCall3() return GetPtr(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { foreach (var method in typeof(Program) .GetMethods(BindingFlags.Static | BindingFlags.NonPublic) diff --git a/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.csproj b/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.csproj index 3430940509932..ec3d281f2ec27 100644 --- a/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.csproj +++ b/src/tests/JIT/opt/ThrowHelper/NonVoidThrowHelper.csproj @@ -1,6 +1,5 @@ - Exe True true diff --git a/src/tests/JIT/opt/ThrowHelper/ThrowHelper.cs b/src/tests/JIT/opt/ThrowHelper/ThrowHelper.cs index 4ee35575c9195..b42b9ab92b21c 100644 --- a/src/tests/JIT/opt/ThrowHelper/ThrowHelper.cs +++ b/src/tests/JIT/opt/ThrowHelper/ThrowHelper.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Xunit; class TestException : Exception { @@ -14,7 +15,7 @@ public TestException() {} public TestException(string _y) { y = _y; } } -class TestCases +public class TestCases { static void Throw() => throw new TestException(); static void Throw(int x) => throw new TestException(x); @@ -41,7 +42,7 @@ public static int OneThrowHelper(int x) return x; } - public static void OneThrowHelperTail(int x) + internal static void OneThrowHelperTail(int x) { if (x > 0) { @@ -106,7 +107,7 @@ public static int TwoIdenticalThrowHelpers_If(int x) return x; } - public static void TwoIdenticalThrowHelpers_IfOneTail(int x) + internal static void TwoIdenticalThrowHelpers_IfOneTail(int x) { if (x == 0) { @@ -120,7 +121,7 @@ public static void TwoIdenticalThrowHelpers_IfOneTail(int x) } } - public static void TwoIdenticalThrowHelpers_IfTwoTail(int x) + internal static void TwoIdenticalThrowHelpers_IfTwoTail(int x) { if (x == 0) { @@ -135,7 +136,7 @@ public static void TwoIdenticalThrowHelpers_IfTwoTail(int x) } } - public static int ThreeIdenticalThrowHelpers_If(int x) + internal static int ThreeIdenticalThrowHelpers_If(int x) { if (x == 0) { @@ -155,7 +156,7 @@ public static int ThreeIdenticalThrowHelpers_If(int x) return x; } - public static void ThreeIdenticalThrowHelpers_IfOneTail(int x) + internal static void ThreeIdenticalThrowHelpers_IfOneTail(int x) { if (x == 0) { @@ -174,7 +175,7 @@ public static void ThreeIdenticalThrowHelpers_IfOneTail(int x) } } - public static void ThreeIdenticalThrowHelpers_IfTwoTail(int x) + internal static void ThreeIdenticalThrowHelpers_IfTwoTail(int x) { if (x == 0) { @@ -194,7 +195,7 @@ public static void ThreeIdenticalThrowHelpers_IfTwoTail(int x) } } - public static void ThreeIdenticalThrowHelpers_IfThreeTail(int x) + internal static void ThreeIdenticalThrowHelpers_IfThreeTail(int x) { if (x == 0) { @@ -236,7 +237,7 @@ public static int TwoIdenticalThrowHelpers_Goto(int x) return x; } - public static void TwoIdenticalThrowHelpers_GotoOneTail(int x) + internal static void TwoIdenticalThrowHelpers_GotoOneTail(int x) { if (x == 0) { @@ -256,7 +257,7 @@ public static void TwoIdenticalThrowHelpers_GotoOneTail(int x) Throw(); } - public static void TwoIdenticalThrowHelpers_GotoTwoTail(int x) + internal static void TwoIdenticalThrowHelpers_GotoTwoTail(int x) { if (x == 0) { @@ -297,7 +298,7 @@ public static int TwoIdenticalThrowHelpers_Switch(int x) return x; } - public static void TwoIdenticalThrowHelpers_SwitchOneTail(int x) + internal static void TwoIdenticalThrowHelpers_SwitchOneTail(int x) { switch (x) { @@ -315,7 +316,7 @@ public static void TwoIdenticalThrowHelpers_SwitchOneTail(int x) } } - public static void TwoIdenticalThrowHelpers_SwitchTwoTail(int x) + internal static void TwoIdenticalThrowHelpers_SwitchTwoTail(int x) { switch (x) { @@ -358,7 +359,7 @@ public static int TwoIdenticalThrowHelpers_SwitchGoto(int x) return x; } - public static void TwoIdenticalThrowHelpers_SwitchGotoOneTail(int x) + internal static void TwoIdenticalThrowHelpers_SwitchGotoOneTail(int x) { switch (x) { @@ -381,7 +382,7 @@ public static void TwoIdenticalThrowHelpers_SwitchGotoOneTail(int x) Throw(); } - public static void TwoIdenticalThrowHelpers_SwitchGotoTwoTail(int x) + internal static void TwoIdenticalThrowHelpers_SwitchGotoTwoTail(int x) { switch (x) { @@ -505,7 +506,8 @@ static void Try(Action f) } } - public static int Main() + [Fact] + public static int TestEntryPoint() { Try(OneThrowHelper); Try(OneThrowHelperTail); diff --git a/src/tests/JIT/opt/ThrowHelper/ThrowHelper.csproj b/src/tests/JIT/opt/ThrowHelper/ThrowHelper.csproj index eae6f85785aab..e864e4fa5a45e 100644 --- a/src/tests/JIT/opt/ThrowHelper/ThrowHelper.csproj +++ b/src/tests/JIT/opt/ThrowHelper/ThrowHelper.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.cs b/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.cs index eddab2081a5cf..fcdd91e6a002e 100644 --- a/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.cs +++ b/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.cs @@ -2,20 +2,22 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; // Test case where throw helper is in the try entry block. // // Throw helper merging is run lexically backwards, // so the optimization may introduce a jump into the middle of the try. -class ThrowHelperAtTryEntry +public class ThrowHelperAtTryEntry { static void ThrowHelper() { throw new Exception(); } - public static int Main() + [Fact] + public static int TestEntryPoint() { int x = 0; bool p = true; diff --git a/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.csproj b/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.csproj index 4202eda08a014..51cb432860796 100644 --- a/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.csproj +++ b/src/tests/JIT/opt/ThrowHelper/ThrowHelperAtTryEntry.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Types/Equality.cs b/src/tests/JIT/opt/Types/Equality.cs index 41665ba8d46b6..1dc46ae19c084 100644 --- a/src/tests/JIT/opt/Types/Equality.cs +++ b/src/tests/JIT/opt/Types/Equality.cs @@ -4,12 +4,13 @@ // Optimization of type equality tests using System; +using Xunit; struct Wrap1 {} struct Wrap2 {} -class EqualityTests +public class EqualityTests { static bool IsInt() { @@ -51,7 +52,8 @@ static bool IsWrap1(U u) return (u.GetType() == typeof(Wrap1)); } - public static int Main() + [Fact] + public static int TestEntryPoint() { // Fully optimized bool c1 = IsInt(); diff --git a/src/tests/JIT/opt/Types/Equality.csproj b/src/tests/JIT/opt/Types/Equality.csproj index d2c1596b56a29..039f8eb0d3c80 100644 --- a/src/tests/JIT/opt/Types/Equality.csproj +++ b/src/tests/JIT/opt/Types/Equality.csproj @@ -1,7 +1,4 @@ - - Exe - PdbOnly True diff --git a/src/tests/JIT/opt/Unsafe/Unsafe.cs b/src/tests/JIT/opt/Unsafe/Unsafe.cs index dd9134b5125cc..b0c8296b2fc29 100644 --- a/src/tests/JIT/opt/Unsafe/Unsafe.cs +++ b/src/tests/JIT/opt/Unsafe/Unsafe.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - class UnsafeTests + public class UnsafeTests { [MethodImpl(MethodImplOptions.NoInlining)] static byte UnsafeAsNarrowCast_Short(short value) @@ -29,7 +30,8 @@ static byte UnsafeAsNarrowCast_Long(long value) return Unsafe.As(ref value); } - static int Main() + [Fact] + public static int TestEntryPoint() { if (UnsafeAsNarrowCast_Short(255) != 255) return 0; diff --git a/src/tests/JIT/opt/Unsafe/Unsafe.csproj b/src/tests/JIT/opt/Unsafe/Unsafe.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/Unsafe/Unsafe.csproj +++ b/src/tests/JIT/opt/Unsafe/Unsafe.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.cs b/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.cs index e16edb9f1a67b..f2a36b65fd08e 100644 --- a/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.cs +++ b/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.cs @@ -6,10 +6,12 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; -class RvaTests +public class RvaTests { - static int Main() + [Fact] + public static int TestEntryPoint() { if (!BitConverter.IsLittleEndian) { diff --git a/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.csproj b/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.csproj +++ b/src/tests/JIT/opt/ValueNumbering/ConstIndexRVA.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.cs b/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.cs index 6c9edbf97606a..bfa97327cff0f 100644 --- a/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.cs +++ b/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; public static class ConstStringConstIndexOptimizations { @@ -101,7 +102,8 @@ static void AssertEquals(int expected, int actual) throw new InvalidOperationException(); } - static int Main() + [Fact] + public static int TestEntryPoint() { for (int i = 0; i < 100; i++) { diff --git a/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.csproj b/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.csproj index 9d5af3bce3d89..b38e191bc3652 100644 --- a/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.csproj +++ b/src/tests/JIT/opt/ValueNumbering/ConstStringConstIndexOptimizations.csproj @@ -1,6 +1,7 @@ - Exe + + true True diff --git a/src/tests/JIT/opt/ValueNumbering/ExceptionSets.cs b/src/tests/JIT/opt/ValueNumbering/ExceptionSets.cs index 6a413303ad194..0e6afca29a463 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExceptionSets.cs +++ b/src/tests/JIT/opt/ValueNumbering/ExceptionSets.cs @@ -3,12 +3,14 @@ using System; using System.Runtime.CompilerServices; +using Xunit; #pragma warning disable CS0253 // Possible unintended reference comparison -class ExceptionSets +public class ExceptionSets { - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/ValueNumbering/ExceptionSets.csproj b/src/tests/JIT/opt/ValueNumbering/ExceptionSets.csproj index 5d8fe22529764..377bf381b5286 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExceptionSets.csproj +++ b/src/tests/JIT/opt/ValueNumbering/ExceptionSets.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.cs b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.cs index 103f6b6c8547c..e3b9897da7533 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.cs +++ b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.cs @@ -4,12 +4,14 @@ using System; using System.Runtime.Intrinsics; using System.Runtime.CompilerServices; +using Xunit; // We're testing whether HWI nodes with > 2 operands propagate exception sets correctly. // -class ExceptionSetsPropagation_Hwi +public class ExceptionSetsPropagation_Hwi { - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.csproj b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.csproj index 5d8fe22529764..377bf381b5286 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.csproj +++ b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_Hwi.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.il b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.il index 312eb5dcb545e..fff83c618bd1e 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.il +++ b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.il @@ -2,12 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern xunit.core { } -.assembly extern System.Runtime { } +.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } .assembly extern System.Console { } .assembly ExceptionSetsPropagation_LclHeap { } -.class ExceptionSetsPropagation_LclHeap extends [System.Runtime]System.Object +.class public ExceptionSetsPropagation_LclHeap extends [System.Runtime]System.Object { .method public static int32 Main() { diff --git a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.ilproj b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.ilproj index 477cccfe1def0..5416dc703fa32 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.ilproj +++ b/src/tests/JIT/opt/ValueNumbering/ExceptionSetsPropagation_LclHeap.ilproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.cs b/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.cs index 2a8ec03602ce5..07bfb3d77f842 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.cs +++ b/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.cs @@ -5,14 +5,16 @@ using System.Threading; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using Xunit; -unsafe class ExposedLocalsNumbering +public unsafe class ExposedLocalsNumbering { private static volatile bool s_mutateIndex; private static volatile bool s_finished; private static int* s_pIndex = (int*)NativeMemory.Alloc(4); - public static int Main() + [Fact] + public static int TestEntryPoint() { const int RetryCount = 100; const int UnsafeIndex = 1; diff --git a/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.csproj b/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.csproj index cea65d9a7598c..0150c65d7188c 100644 --- a/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.csproj +++ b/src/tests/JIT/opt/ValueNumbering/ExposedLocalsNumbering.csproj @@ -1,6 +1,7 @@ - Exe + + true None True true diff --git a/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.cs b/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.cs index b8227ece73c1f..8907181d7e1ec 100644 --- a/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.cs +++ b/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.cs @@ -4,10 +4,12 @@ using System; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; -class StaticReadonlyStructWithGC +public class StaticReadonlyStructWithGC { - static int Main() + [Fact] + public static int TestEntryPoint() { // Pre-initialize host type RuntimeHelpers.RunClassConstructor(typeof(StaticReadonlyStructWithGC).TypeHandle); diff --git a/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.csproj b/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.csproj +++ b/src/tests/JIT/opt/ValueNumbering/StaticReadonlyStructWithGC.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.cs b/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.cs index 3041e558c9a22..4d6b07dd836b1 100644 --- a/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.cs +++ b/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.cs @@ -4,11 +4,12 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using Xunit; public enum Enum1 : int { A } public enum Enum2 : uint { A } -class TypeTestFolding +public class TypeTestFolding { [MethodImpl(MethodImplOptions.NoInlining)] static void SideEffect() { } @@ -130,7 +131,8 @@ static bool False15() // return t0 == t1; //} - unsafe static int Main() + [Fact] + public unsafe static int TestEntryPoint() { delegate*[] trueFuncs = new delegate*[] { &True2, &True3, &True4, &True5 }; delegate*[] falseFuncs = new delegate*[] { &False0, &False1, &False2, &False3, &False4, &False5, diff --git a/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.csproj b/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.csproj index bf6f589eb325b..f5f3ecae247d5 100644 --- a/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.csproj +++ b/src/tests/JIT/opt/ValueNumbering/TypeTestFolding.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.cs b/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.cs index 3ef8c35aba6e6..a6bffe482cdda 100644 --- a/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.cs +++ b/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.cs @@ -4,12 +4,14 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using Xunit; -class ZeroOffsetFieldSeqs +public class ZeroOffsetFieldSeqs { private static UnionStruct s_union; - public static int Main() + [Fact] + public static int TestEntryPoint() { if (ProblemWithArrayUnions(new UnionStruct[] { default })) { diff --git a/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.csproj b/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.csproj index f3e1cbd44b404..501217e4d8689 100644 --- a/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.csproj +++ b/src/tests/JIT/opt/ValueNumbering/ZeroOffsetFieldSeqs.csproj @@ -1,7 +1,4 @@ - - Exe - None True diff --git a/src/tests/JIT/opt/Vectorization/BufferMemmove.cs b/src/tests/JIT/opt/Vectorization/BufferMemmove.cs index c8757a3cd1d41..596348845ec10 100644 --- a/src/tests/JIT/opt/Vectorization/BufferMemmove.cs +++ b/src/tests/JIT/opt/Vectorization/BufferMemmove.cs @@ -4,10 +4,12 @@ using System; using System.Linq; using System.Runtime.CompilerServices; +using Xunit; -unsafe class BufferMemmoveUnrolling +public unsafe class BufferMemmoveUnrolling { - static int Main() + [Fact] + public static int TestEntryPoint() { // Carefully test 0..32 TestMemmove((dst, src) => src.AsSpan(0, 0).CopyTo(dst), (dst, src) => src.AsSpan(0, ToVar(0)).CopyTo(dst)); diff --git a/src/tests/JIT/opt/Vectorization/BufferMemmove.csproj b/src/tests/JIT/opt/Vectorization/BufferMemmove.csproj index 8c7132fd350c9..a4cc9d0594f93 100644 --- a/src/tests/JIT/opt/Vectorization/BufferMemmove.csproj +++ b/src/tests/JIT/opt/Vectorization/BufferMemmove.csproj @@ -1,6 +1,5 @@ - Exe True True diff --git a/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.il b/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.il index 508516234efd5..068f11ad7b617 100644 --- a/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.il +++ b/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.il @@ -1,9 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -.assembly extern System.Runtime {} +.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } +.assembly extern xunit.core {} .assembly extern System.Runtime.Extensions {} -.assembly TailCallBufferMemmoveTests { +.assembly BufferMemmoveTailCall { // Allow access to private members of System.Private.CoreLib .custom instance void System.Runtime.CompilerServices.IgnoresAccessChecksToAttribute::.ctor(string) = ( 01 00 16 53 79 73 74 65 6d 2e 50 72 69 76 61 74 @@ -14,8 +15,11 @@ .class public abstract auto ansi sealed beforefieldinit TailCallBufferMemmove extends [System.Runtime]System.Object { - .method private hidebysig static int32 Main() cil managed + .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .maxstack 8 .entrypoint diff --git a/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.ilproj b/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.ilproj index 67f9d9446f732..5fa250452852d 100644 --- a/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.ilproj +++ b/src/tests/JIT/opt/Vectorization/BufferMemmoveTailCall.ilproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.cs b/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.cs index 722977a59d37e..32529673daf17 100644 --- a/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.cs +++ b/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.cs @@ -5,10 +5,12 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using Xunit; public class UnrollSequenceEqualTests { - public static int Main() + [Fact] + public static int TestEntryPoint() { var testMethods = typeof(UnrollSequenceEqualTests) .GetMethods(BindingFlags.Static | BindingFlags.NonPublic) diff --git a/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.csproj b/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.csproj index 6946bed81bfd5..de6d5e08882e8 100644 --- a/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.csproj +++ b/src/tests/JIT/opt/Vectorization/SpanHelpers_SequenceEqual.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs b/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs index 1edc21bf1a87e..7e6eeda663298 100644 --- a/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs +++ b/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs @@ -5,16 +5,18 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using Xunit; public unsafe class StackallocTests { - public static int Main() + [Fact] + public static int TestEntryPoint() { int numberOftests = 0; foreach (var method in typeof(StackallocTests) .GetMethods(BindingFlags.Public | BindingFlags.Static) - .Where(t => t.Name.StartsWith("Test"))) + .Where(t => t.Name.StartsWith("Test") && (t.Name != "TestEntryPoint"))) { // Invoke the test and make sure both return value and out // parameters are empty guids diff --git a/src/tests/JIT/opt/Vectorization/StackallocBlkTests.csproj b/src/tests/JIT/opt/Vectorization/StackallocBlkTests.csproj index 615cc6c5fe0c5..195c184f97eb8 100644 --- a/src/tests/JIT/opt/Vectorization/StackallocBlkTests.csproj +++ b/src/tests/JIT/opt/Vectorization/StackallocBlkTests.csproj @@ -1,6 +1,5 @@ - Exe True true false diff --git a/src/tests/JIT/opt/Vectorization/StringEquals.cs b/src/tests/JIT/opt/Vectorization/StringEquals_Vectorization.cs similarity index 99% rename from src/tests/JIT/opt/Vectorization/StringEquals.cs rename to src/tests/JIT/opt/Vectorization/StringEquals_Vectorization.cs index aac0c01d1e3f4..91da52f1cc55c 100644 --- a/src/tests/JIT/opt/Vectorization/StringEquals.cs +++ b/src/tests/JIT/opt/Vectorization/StringEquals_Vectorization.cs @@ -3,10 +3,12 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class StringEquals { - public static int Main() + [Fact] + public static int TestEntryPoint() { int testCount = 0; foreach (var method in typeof(Tests).GetMethods()) diff --git a/src/tests/JIT/opt/Vectorization/StringEquals_Vectorization.csproj b/src/tests/JIT/opt/Vectorization/StringEquals_Vectorization.csproj new file mode 100644 index 0000000000000..de6d5e08882e8 --- /dev/null +++ b/src/tests/JIT/opt/Vectorization/StringEquals_Vectorization.csproj @@ -0,0 +1,8 @@ + + + True + + + + + diff --git a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs index 0b51138f128e5..b1756739bdfbc 100644 --- a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs +++ b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.cs @@ -5,10 +5,12 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using Xunit; public class UnrollEqualsStartsWIth { - public static int Main() + [Fact] + public static int TestEntryPoint() { var testTypes = typeof(UnrollEqualsStartsWIth).Assembly .GetTypes() diff --git a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj index 8d47a4514590e..081a81ffa6625 100644 --- a/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj +++ b/src/tests/JIT/opt/Vectorization/UnrollEqualsStartsWIth.csproj @@ -1,6 +1,5 @@ - Exe True diff --git a/src/tests/JIT/opt/perf/doublealign/Arrays.csproj b/src/tests/JIT/opt/perf/doublealign/Arrays.csproj index 5575799f97244..3dfec14b80d7e 100644 --- a/src/tests/JIT/opt/perf/doublealign/Arrays.csproj +++ b/src/tests/JIT/opt/perf/doublealign/Arrays.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/JIT/opt/perf/doublealign/Locals.csproj b/src/tests/JIT/opt/perf/doublealign/Locals.csproj index 061ccbe2e0741..a16058b171853 100644 --- a/src/tests/JIT/opt/perf/doublealign/Locals.csproj +++ b/src/tests/JIT/opt/perf/doublealign/Locals.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/JIT/opt/perf/doublealign/arrays.cs b/src/tests/JIT/opt/perf/doublealign/arrays.cs index bb264c0ea0f77..623021c9d31bc 100644 --- a/src/tests/JIT/opt/perf/doublealign/arrays.cs +++ b/src/tests/JIT/opt/perf/doublealign/arrays.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class CMyException : System.Exception { @@ -66,7 +67,8 @@ private static unsafe void TestArrays1(int n, double d) } } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/perf/doublealign/locals.cs b/src/tests/JIT/opt/perf/doublealign/locals.cs index 6379f2aa3e64c..726c35215baad 100644 --- a/src/tests/JIT/opt/perf/doublealign/locals.cs +++ b/src/tests/JIT/opt/perf/doublealign/locals.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class CMyException : System.Exception { @@ -109,7 +110,8 @@ private static unsafe void TestLocals2(short a, double b, byte c, double d) UseByte(b1); } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/JIT/opt/perf/doublealign/objects.cs b/src/tests/JIT/opt/perf/doublealign/objects.cs index 6fa1ccacaa240..c14dc8146d36e 100644 --- a/src/tests/JIT/opt/perf/doublealign/objects.cs +++ b/src/tests/JIT/opt/perf/doublealign/objects.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class CMyException : System.Exception { @@ -92,7 +93,8 @@ private static unsafe void TestObjects(short a, double b, byte c, double d) } } - public static int Main() + [Fact] + public static int TestEntryPoint() { TestObjects(1, 2, 3, 4); diff --git a/src/tests/JIT/opt/perf/doublealign/objects.csproj b/src/tests/JIT/opt/perf/doublealign/objects.csproj index 88d618f38c88d..ad9b7cc89269a 100644 --- a/src/tests/JIT/opt/perf/doublealign/objects.csproj +++ b/src/tests/JIT/opt/perf/doublealign/objects.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.cs b/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.cs index d561e4337a4e1..b865ea054424f 100644 --- a/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.cs +++ b/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.cs @@ -7,6 +7,7 @@ // using System; using System.Runtime.CompilerServices; +using Xunit; public class TestClass8505 { static int s_int32_6 = -5; @@ -19,7 +20,7 @@ public sbyte LeafMethod8() return s_sbyte_8 <<= s_int32_6 >>= s_int32_6 ^ (-2 - (s_int32_6 &= -5)) / (-1 * s_int32_6 * (2 ^ -2)) + 77; } } - public void Method0() + internal void Method0() { unchecked { @@ -41,7 +42,8 @@ public void Method0() return; } } - public static int Main() + [Fact] + public static int TestEntryPoint() { TestClass8505 objTestClass8505 = new TestClass8505(); objTestClass8505.Method0(); diff --git a/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.csproj b/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.csproj index e6cddfa42c24e..5c27555eda276 100644 --- a/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.csproj +++ b/src/tests/JIT/opt/perf/doublenegate/GitHub_57470.csproj @@ -1,6 +1,5 @@ - Exe None diff --git a/src/tests/JIT/opt/perf/doublenegate/doublenegate.cs b/src/tests/JIT/opt/perf/doublenegate/doublenegate.cs index 3ceadf2c3ec67..de61c7d3bc792 100644 --- a/src/tests/JIT/opt/perf/doublenegate/doublenegate.cs +++ b/src/tests/JIT/opt/perf/doublenegate/doublenegate.cs @@ -1,14 +1,16 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace coreclr_test_13647 { - class doublenegate + public class doublenegate { static int _dummyValueInt = 6; static double _dummyValueDouble = 6.0; - static int Main() + [Fact] + public static int TestEntryPoint() { if (Test1() && Test2() && Test3()) { Console.WriteLine("PASSED"); diff --git a/src/tests/JIT/opt/perf/doublenegate/doublenegate.csproj b/src/tests/JIT/opt/perf/doublenegate/doublenegate.csproj index dec2a36d39241..1dde7aad8add6 100644 --- a/src/tests/JIT/opt/perf/doublenegate/doublenegate.csproj +++ b/src/tests/JIT/opt/perf/doublenegate/doublenegate.csproj @@ -1,6 +1,5 @@ - Exe None diff --git a/src/tests/JIT/opt/perf/movelim/CalculateChecksum.cs b/src/tests/JIT/opt/perf/movelim/CalculateChecksum.cs index 981ef84923c4c..7b15b570c3cfa 100644 --- a/src/tests/JIT/opt/perf/movelim/CalculateChecksum.cs +++ b/src/tests/JIT/opt/perf/movelim/CalculateChecksum.cs @@ -3,10 +3,11 @@ using System; using System.Runtime.CompilerServices; +using Xunit; namespace CodeGenTests { - static class CalculateChecksumTest + public static class CalculateChecksumTest { [MethodImpl(MethodImplOptions.NoInlining)] public static ushort CalculateChecksum(ref byte buffer, int length) @@ -98,7 +99,8 @@ public static ushort CalculateChecksum(ref byte buffer, int length) // X64-NOT: mov [[REG0:[a-z0-9]+]], [[REG0]] } - static int Main() + [Fact] + public static int TestEntryPoint() { var buffer = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var result = CalculateChecksum(ref buffer[0], buffer.Length); diff --git a/src/tests/JIT/opt/perf/movelim/CalculateChecksum.csproj b/src/tests/JIT/opt/perf/movelim/CalculateChecksum.csproj index 42a89c8384d74..dbc3ab7f2f959 100644 --- a/src/tests/JIT/opt/perf/movelim/CalculateChecksum.csproj +++ b/src/tests/JIT/opt/perf/movelim/CalculateChecksum.csproj @@ -1,6 +1,7 @@ - Exe + + true None diff --git a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl.cs b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl.cs index 6516a8000da06..32fbc6cb18054 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl.cs +++ b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; internal class A { public virtual string f1() { return "A.f1"; } @@ -12010,9 +12011,10 @@ internal class D : C public override string f2998() { return "D.f2998"; } public override string f2999() { return "D.f2999"; } } -internal class CTest +public class CTest { - private static int Main() + [Fact] + public static int TestEntryPoint() { D d = new D(); A a = d; diff --git a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj index 70707e2387edf..56ec63049cceb 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_do.csproj b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_do.csproj index 5b80f8efbf4f4..678da7a02c25b 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_do.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_do.csproj @@ -1,7 +1,4 @@ - - Exe - Full diff --git a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj index 2f94181c369f6..000c91d91ac74 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_ro.csproj b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_ro.csproj index b946bcd1f0b88..7350ddf7a43fc 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_ro.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_ro.csproj @@ -1,7 +1,4 @@ - - Exe - None diff --git a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1.cs b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1.cs index c754a8a1b7062..6554487d59d1b 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1.cs +++ b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1.cs @@ -3,12 +3,14 @@ using System; using System.Collections.Generic; +using Xunit; namespace VirtFunc { - internal class CTest1 + public class CTest1 { - private static int Main() + [Fact] + public static int TestEntryPoint() { Dictionary myHT = new Dictionary(); diff --git a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_d.csproj b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_d.csproj index 1f6e096e6e351..13360ecb64530 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_d.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_d.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_do.csproj b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_do.csproj index c426e7b3f3934..bbd6c5d03c1bf 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_do.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_do.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_r.csproj b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_r.csproj index ee2e0437900c6..7e14fe5f81928 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_r.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_r.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_ro.csproj b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_ro.csproj index b1aae11940a4e..747221ee8bc22 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_ro.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/hashcode/ctest1_cs_ro.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest.cs b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest.cs index 67f96f732c0a0..dcf92a55718d6 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest.cs +++ b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest.cs @@ -2,9 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; namespace VirtFunc { - class CTest : ITest1, ITest2, ITest3, ITest4, ITest5, ITest6, ITest7, ITest8, ITest9, ITest10 + public class CTest : ITest1, ITest2, ITest3, ITest4, ITest5, ITest6, ITest7, ITest8, ITest9, ITest10 { public int f1a() { return 1; } public int f1b(int a) { return 1 + a; } @@ -46,7 +47,8 @@ class CTest : ITest1, ITest2, ITest3, ITest4, ITest5, ITest6, ITest7, ITest8, IT public int f10b(int a) { return 10 + a; } public decimal f10c() { return 10; } public string f10d() { return "10"; } - static int Main() + [Fact] + public static int TestEntryPoint() { CTest c = new CTest(); diff --git a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_d.csproj b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_d.csproj index 64c783454503a..27e383200612c 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_d.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_d.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_do.csproj b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_do.csproj index 285c0cf825a8f..649b161efd34a 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_do.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_do.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_r.csproj b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_r.csproj index 40c6cdc7a877b..e64a247b1e568 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_r.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_r.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_ro.csproj b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_ro.csproj index 6dd375ff9fc95..2aace07c90d84 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_ro.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/manyintf/ctest_cs_ro.csproj @@ -1,6 +1,5 @@ - Exe 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed.cs b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed.cs index 13c903d72869d..f4b62b37e169d 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed.cs +++ b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; internal interface ITest1 { int f1(); @@ -54,7 +55,7 @@ internal interface ITest5 int f9(); } -internal class C : ITest5 +public class C : ITest5 { private int _code; public C() @@ -67,7 +68,7 @@ public C() public virtual int f9() { GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); if (this.GetHashCode() != _code) return 999; else return 18; } } -internal class CTest : C, ITest1, ITest2, ITest3, ITest4, IBase1, IDerived1, IDerived2, IDerived +public class CTest : C, ITest1, ITest2, ITest3, ITest4, IBase1, IDerived1, IDerived2, IDerived { private int _code; public CTest() @@ -95,7 +96,8 @@ public CTest() new public int f8() { GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); if (this.GetHashCode() != _code) return 999; else return 17; } override public int f9() { GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); if (this.GetHashCode() != _code) return 999; else return 19; } - public static int Main() + [Fact] + public static int TestEntryPoint() { CTest t = new CTest(); if (t.f1() != 2) diff --git a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_d.csproj b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_d.csproj index c8fdc281faea3..317743c8ef606 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_d.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_d.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_do.csproj b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_do.csproj index 038c262a3ff7a..36a3d52e51c11 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_do.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_do.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_r.csproj b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_r.csproj index cfb0ab60c573d..3653a777388cb 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_r.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_r.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_ro.csproj b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_ro.csproj index 3646a280bf78f..48a78d99def6f 100644 --- a/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_ro.csproj +++ b/src/tests/JIT/opt/virtualstubdispatch/mixed/mixed_cs_ro.csproj @@ -1,6 +1,7 @@ - Exe + + true 1