summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-12-27 07:46:08 (GMT)
committerJiyoung Yun <jy910.yun@samsung.com>2016-12-27 07:46:08 (GMT)
commitdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch)
treee5435159cd1bf0519276363a6fe1663d1721bed3 /tests
parent4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff)
downloadcoreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'tests')
-rw-r--r--tests/arm64/Tests.lst84
-rw-r--r--tests/build.proj1
-rw-r--r--tests/debugger_tests/ConfigFilesGenerators/ConfigTemplate.txt32
-rw-r--r--tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.cmd53
-rw-r--r--tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh65
-rw-r--r--tests/debugger_tests/ScriptGenerator/Program.csbin0 -> 8256 bytes
-rw-r--r--tests/debugger_tests/ScriptGenerator/project.jsonbin0 -> 1106 bytes
-rw-r--r--tests/debugger_tests/setup-debuggertests.cmd119
-rw-r--r--tests/debugger_tests/setup-debuggertests.shbin0 -> 6494 bytes
-rw-r--r--tests/dir.props3
-rw-r--r--tests/helix.targets78
-rw-r--r--tests/issues.targets65
-rw-r--r--tests/override.targets2
-rw-r--r--tests/publishdependency.targets189
-rw-r--r--tests/runtest.cmd58
-rw-r--r--tests/runtest.proj50
-rwxr-xr-xtests/runtest.sh72
-rwxr-xr-xtests/scripts/arm32_ci_script.sh66
-rw-r--r--tests/scripts/arm64_post_build.py311
-rw-r--r--tests/scripts/format.py46
-rwxr-xr-xtests/scripts/perf-prep.sh78
-rw-r--r--tests/scripts/project.json23
-rw-r--r--tests/scripts/run-xunit-perf.cmd52
-rwxr-xr-x[-rw-r--r--]tests/scripts/run-xunit-perf.sh70
-rwxr-xr-xtests/setup-runtime-dependencies.cmd2
-rwxr-xr-xtests/setup-runtime-dependencies.sh4
-rw-r--r--tests/src/CLRTest.Execute.Bash.targets11
-rw-r--r--tests/src/CLRTest.Execute.Batch.targets11
-rw-r--r--tests/src/CLRTest.Execute.targets1
-rw-r--r--tests/src/CLRTest.Jit.targets86
-rw-r--r--tests/src/Common/Platform/platformdefines.cpp4
-rw-r--r--tests/src/Common/Platform/platformdefines.h6
-rw-r--r--tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj15
-rw-r--r--tests/src/Common/build_against_pkg_dependencies/project.json32
-rw-r--r--tests/src/Common/empty/project.json2
-rw-r--r--tests/src/Common/netcoreapp/project.json74
-rw-r--r--tests/src/Common/targeting_pack_ref/project.json22
-rw-r--r--tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj12
-rw-r--r--tests/src/Common/test_dependencies/project.json136
-rw-r--r--tests/src/Common/test_dependencies/test_dependencies.csproj4
-rw-r--r--tests/src/Common/test_runtime/project.json5
-rw-r--r--tests/src/Common/test_runtime/test_runtime.csproj4
-rw-r--r--tests/src/CoreMangLib/cti/system/datetime/datetimeparse1.cs8
-rw-r--r--tests/src/CoreMangLib/system/span/BasicSpanTest.cs804
-rw-r--r--tests/src/GC/API/GC/GetGenerationWR2.csproj1
-rw-r--r--tests/src/GC/API/GCHandleCollector/Usage.cs3
-rw-r--r--tests/src/GC/Features/HeapExpansion/pluggaps.csproj1
-rw-r--r--tests/src/GC/Performance/Framework/GCPerfTestFramework.csproj31
-rw-r--r--tests/src/GC/Performance/Framework/packages.config24
-rw-r--r--tests/src/GC/Regressions/v2.0-rtm/494226/494226.csproj3
-rw-r--r--tests/src/GC/Scenarios/DoublinkList/dlcollect.cs6
-rw-r--r--tests/src/GC/Scenarios/DoublinkList/dlstack.cs6
-rw-r--r--tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs6
-rw-r--r--tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs7
-rw-r--r--tests/src/GC/Scenarios/ServerModel/servermodel.csproj1
-rw-r--r--tests/src/GC/Stress/Framework/ReliabilityFramework.csproj2
-rw-r--r--tests/src/GC/Stress/Tests/dir.targets6
-rw-r--r--tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp130
-rw-r--r--tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp2
-rwxr-xr-xtests/src/Interop/RefCharArray/RefCharArrayNative.cpp2
-rw-r--r--tests/src/Interop/SimpleStruct/SimpleStructNative.cpp4
-rw-r--r--tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp4
-rw-r--r--tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.cpp53
-rw-r--r--tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h173
-rwxr-xr-xtests/src/Interop/common/types.h4
-rw-r--r--tests/src/JIT/CodeGenBringUpTests/Rotate.cs96
-rw-r--r--tests/src/JIT/CodeGenBringUpTests/Shift.cs86
-rw-r--r--tests/src/JIT/CodeGenBringUpTests/Shift.csproj40
-rw-r--r--tests/src/JIT/Directed/pinvoke/pinvoke-examples.cs223
-rw-r--r--tests/src/JIT/Directed/pinvoke/pinvoke-examples.csproj44
-rw-r--r--tests/src/JIT/Methodical/fp/exgen/10w5d_cs_d.csproj5
-rw-r--r--tests/src/JIT/Methodical/fp/exgen/10w5d_cs_r.csproj5
-rw-r--r--tests/src/JIT/Methodical/structs/systemvbringup/structpinvoketests.cs1096
-rw-r--r--tests/src/JIT/Methodical/structs/valuetuple.cs95
-rw-r--r--tests/src/JIT/Methodical/structs/valuetuple.csproj41
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs17
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs45
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs9
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsByte.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsChar.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsDouble.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsFloat.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsInt.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsLong.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsSByte.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsShort.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsString.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUInt.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsULong.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUShort.cs3
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs148
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj44
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs4
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs159
-rw-r--r--tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj43
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs7
-rw-r--r--tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs2
-rw-r--r--tests/src/JIT/Performance/CodeQuality/V8/DeltaBlue/DeltaBlue.cs5
-rw-r--r--tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs18
-rw-r--r--tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.cmd2
-rwxr-xr-xtests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.sh53
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b475589/b475589.il71
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.cs56
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.cs62374
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278365/DevDiv_278365.cs49
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278365/DevDiv_278365.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278369/DevDiv_278369.il58
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278369/DevDiv_278369.ilproj41
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278371/DevDiv_278371.il88
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278371/DevDiv_278371.ilproj41
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278372/DevDiv_278372.il156
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278372/DevDiv_278372.ilproj51
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278375/DevDiv_278375.cs131
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278375/DevDiv_278375.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278376/DevDiv_278376.cs36
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278376/DevDiv_278376.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523.il113
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523.ilproj41
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278526/DevDiv_278526.cs47
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_278526/DevDiv_278526.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_279396/DevDiv_279396.il39
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_279396/DevDiv_279396.ilproj41
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_279829/DevDiv_279829.il36
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_279829/DevDiv_279829.ilproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_280120/DevDiv_280120.cs22
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_280120/DevDiv_280120.csproj56
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_280123/DevDiv_280123.cs42
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_280123/DevDiv_280123.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_280127/DevDiv_280127.cs37
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_280127/DevDiv_280127.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_283795/DevDiv_283795.cs55
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_283795/DevDiv_283795.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_284785/DevDiv_284785.cs39
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_284785/DevDiv_284785.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_288222/DevDiv_288222.cs50
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_288222/DevDiv_288222.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_359734/DevDiv_359734.il118
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_359734/DevDiv_359734.ilproj41
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_359736/DevDiv_359736.cs42
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_359736/DevDiv_359736_d.csproj45
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_359736/DevDiv_359736_do.csproj45
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_359736/DevDiv_359736_r.csproj45
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_359736/DevDiv_359736_ro.csproj45
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_7906/GitHub_7906.cs47
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_7906/GitHub_7906.csproj44
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_7907/GitHub_7907.cs53
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_7907/GitHub_7907.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8133/GitHub_8133.il112
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8133/GitHub_8133.ilproj (renamed from tests/src/Loader/classloader/PrivateInterfaceImpl/Test2_NonFriendPriInterface.csproj)28
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8170/GitHub_8170.cs23
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8170/GitHub_8170.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8220/GitHub_8220.cs170
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8220/GitHub_8220.csproj45
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8231/GitHub_8231.cs62
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8231/GitHub_8231.csproj39
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8460/GitHub_8460.cs38
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8460/GitHub_8460.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8599/GitHub_8599.cs42
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_8599/GitHub_8599.csproj46
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il55
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.ilproj38
-rw-r--r--tests/src/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b311420/b311420.csproj5
-rwxr-xr-xtests/src/JIT/SIMD/Vector3Interop.cs6
-rw-r--r--tests/src/JIT/SIMD/VectorDot.cs7
-rw-r--r--tests/src/JIT/SIMD/VectorIntEquals.cs61
-rw-r--r--tests/src/JIT/SIMD/VectorUtil.cs2
-rw-r--r--tests/src/JIT/config/benchmark+roslyn/project.json46
-rw-r--r--tests/src/JIT/config/benchmark+serialize/project.json43
-rw-r--r--tests/src/JIT/config/benchmark/project.json51
-rw-r--r--tests/src/JIT/config/extra/project.json34
-rw-r--r--tests/src/JIT/config/minimal/project.json12
-rw-r--r--tests/src/JIT/config/threading+thread/project.json16
-rw-r--r--tests/src/JIT/config/threading/project.json12
-rw-r--r--tests/src/JIT/jit64/opt/cse/HugeArray.csproj5
-rw-r--r--tests/src/JIT/jit64/verif/sniff/fg/ver_fg_13.il7
-rw-r--r--tests/src/JIT/opt/Inline/regression/mismatch32/mismatch32.il6
-rw-r--r--tests/src/JIT/opt/Inline/regression/mismatch64/mismatch64.il6
-rw-r--r--tests/src/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il30
-rw-r--r--tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_d.csproj3
-rw-r--r--tests/src/JIT/opt/virtualstubdispatch/bigvtbl/bigvtbl_cs_r.csproj3
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I/TestCase0.il21
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I/TestCase1.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I/TestCase2.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I/TestCase3.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I/TestCase4.il22
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I/TestCase5.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I/TestCase6.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase0.il21
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase1.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase2.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase3.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase4.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase5.il19
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase6.il18
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J/TestCase0.il21
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J/TestCase1.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J/TestCase2.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J/TestCase3.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J/TestCase4.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J/TestCase5.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J/TestCase6.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase0.il21
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase1.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase2.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase3.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase4.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase5.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase6.il20
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase0.il15
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase1.il18
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase2.il18
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase3.il18
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase4.il18
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase5.il18
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase6.il18
-rw-r--r--tests/src/Loader/classloader/InterfaceFolding/TestCase7.il19
-rw-r--r--tests/src/Loader/classloader/methodoverriding/regressions/549411/exploit.csproj1
-rw-r--r--tests/src/Loader/classloader/regressions/dev10_710121/dev10_710121.il15
-rw-r--r--tests/src/TestWrappersConfig/project.json13
-rw-r--r--tests/src/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.cs60
-rw-r--r--tests/src/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.csproj44
-rw-r--r--tests/src/baseservices/compilerservices/RuntimeHelpers/ExecuteCodeWithGuaranteedCleanup.cs62
-rw-r--r--tests/src/baseservices/compilerservices/RuntimeHelpers/ExecuteCodeWithGuaranteedCleanup.csproj42
-rw-r--r--tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs63
-rw-r--r--tests/src/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.csproj45
-rw-r--r--tests/src/baseservices/compilerservices/RuntimeWrappedException/StringThrower.il40
-rw-r--r--tests/src/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj (renamed from tests/src/Loader/classloader/generics/Visibility/B_Types.csproj)29
-rw-r--r--tests/src/baseservices/compilerservices/modulector/moduleCctor.il110
-rw-r--r--tests/src/baseservices/compilerservices/modulector/moduleCctor.ilproj (renamed from tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b475589/b475589.ilproj)6
-rw-r--r--tests/src/baseservices/compilerservices/modulector/runmoduleconstructor.cs38
-rw-r--r--tests/src/baseservices/compilerservices/modulector/runmoduleconstructor.csproj45
-rw-r--r--tests/src/dir.common.props7
-rw-r--r--tests/src/dir.props13
-rw-r--r--tests/src/dir.targets28
-rw-r--r--tests/src/jit/Directed/pinvoke/pinvoke-bug.cs60
-rw-r--r--tests/src/jit/Directed/pinvoke/pinvoke-bug.csproj44
-rw-r--r--tests/src/performance/perflab/BlockCopyPerf.cs29
-rw-r--r--tests/src/performance/perflab/CastingPerf.cs644
-rw-r--r--tests/src/performance/perflab/CastingPerf2.cs34
-rw-r--r--tests/src/performance/perflab/DelegatePerf.cs144
-rw-r--r--tests/src/performance/perflab/EnumPerf.cs109
-rw-r--r--tests/src/performance/perflab/LowLevelPerf.cs1283
-rw-r--r--tests/src/performance/perflab/ReflectionPerf.cs6317
-rw-r--r--tests/src/performance/perflab/StackWalk.cs129
-rw-r--r--tests/src/performance/perflab/ThreadingPerf.cs111
-rw-r--r--tests/src/performance/project.json54
-rw-r--r--tests/src/readytorun/generics.cs92
-rw-r--r--tests/src/readytorun/main.cs14
-rw-r--r--tests/src/reflection/ldtoken/byrefs.il88
-rw-r--r--tests/src/reflection/ldtoken/byrefs.ilproj (renamed from tests/src/Loader/classloader/generics/Visibility/A_Types.csproj)12
-rw-r--r--tests/tests.targets4
-rw-r--r--tests/testsFailingOutsideWindows.txt3
-rw-r--r--tests/testsUnsupportedOnARM32.txt9
-rw-r--r--tests/testsUnsupportedOutsideWindows.txt1
-rw-r--r--tests/x86/compatjit_x86_testenv.cmd8
-rw-r--r--tests/x86/legacyjit_x86_testenv.cmd52
-rw-r--r--tests/x86/ryujit_x86_testenv.cmd58
-rw-r--r--tests/x86_jit32_issues.targets8
-rw-r--r--tests/x86_legacy_backend_issues.targets23
-rw-r--r--tests/xunitwrapper.targets2
312 files changed, 76262 insertions, 6256 deletions
diff --git a/tests/arm64/Tests.lst b/tests/arm64/Tests.lst
index 15c0d17..5b2792b 100644
--- a/tests/arm64/Tests.lst
+++ b/tests/arm64/Tests.lst
@@ -2412,7 +2412,7 @@ RelativePath=baseservices\threading\interlocked\compareexchange\CompareExchangeT
WorkingDir=baseservices\threading\interlocked\compareexchange\CompareExchangeTClass
Expected=0
MaxAllowedDurationSeconds=600
-Categories=NEW;EXPECTED_PASS;UNSTABLE
+Categories=NEW;EXPECTED_FAIL;UNSTABLE
HostStyle=0
[CompareExchangeTClass_1.cmd_345]
RelativePath=baseservices\threading\interlocked\compareexchange\CompareExchangeTClass_1\CompareExchangeTClass_1.cmd
@@ -10532,7 +10532,7 @@ RelativePath=CoreMangLib\cti\system\globalization\regioninfo\RegionInfoCurrentRe
WorkingDir=CoreMangLib\cti\system\globalization\regioninfo\RegionInfoCurrentRegion
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri1;RT;EXPECTED_PASS
+Categories=Pri1;RT;EXPECTED_FAIL
HostStyle=0
[RegionInfoEquals.cmd_1505]
RelativePath=CoreMangLib\cti\system\globalization\regioninfo\RegionInfoEquals\RegionInfoEquals.cmd
@@ -20990,7 +20990,7 @@ RelativePath=GC\Scenarios\FinalizeTimeout\FinalizeTimeout\FinalizeTimeout.cmd
WorkingDir=GC\Scenarios\FinalizeTimeout\FinalizeTimeout
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_PASS
+Categories=Pri0;EXPECTED_FAIL
HostStyle=0
[finalnstruct.cmd_3013]
RelativePath=GC\Scenarios\FinalNStruct\finalnstruct\finalnstruct.cmd
@@ -23930,7 +23930,7 @@ RelativePath=GC\Scenarios\GCSimulator\GCSimulator_81\GCSimulator_81.cmd
WorkingDir=GC\Scenarios\GCSimulator\GCSimulator_81
Expected=0
MaxAllowedDurationSeconds=600
-Categories=NEW;EXPECTED_PASS
+Categories=NEW;EXPECTED_FAIL
HostStyle=0
[GCSimulator_82.cmd_3433]
RelativePath=GC\Scenarios\GCSimulator\GCSimulator_82\GCSimulator_82.cmd
@@ -42592,7 +42592,7 @@ RelativePath=JIT\Methodical\divrem\div\decimaldiv_cs_do\decimaldiv_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\decimaldiv_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[decimaldiv_cs_r.cmd_6168]
RelativePath=JIT\Methodical\divrem\div\decimaldiv_cs_r\decimaldiv_cs_r.cmd
@@ -42606,7 +42606,7 @@ RelativePath=JIT\Methodical\divrem\div\decimaldiv_cs_ro\decimaldiv_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\decimaldiv_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i4div_cs_d.cmd_6170]
RelativePath=JIT\Methodical\divrem\div\i4div_cs_d\i4div_cs_d.cmd
@@ -42620,7 +42620,7 @@ RelativePath=JIT\Methodical\divrem\div\i4div_cs_do\i4div_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\i4div_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i4div_cs_r.cmd_6172]
RelativePath=JIT\Methodical\divrem\div\i4div_cs_r\i4div_cs_r.cmd
@@ -42634,7 +42634,7 @@ RelativePath=JIT\Methodical\divrem\div\i4div_cs_ro\i4div_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\i4div_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i8div_cs_d.cmd_6174]
RelativePath=JIT\Methodical\divrem\div\i8div_cs_d\i8div_cs_d.cmd
@@ -42648,7 +42648,7 @@ RelativePath=JIT\Methodical\divrem\div\i8div_cs_do\i8div_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\i8div_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i8div_cs_r.cmd_6176]
RelativePath=JIT\Methodical\divrem\div\i8div_cs_r\i8div_cs_r.cmd
@@ -42662,7 +42662,7 @@ RelativePath=JIT\Methodical\divrem\div\i8div_cs_ro\i8div_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\i8div_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[negSignedMod.cmd_6178]
RelativePath=JIT\Methodical\divrem\div\negSignedMod\negSignedMod.cmd
@@ -42683,7 +42683,7 @@ RelativePath=JIT\Methodical\divrem\div\overlddiv_cs_do\overlddiv_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\overlddiv_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[overlddiv_cs_r.cmd_6181]
RelativePath=JIT\Methodical\divrem\div\overlddiv_cs_r\overlddiv_cs_r.cmd
@@ -42697,7 +42697,7 @@ RelativePath=JIT\Methodical\divrem\div\overlddiv_cs_ro\overlddiv_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\overlddiv_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r4div_cs_d.cmd_6183]
RelativePath=JIT\Methodical\divrem\div\r4div_cs_d\r4div_cs_d.cmd
@@ -42711,7 +42711,7 @@ RelativePath=JIT\Methodical\divrem\div\r4div_cs_do\r4div_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\r4div_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r4div_cs_r.cmd_6185]
RelativePath=JIT\Methodical\divrem\div\r4div_cs_r\r4div_cs_r.cmd
@@ -42725,7 +42725,7 @@ RelativePath=JIT\Methodical\divrem\div\r4div_cs_ro\r4div_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\r4div_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r8div_cs_d.cmd_6187]
RelativePath=JIT\Methodical\divrem\div\r8div_cs_d\r8div_cs_d.cmd
@@ -42739,7 +42739,7 @@ RelativePath=JIT\Methodical\divrem\div\r8div_cs_do\r8div_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\r8div_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r8div_cs_r.cmd_6189]
RelativePath=JIT\Methodical\divrem\div\r8div_cs_r\r8div_cs_r.cmd
@@ -42753,7 +42753,7 @@ RelativePath=JIT\Methodical\divrem\div\r8div_cs_ro\r8div_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\r8div_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u4div_cs_d.cmd_6191]
RelativePath=JIT\Methodical\divrem\div\u4div_cs_d\u4div_cs_d.cmd
@@ -42767,7 +42767,7 @@ RelativePath=JIT\Methodical\divrem\div\u4div_cs_do\u4div_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\u4div_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u4div_cs_r.cmd_6193]
RelativePath=JIT\Methodical\divrem\div\u4div_cs_r\u4div_cs_r.cmd
@@ -42781,7 +42781,7 @@ RelativePath=JIT\Methodical\divrem\div\u4div_cs_ro\u4div_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\u4div_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u8div_cs_d.cmd_6195]
RelativePath=JIT\Methodical\divrem\div\u8div_cs_d\u8div_cs_d.cmd
@@ -42795,7 +42795,7 @@ RelativePath=JIT\Methodical\divrem\div\u8div_cs_do\u8div_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\div\u8div_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u8div_cs_r.cmd_6197]
RelativePath=JIT\Methodical\divrem\div\u8div_cs_r\u8div_cs_r.cmd
@@ -42809,7 +42809,7 @@ RelativePath=JIT\Methodical\divrem\div\u8div_cs_ro\u8div_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\div\u8div_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[decimalrem_cs_d.cmd_6199]
RelativePath=JIT\Methodical\divrem\rem\decimalrem_cs_d\decimalrem_cs_d.cmd
@@ -42823,7 +42823,7 @@ RelativePath=JIT\Methodical\divrem\rem\decimalrem_cs_do\decimalrem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\decimalrem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[decimalrem_cs_r.cmd_6201]
RelativePath=JIT\Methodical\divrem\rem\decimalrem_cs_r\decimalrem_cs_r.cmd
@@ -42837,7 +42837,7 @@ RelativePath=JIT\Methodical\divrem\rem\decimalrem_cs_ro\decimalrem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\decimalrem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i4rem_cs_d.cmd_6203]
RelativePath=JIT\Methodical\divrem\rem\i4rem_cs_d\i4rem_cs_d.cmd
@@ -42851,7 +42851,7 @@ RelativePath=JIT\Methodical\divrem\rem\i4rem_cs_do\i4rem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\i4rem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i4rem_cs_r.cmd_6205]
RelativePath=JIT\Methodical\divrem\rem\i4rem_cs_r\i4rem_cs_r.cmd
@@ -42865,7 +42865,7 @@ RelativePath=JIT\Methodical\divrem\rem\i4rem_cs_ro\i4rem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\i4rem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i8rem_cs_d.cmd_6207]
RelativePath=JIT\Methodical\divrem\rem\i8rem_cs_d\i8rem_cs_d.cmd
@@ -42879,7 +42879,7 @@ RelativePath=JIT\Methodical\divrem\rem\i8rem_cs_do\i8rem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\i8rem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[i8rem_cs_r.cmd_6209]
RelativePath=JIT\Methodical\divrem\rem\i8rem_cs_r\i8rem_cs_r.cmd
@@ -42893,7 +42893,7 @@ RelativePath=JIT\Methodical\divrem\rem\i8rem_cs_ro\i8rem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\i8rem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[overldrem_cs_d.cmd_6211]
RelativePath=JIT\Methodical\divrem\rem\overldrem_cs_d\overldrem_cs_d.cmd
@@ -42907,7 +42907,7 @@ RelativePath=JIT\Methodical\divrem\rem\overldrem_cs_do\overldrem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\overldrem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[overldrem_cs_r.cmd_6213]
RelativePath=JIT\Methodical\divrem\rem\overldrem_cs_r\overldrem_cs_r.cmd
@@ -42921,7 +42921,7 @@ RelativePath=JIT\Methodical\divrem\rem\overldrem_cs_ro\overldrem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\overldrem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r4rem_cs_d.cmd_6215]
RelativePath=JIT\Methodical\divrem\rem\r4rem_cs_d\r4rem_cs_d.cmd
@@ -42935,7 +42935,7 @@ RelativePath=JIT\Methodical\divrem\rem\r4rem_cs_do\r4rem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\r4rem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r4rem_cs_r.cmd_6217]
RelativePath=JIT\Methodical\divrem\rem\r4rem_cs_r\r4rem_cs_r.cmd
@@ -42949,7 +42949,7 @@ RelativePath=JIT\Methodical\divrem\rem\r4rem_cs_ro\r4rem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\r4rem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r8rem_cs_d.cmd_6219]
RelativePath=JIT\Methodical\divrem\rem\r8rem_cs_d\r8rem_cs_d.cmd
@@ -42963,7 +42963,7 @@ RelativePath=JIT\Methodical\divrem\rem\r8rem_cs_do\r8rem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\r8rem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[r8rem_cs_r.cmd_6221]
RelativePath=JIT\Methodical\divrem\rem\r8rem_cs_r\r8rem_cs_r.cmd
@@ -42977,7 +42977,7 @@ RelativePath=JIT\Methodical\divrem\rem\r8rem_cs_ro\r8rem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\r8rem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u4rem_cs_d.cmd_6223]
RelativePath=JIT\Methodical\divrem\rem\u4rem_cs_d\u4rem_cs_d.cmd
@@ -42991,7 +42991,7 @@ RelativePath=JIT\Methodical\divrem\rem\u4rem_cs_do\u4rem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\u4rem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u4rem_cs_r.cmd_6225]
RelativePath=JIT\Methodical\divrem\rem\u4rem_cs_r\u4rem_cs_r.cmd
@@ -43005,7 +43005,7 @@ RelativePath=JIT\Methodical\divrem\rem\u4rem_cs_ro\u4rem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\u4rem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u8rem_cs_d.cmd_6227]
RelativePath=JIT\Methodical\divrem\rem\u8rem_cs_d\u8rem_cs_d.cmd
@@ -43019,7 +43019,7 @@ RelativePath=JIT\Methodical\divrem\rem\u8rem_cs_do\u8rem_cs_do.cmd
WorkingDir=JIT\Methodical\divrem\rem\u8rem_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[u8rem_cs_r.cmd_6229]
RelativePath=JIT\Methodical\divrem\rem\u8rem_cs_r\u8rem_cs_r.cmd
@@ -43033,7 +43033,7 @@ RelativePath=JIT\Methodical\divrem\rem\u8rem_cs_ro\u8rem_cs_ro.cmd
WorkingDir=JIT\Methodical\divrem\rem\u8rem_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;JIT;EXPECTED_PASS
+Categories=Pri0;JIT;EXPECTED_FAIL
HostStyle=0
[dblarray1_cs_d.cmd_6231]
RelativePath=JIT\Methodical\doublearray\dblarray1_cs_d\dblarray1_cs_d.cmd
@@ -47086,14 +47086,14 @@ RelativePath=JIT\Methodical\explicit\coverage\seq_byte_1_d\seq_byte_1_d.cmd
WorkingDir=JIT\Methodical\explicit\coverage\seq_byte_1_d
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_PASS
+Categories=Pri0;EXPECTED_FAIL
HostStyle=0
[seq_byte_1_r.cmd_6812]
RelativePath=JIT\Methodical\explicit\coverage\seq_byte_1_r\seq_byte_1_r.cmd
WorkingDir=JIT\Methodical\explicit\coverage\seq_byte_1_r
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_PASS
+Categories=Pri0;EXPECTED_FAIL
HostStyle=0
[seq_double_1_d.cmd_6813]
RelativePath=JIT\Methodical\explicit\coverage\seq_double_1_d\seq_double_1_d.cmd
@@ -48059,7 +48059,7 @@ RelativePath=JIT\Methodical\fp\exgen\1000w1d_cs_do\1000w1d_cs_do.cmd
WorkingDir=JIT\Methodical\fp\exgen\1000w1d_cs_do
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_PASS
+Categories=Pri0;EXPECTED_FAIL
HostStyle=0
[1000w1d_cs_r.cmd_6951]
RelativePath=JIT\Methodical\fp\exgen\1000w1d_cs_r\1000w1d_cs_r.cmd
@@ -48073,7 +48073,7 @@ RelativePath=JIT\Methodical\fp\exgen\1000w1d_cs_ro\1000w1d_cs_ro.cmd
WorkingDir=JIT\Methodical\fp\exgen\1000w1d_cs_ro
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_PASS
+Categories=Pri0;EXPECTED_FAIL
HostStyle=0
[10w250d_cs_d.cmd_6953]
RelativePath=JIT\Methodical\fp\exgen\10w250d_cs_d\10w250d_cs_d.cmd
@@ -52560,7 +52560,7 @@ RelativePath=JIT\Methodical\tailcall\Desktop\_il_relthread-race\_il_relthread-ra
WorkingDir=JIT\Methodical\tailcall\Desktop\_il_relthread-race
Expected=0
MaxAllowedDurationSeconds=600
-Categories=Pri0;EXPECTED_PASS
+Categories=Pri0;EXPECTED_FAIL
HostStyle=0
[_il_dbgcompat_enum.cmd_7596]
RelativePath=JIT\Methodical\tailcall\_il_dbgcompat_enum\_il_dbgcompat_enum.cmd
@@ -64754,7 +64754,7 @@ RelativePath=Loader\classloader\generics\GenericMethods\VSW491668\VSW491668.cmd
WorkingDir=Loader\classloader\generics\GenericMethods\VSW491668
Expected=0
MaxAllowedDurationSeconds=600
-Categories=NEW;EXPECTED_PASS
+Categories=NEW;EXPECTED_FAIL
HostStyle=0
[abstract01.cmd_9373]
RelativePath=Loader\classloader\generics\Instantiation\Negative\abstract01\abstract01.cmd
diff --git a/tests/build.proj b/tests/build.proj
index 0dfd84d..63db903 100644
--- a/tests/build.proj
+++ b/tests/build.proj
@@ -38,6 +38,7 @@
<!-- Create a collection of all project.json files for dependency updates. -->
<ItemGroup>
<ProjectJsonFiles Include="$(SourceDir)**\project.json" />
+ <ProjectJsonFiles Include="$(ProjectDir)scripts\**\project.json" />
</ItemGroup>
<Target Name="UpdatePackageDependencyVersion">
diff --git a/tests/debugger_tests/ConfigFilesGenerators/ConfigTemplate.txt b/tests/debugger_tests/ConfigFilesGenerators/ConfigTemplate.txt
new file mode 100644
index 0000000..d674a72
--- /dev/null
+++ b/tests/debugger_tests/ConfigFilesGenerators/ConfigTemplate.txt
@@ -0,0 +1,32 @@
+<Configuration>
+ <TestRoot>..\..</TestRoot>
+ <TargetArchitecture>x64</TargetArchitecture>
+ <ScriptRootDir>$(TestRoot)\Scripts</ScriptRootDir>
+ <DebuggeeRootDir>$(TestRoot)\Debuggees</DebuggeeRootDir>
+ <DebuggeeSourceRoot>$(DebuggeeRootDir)\Source</DebuggeeSourceRoot>
+ <RuntimeRoot>##Insert_Runtime_Root##</RuntimeRoot>
+ <NugetCacheRoot>##Insert_Nuget_Cache_Root##</NugetCacheRoot>
+ <TestProduct>ProjectK</TestProduct>
+ <HostExe>$(RuntimeRoot)\corerun.exe</HostExe>
+ <DbgShim>$(RuntimeRoot)\dbgshim.dll</DbgShim>
+ <RuntimeSymbolsPath>$(RuntimeRoot)</RuntimeSymbolsPath>
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <CliVersion>1.0.0-preview1-002702</CliVersion>
+ <DebuggeeNativeLibRoot>$(DebuggeeRootDir)\native</DebuggeeNativeLibRoot>
+ <DebuggeeBuildRoot>$(DebuggeeRootDir)\dotnet.$(CliVersion)</DebuggeeBuildRoot>
+ <ProjectJsonNetStandardLibraryVersion>1.0.0-rc2-23811</ProjectJsonNetStandardLibraryVersion>
+ <ProjectJsonSystemThreadingThreadVersion>4.0.0-rc2-24027</ProjectJsonSystemThreadingThreadVersion>
+ <ProjectJsonMicrosoftCSharpVersion>4.0.1-rc2-23811</ProjectJsonMicrosoftCSharpVersion>
+ <CliPath>##Cli_Path##</CliPath>
+ <NuGetPackageCacheDir>$(NugetCacheRoot)</NuGetPackageCacheDir>
+ <NuGetPackageFeeds>
+ myget.org dotnet-core=https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
+ myget.org=https://www.nuget.org/api/v2/
+ </NuGetPackageFeeds>
+ <SOSPath>$(RuntimeRoot)\sos.dll</SOSPath>
+ <MDbgDir>$(TestRoot)\mdbg</MDbgDir>
+ <DebuggeeDumpOutputRootDir>$(WorkingDir)\dumps\$(TestProduct)</DebuggeeDumpOutputRootDir>
+ <DebuggeeDumpInputRootDir>$(DebuggeeDumpOutputRootDir)</DebuggeeDumpInputRootDir>
+ <LogDir>$(TestRoot)\logs_$(Timestamp)</LogDir>
+ <CDBPath>$(TestRoot)\Debuggers\cdb\cdb.exe</CDBPath>
+</Configuration>
diff --git a/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.cmd b/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.cmd
new file mode 100644
index 0000000..635df95
--- /dev/null
+++ b/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.cmd
@@ -0,0 +1,53 @@
+@echo off
+setlocal EnableDelayedExpansion
+
+:: Set the default arguments for script generation.
+set __RuntimeRoot=`$(TestRoot)\Runtimes\Coreclr1
+set __NugetCacheDir=`$(WorkingDir)\packages
+set __CliPath=
+set __ConfigFileName=Debugger.Tests.Config.txt
+set __TemplateFileName=%~dp0\ConfigTemplate.txt
+
+:Arg_Loop
+if "%1" == "" goto ArgsDone
+if /i "%1" == "/?" goto Usage
+
+if /i "%1" == "rt" (set "__RuntimeRoot=%2"&shift&shift&goto Arg_Loop)
+if /i "%1" == "nc" (set "__NugetCacheDir=%2"&shift&shift&goto Arg_Loop)
+if /i "%1" == "cli" (set "__CliPath=%2"&shift&shift&goto Arg_Loop)
+
+echo Invalid commandline argument: %1
+goto Usage
+
+:ArgsDone
+
+if not exist %__TemplateFileName% (
+ echo Template file %__TemplateFileName% doesn't exist.
+ exit /b 1
+)
+
+:: Delete previous config file.
+if exist %__ConfigFileName% (
+ echo Deleting current config file.
+ del %__ConfigFileName%
+)
+
+:: powershell "Get-Content %__TemplateFileName% -replace (""##Insert_Runtime_Root##"", ""%__RuntimeRoot%"") | Output-File %__ConfigFileName% "
+powershell "(Get-Content \"%__TemplateFileName%\")`"^
+ "-replace \"##Insert_Runtime_Root##\", \"%__RuntimeRoot%\" `"^
+ "|ForEach-Object{$_ -replace \"##Insert_Nuget_Cache_Root##\", \"%__NugetCacheDir%\"} `"^
+ "|ForEach-Object{$_ -replace \"##Cli_Path##\", \"%__CliPath%\"} `"^
+ "| Out-File \"%__ConfigFileName%\""
+
+exit /b 0
+
+:Usage
+echo.
+echo Usage:
+echo %0 [rt ^<runtime_path^>] [nc ^<nuget_cache_path^>] [cli ^<cli_path^>] where:
+echo.
+echo ^<runtime_path^>: path to the runtime that you want to use for testing.
+echo ^<nuget_cache_path^>: path to the nuget cache.
+echo ^<cli_path^>: path to the cli tool.
+exit /b 1
+endlocal
diff --git a/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh b/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh
new file mode 100644
index 0000000..38834ed
--- /dev/null
+++ b/tests/debugger_tests/ConfigFilesGenerators/GenerateConfig.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+function print_usage {
+ echo ''
+ echo 'Usage:'
+ echo '[rt=<runtime_path>] [nc=<nuget_cache_path>] [cli=<cli_path>] where:'
+ echo ' <runtime_path>: path to the runtime that you want to use for testing.'
+ echo ' <nuget_cache_path>: path to the nuget cache.'
+ echo ' <cli_path>: path to the cli tool.'
+ echo ''
+ echo ''
+}
+
+# Argument variables
+__RuntimeRoot='$(TestRoot)\Runtimes\Coreclr1'
+__NugetCacheDir='$(WorkingDir)\packages'
+__CliPath=
+__ConfigFileName='Debugger.Tests.Config.txt'
+__TemplateFileName='ConfigTemplate.txt'
+
+for i in "$@"
+do
+ case $i in
+ -h|--help)
+ print_usage
+ exit $EXIT_CODE_SUCCESS
+ ;;
+ rt=*)
+ __RuntimeRoot=${i#*=}
+ ;;
+ nc=*)
+ __NugetCacheDir=${i#*=}
+ ;;
+ cli=*)
+ __CliPath=${i#*=}
+ ;;
+ *)
+ echo "Unknown switch: $i"
+ print_usage
+ exit $EXIT_CODE_SUCCESS
+ ;;
+ esac
+done
+
+if ! -e "$__TemplateFileName"
+then
+ echo '$__TemplateFileName does not exist'
+ exit 1
+fi
+
+if -e "$__ConfigFileName"
+then
+ rm "$__ConfigFileName"
+fi
+
+cp "$__TemplateFileName" "$__ConfigFileName"
+
+sed -i \
+ 's/##Insert_Runtime_Root##/$__RuntimeRoot/g;' \
+ 's/##Insert_Nuget_Cache_Root##/$__NugetCacheDir/g'\
+ 's/##Cli_Path##/$__CliPath/g'\
+ 's/corerun.exe/corerun/g'\
+ "$__ConfigFileName"
+
+exit 0 \ No newline at end of file
diff --git a/tests/debugger_tests/ScriptGenerator/Program.cs b/tests/debugger_tests/ScriptGenerator/Program.cs
new file mode 100644
index 0000000..1e9586d
--- /dev/null
+++ b/tests/debugger_tests/ScriptGenerator/Program.cs
Binary files differ
diff --git a/tests/debugger_tests/ScriptGenerator/project.json b/tests/debugger_tests/ScriptGenerator/project.json
new file mode 100644
index 0000000..25c7a26
--- /dev/null
+++ b/tests/debugger_tests/ScriptGenerator/project.json
Binary files differ
diff --git a/tests/debugger_tests/setup-debuggertests.cmd b/tests/debugger_tests/setup-debuggertests.cmd
new file mode 100644
index 0000000..6507f0e
--- /dev/null
+++ b/tests/debugger_tests/setup-debuggertests.cmd
@@ -0,0 +1,119 @@
+@if not defined __echo @echo off
+setlocal
+
+set __ThisScriptShort=%0
+set __ThisScriptFull=%~f0
+set __ThisScriptPath=%~dp0
+
+REM =========================================================================================
+REM ===
+REM === Parse arguments
+REM ===
+REM =========================================================================================
+
+set __OutputDir=
+set __Arch=
+set __CoreclrBinPath=
+set __NugetCacheDir=
+set __CliPath=
+
+:Arg_Loop
+if "%1" == "" goto ArgsDone
+
+if /i "%1" == "/?" goto Usage
+if /i "%1" == "-?" goto Usage
+if /i "%1" == "/h" goto Usage
+if /i "%1" == "-h" goto Usage
+if /i "%1" == "/help" goto Usage
+if /i "%1" == "-help" goto Usage
+
+if /i "%1" == "/outputDir" (set __OutputDir=%2&shift&shift&goto Arg_Loop)
+if /i "%1" == "/coreclrBinDir" (set __CoreclrBinPath=%2&shift&shift&goto Arg_Loop)
+if /i "%1" == "/nugetCacheDir" (set __NugetCacheDir=%2&shift&shift&goto Arg_Loop)
+if /i "%1" == "/cliPath" (set __CliPath=%2&shift&shift&goto Arg_Loop)
+
+
+echo Invalid command-line argument: %1
+goto Usage
+
+:ArgsDone
+
+if not defined __OutputDir goto Usage
+if not defined __Arch goto Usage
+
+REM Create directories needed
+if exist "%__OutputDir%\debuggertests" rmdir /S /Q "%__OutputDir%\debuggertests"
+md "%__OutputDir%\debuggertests"
+set __InstallDir=%__OutputDir%\debuggertests
+
+REM =========================================================================================
+REM ===
+REM === download debuggertests package
+REM ===
+REM =========================================================================================
+set DEBUGGERTESTS_URL=https://dotnetbuilddrops.blob.core.windows.net/debugger-container/Windows.DebuggerTests.zip
+set LOCAL_ZIP_PATH=%__InstallDir%\debuggertests.zip
+if exist "%LOCAL_ZIP_PATH%" del "%LOCAL_ZIP_PATH%"
+set DEBUGGERTESTS_INSTALL_LOG="%__ThisScriptPath%debuggerinstall.log"
+REM Download the package
+echo Download and unzip debuggertests package to %LOCAL_ZIP_PATH%
+powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DEBUGGERTESTS_URL%', '%LOCAL_ZIP_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%LOCAL_ZIP_PATH%', '%__InstallDir%') } else { (New-Object -com shell.application).namespace('%LOCAL_ZIP_PATH%').CopyHere((new-object -com shell.application).namespace('%__InstallDir%').Items(),16) }" >> %DEBUGGERTESTS_INSTALL_LOG%
+
+if errorlevel 1 (
+ echo Failed to install debuggertests to %__InstallDir%
+ goto Fail
+)
+
+REM =========================================================================================
+REM ===
+REM === Setting up the right config file.
+REM ===
+REM =========================================================================================
+echo Generating config file.
+
+call %__ThisScriptPath%\ConfigFilesGenerators\GenerateConfig.cmd rt %__CoreclrBinPath% nc %__NugetCacheDir% cli %__CliPath%
+move Debugger.Tests.Config.txt %__InstallDir%\\Debugger.Tests\dotnet\Debugger.Tests.Config.txt
+
+REM =========================================================================================
+REM ===
+REM === Scripts generation.
+REM ===
+REM =========================================================================================
+mkdir %__InstallDir%\ScriptGenerator
+copy %__ThisScriptPath%\ScriptGenerator\* %__InstallDir%\ScriptGenerator\
+pushd %__InstallDir%\ScriptGenerator
+%__CliPath%\dotnet restore
+%__CliPath%\dotnet build
+popd
+
+%__CliPath%\dotnet run --project %__InstallDir%\ScriptGenerator %__InstallDir% %__CoreclrBinPath% %__InstallDir%\Dotnet.Tests\dotnet
+
+REM Deleting runtests.cmd to avoid double test-running.
+del %__InstallDir%\runtests.cmd
+
+if errorlevel 1 (
+ echo Failed to build and run script generation.
+ goto Fail
+)
+
+
+
+exit /b 0
+
+:Fail
+exit /b 1
+
+REM =========================================================================================
+REM ===
+REM === Helper routines
+REM ===
+REM =========================================================================================
+
+:Usage
+echo.
+echo install debugger tests
+echo.
+echo Usage:
+echo %__ThisScriptShort% /coreclrBinDir ^<coreclr bin path^> /outputDir ^<debuggertests install path^> /nugetCacheDir ^<nuget cache dir path^>
+echo.
+exit /b 1
diff --git a/tests/debugger_tests/setup-debuggertests.sh b/tests/debugger_tests/setup-debuggertests.sh
new file mode 100644
index 0000000..315359c
--- /dev/null
+++ b/tests/debugger_tests/setup-debuggertests.sh
Binary files differ
diff --git a/tests/dir.props b/tests/dir.props
index 9d93e93..43026ca 100644
--- a/tests/dir.props
+++ b/tests/dir.props
@@ -54,7 +54,8 @@
<!-- list of nuget package sources passed to dnu -->
<ItemGroup>
- <!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. -->
+ <!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. -->
+ <DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
<DnuSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<DnuSourceList Include="https:%2F%2Fapi.nuget.org/v3/index.json" />
</ItemGroup>
diff --git a/tests/helix.targets b/tests/helix.targets
deleted file mode 100644
index 16acf01..0000000
--- a/tests/helix.targets
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
- <PropertyGroup>
- <PackageTestRuntimeFolder>$(PackagesDir)test.Microsoft.NETCore.Runtime.CoreClr\1.1.1</PackageTestRuntimeFolder>
- </PropertyGroup>
-
- <ItemGroup>
- <!-- TODO This should come from some package -->
- <CoreRootFiles Include="$(CORE_ROOT)\crossgen.exe" />
- <CoreRootFiles Include="$(CORE_ROOT)\ildasm.exe" />
- <CoreRootFiles Include="$(CORE_ROOT)\ilasm.exe" />
-
- <!-- TODO these files should get copied to core_root but does not as they are xunit files. Using temporary workaround for now -->
- <CoreRootFiles Include="$(PackagesDir)Microsoft.DotNet.xunit.performance\1.0.0-alpha-build0035\lib\dotnet\xunit.performance.core.dll" />
- <CoreRootFiles Include="$(PackagesDir)xunit.extensibility.core\2.1.0\lib\dotnet\xunit.core.dll" />
- </ItemGroup>
-
- <!-- replace *.lock.json to be that of actual tests than XunitWrapper -->
- <Target Name="ReplaceProjectLockJson"
- BeforeTargets="CopyTestToTestDirectory">
- <PropertyGroup>
- <ProjectLockJson></ProjectLockJson>
- <TestRuntimeProjectLockJson></TestRuntimeProjectLockJson>
- </PropertyGroup>
- <ItemGroup>
- <TestNugetProjectLockFile Include="$(SourceDir)$(Category)\**\project.lock.json"/>
- <TestNugetProjectLockFile Include="$(TestRuntimeProjectLockJson)"/>
- </ItemGroup>
- </Target>
-
- <Target Name="CopyProductInPackagesFolder"
- BeforeTargets="CopyTestToTestDirectory">
-
- <Copy
- SourceFiles="@(CoreRootFiles)"
- DestinationFolder="$(PackageTestRuntimeFolder)"
- SkipUnchangedFiles="false"
- OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
- Retries="$(CopyRetryCount)"
- RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
- UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
- </Copy>
-
- </Target>
-
-
- <Target Name="AddFilesToAssemblyList"
- BeforeTargets="CreateAssemblyListTxt">
-
- <ItemGroup>
-
- <ToReplace Include="$(PackageTestRuntimeFolder)\*" />
-
- <!-- In helix xunit tests are run using xunit.console.exe instead of msbuild xunitrunner.
- This dependency should ideally be added in some project.json. But in the package the assemblies are present in tools folder.
- Assemblies in tools folder are not resolved during restore. Therefore forcing addition direclty. -->
- <XunitConsoleExe Include="$(PackagesDir)xunit.runner.console\**\xunit.console.exe" />
- <XunitConsoleExe Include="$(PackagesDir)xunit.runner.console\**\xunit.runner.utility.desktop.dll" />
-
- <ToRemove Include="@(_TestCopyLocalByFileNameWithoutDuplicates)" Condition="'%(_TestCopyLocalByFileNameWithoutDuplicates.Filename)' == 'xunit.performance.core'"/>
- <ToRemove Include="@(_TestCopyLocalByFileNameWithoutDuplicates)" Condition="'%(_TestCopyLocalByFileNameWithoutDuplicates.Filename)' == 'xunit.core'"/>
-
- <_TestCopyLocalByFileNameWithoutDuplicates Remove="@(ToRemove)" />
-
- <_TestCopyLocalByFileNameWithoutDuplicates Include="@(ToReplace)">
- <NugetPackageId>test.Microsoft.NETCore.Runtime.CoreClr</NugetPackageId>
- <SourcePath>%(ToReplace.Identity)</SourcePath>
- </_TestCopyLocalByFileNameWithoutDuplicates>
-
- <_TestCopyLocalByFileNameWithoutDuplicates Include="@(XunitConsoleExe)">
- <NugetPackageId>xunit.runner.console</NugetPackageId>
- <SourcePath>%(XunitConsoleExe.Identity)</SourcePath>
- </_TestCopyLocalByFileNameWithoutDuplicates>
- </ItemGroup>
- </Target>
-
-</Project>
diff --git a/tests/issues.targets b/tests/issues.targets
index ee45e58..d1f3dc2 100644
--- a/tests/issues.targets
+++ b/tests/issues.targets
@@ -40,6 +40,9 @@
<ExcludeList Include="$(XunitTestBinBase)\GC\Scenarios\muldimjagary\muldimjagary\*">
<Issue>3392</Issue>
</ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)\GC\Scenarios\DoublinkList\dlstack\*">
+ <Issue>6553</Issue>
+ </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\Directed\coverage\importer\Desktop\bleref_il_d\bleref_il_d.cmd">
<Issue>2414</Issue>
</ExcludeList>
@@ -181,75 +184,37 @@
<ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\TypeGeneratorTests\TypeGeneratorTest683\Generated683\*">
<Issue>6707</Issue>
</ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\perf\doublealign\Locals\*">
+ <Issue>8418</Issue>
+ </ExcludeList>
</ItemGroup>
- <!-- The following are baseline x86 failures -->
+ <!-- The following are x86 failures -->
<ItemGroup Condition="'$(XunitTestBinBase)' != '' and '$(BuildArch)' == 'x86'">
<ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\Allocation\largeexceptiontest\largeexceptiontest.cmd">
- <Issue>3392</Issue>
+ <Issue>3392, test is useful to have because it can be run manually when making changes to the GC that can have effects in OOM scenarios, but not appropriate to run on our current test infrastructure.</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\gettotalmemory\gettotalmemory.cmd">
- <Issue>3392</Issue>
+ <Issue>3392, test is useful to have because it can be run manually when making changes to the GC that can have effects in OOM scenarios, but not appropriate to run on our current test infrastructure.</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\keepalive\keepalive.cmd">
- <Issue>3392</Issue>
+ <Issue>3392, test is useful to have because it can be run manually when making changes to the GC that can have effects in OOM scenarios, but not appropriate to run on our current test infrastructure.</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\GC\LargeMemory\API\gc\suppressfinalize\suppressfinalize.cmd">
- <Issue>3392</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\divrem\div\u8div_cs_do\u8div_cs_do.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\divrem\div\u8div_cs_ro\u8div_cs_ro.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\divrem\rem\u8rem_cs_do\u8rem_cs_do.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\divrem\rem\u8rem_cs_ro\u8rem_cs_ro.cmd">
- <Issue>needs triage</Issue>
+ <Issue>3392, test is useful to have because it can be run manually when making changes to the GC that can have effects in OOM scenarios, but not appropriate to run on our current test infrastructure.</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\tailcall_v4\smallFrame\smallFrame.cmd">
<Issue>tail. call pop ret is only supported on amd64</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\Inline\regression\mismatch32\mismatch32\mismatch32.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\Inline\regression\mismatch64\mismatch64\mismatch64.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\opt\perf\doublealign\Locals\Locals.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\opt\Tailcall\TailcallVerifyWithPrefix\TailcallVerifyWithPrefix.cmd">
- <Issue>x86 JIT doesn't support implicit tail call optimization or tail. call pop ret sequence</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Performance\CodeQuality\Roslyn\CscBench\CscBench.cmd">
- <Issue>6844</Issue>
+ <Issue>2420. x86 JIT doesn't support implicit tail call optimization or tail. call pop ret sequence</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\Dev11\External\dev11_239804\ShowLocallocAlignment\ShowLocallocAlignment.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\managed\Compilation\Compilation\Compilation.cmd">
- <Issue>needs triage</Issue>
- </ExcludeList>
- </ItemGroup>
-
- <!-- The following x86 failures only occur with RyuJIT/x86 -->
-
- <ItemGroup Condition="'$(XunitTestBinBase)' != '' and '$(BuildArch)' == 'x86'">
- <ExcludeList Include="$(XunitTestBinBase)\JIT\jit64\eh\basics\loopEH\loopEH.cmd">
- <Issue>6778</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Methodical\int64\superlong\_il_relsuperlong\_il_relsuperlong.cmd">
- <Issue>6778</Issue>
- </ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\GC\Scenarios\DoublinkList\dlstack\*">
- <Issue>6553</Issue>
+ <Issue>7163, fails on both legacy backend and RyuJIT</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\CLR-x86-JIT\V1.2-Beta1\b103058\b103058\b103058.cmd">
- <Issue>7008</Issue>
+ <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\DevDiv_255294\DevDiv_255294\DevDiv_255294.cmd">
+ <Issue>The test is too large for x86 and causes OutOfMemory exception.</Issue>
</ExcludeList>
</ItemGroup>
diff --git a/tests/override.targets b/tests/override.targets
index 8bdff51..36a9615 100644
--- a/tests/override.targets
+++ b/tests/override.targets
@@ -3,8 +3,6 @@
Overrides for all other targets (including build tools) can go in this file.
-->
- <Import Project="mono.targets" Condition="'$(OsEnvironment)'=='Unix'" />
- <Import Project="roslyn.xplat.targets" Condition="'$(OsEnvironment)'=='Unix'" />
<!-- Contains overrides for the nuget reference resolution. The regular nuget reference resolution will not
copy references local, which we need in order to correctly execute the xunit project -->
<Import Project="xunitwrapper.targets" Condition="'$(IsXunitWrapperProject)'=='true'" />
diff --git a/tests/publishdependency.targets b/tests/publishdependency.targets
index 554b1ee..9e286fc 100644
--- a/tests/publishdependency.targets
+++ b/tests/publishdependency.targets
@@ -3,18 +3,50 @@
<UsingTask TaskName="PrereleaseResolveNuGetPackageAssets" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
<ItemGroup>
- <TestTargetFramework Include=".NETCoreApp,Version=v1.0">
- <Folder>netcoreapp1.0</Folder>
+ <TestTargetFramework Include=".NETCoreApp,Version=v1.1">
+ <Folder>netcoreapp1.1</Folder>
</TestTargetFramework>
</ItemGroup>
+ <PropertyGroup>
+ <!-- defined in buildtools packaging.targets, but we need this before targets are imported -->
+ <PackagePlatform Condition="'$(PackagePlatform)' == ''">$(__BuildArch)</PackagePlatform>
+ <PackagePlatform Condition="'$(PackagePlatform)' == 'amd64'">x64</PackagePlatform>
+ <MinOSForArch>win7</MinOSForArch>
+ <MinOSForArch Condition="'$(PackagePlatform)' == 'arm'">win8</MinOSForArch>
+ <MinOSForArch Condition="'$(PackagePlatform)' == 'arm64'">win10</MinOSForArch>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\project.lock.json"/>
+ <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\project.lock.json"/>
+ </ItemGroup>
+
+ <ItemGroup>
+ <NonWindowsProjectLockJsonFiles Include="@(CoreRootProjectLockJsonFiles)"/>
+ <NonWindowsProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\project.lock.json"/>
+ </ItemGroup>
+
+ <ItemGroup>
+ <RefProjectLockJsonFiles Include="$(SourceDir)Common\targeting_pack_ref\project.lock.json"/>
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProductProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\project.lock.json"/>
+ </ItemGroup>
+
<ItemGroup>
- <ProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\project.lock.json"/>
- <ProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\project.lock.json"/>
+ <CrossGenFiles Include="..\packages\runtime.$(MinOSForArch)-$(PackagePlatform).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen.exe"/>
</ItemGroup>
+ <PropertyGroup>
+ <ProductDestination>$(ProjectDir)\..\bin\Product\$(BuildOS).$(BuildArch).$(BuildType)</ProductDestination>
+ <RefDestination>$(ProductDestination)\ref</RefDestination>
+ <CoreOverlay>$(CORE_ROOT)\..\coreoverlay</CoreOverlay>
+ </PropertyGroup>
+
<Target Name="CopyDependecyToCoreRoot"
- Inputs="@(ProjectLockJsonFiles)"
+ Inputs="@(CoreRootProjectLockJsonFiles)"
Outputs="$(CORE_ROOT)\*.*">
<MSBuild Projects="$(SourceDir)Common\test_runtime\test_runtime.csproj"/>
@@ -23,12 +55,12 @@
<!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
for the xunit wrapper projects -->
- <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
+ <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="false"
IncludeFrameworkReferences="false"
NuGetPackagesDirectory="$(PackagesDir)"
RuntimeIdentifier="$(TestNugetRuntimeId)"
ProjectLanguage="$(Language)"
- ProjectLockFile="%(ProjectLockJsonFiles.Identity)"
+ ProjectLockFile="%(CoreRootProjectLockJsonFiles.Identity)"
TargetMonikers="@(TestTargetFramework)">
<Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
<Output TaskParameter="ResolvedReferences" ItemName="Reference" />
@@ -58,4 +90,147 @@
</Copy>
</Target>
+ <Target Name="CopyNonWindowsDependecyToCoreRoot"
+ Inputs="@(NonWindowsProjectLockJsonFiles)"
+ Outputs="$(CoreOverlay)\*.*">
+
+ <MSBuild Projects="$(SourceDir)Common\test_runtime\test_runtime.csproj"/>
+
+ <MSBuild Projects="$(SourceDir)Common\test_dependencies\test_dependencies.csproj"/>
+
+ <MSBuild Projects="$(SourceDir)Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj"/>
+
+ <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
+ for the xunit wrapper projects -->
+ <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
+ IncludeFrameworkReferences="false"
+ NuGetPackagesDirectory="$(PackagesDir)"
+ RuntimeIdentifier="$(RuntimeId)"
+ ProjectLanguage="$(Language)"
+ ProjectLockFile="%(NonWindowsProjectLockJsonFiles.Identity)"
+ TargetMonikers="@(TestTargetFramework)">
+ <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
+ <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
+ <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RunTimeCopyLocal" />
+ </PrereleaseResolveNuGetPackageAssets>
+ <ItemGroup>
+ <RunTimeDependecyExclude Include="$(CoreOverlay)\**\*.*" />
+ <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName)%(Extension)')" />
+ <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).ni%(Extension)')" />
+ <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).pdb')" />
+ <AllResolvedRuntimeDependencies Include="@(RunTimeCopyLocal -> '%(FileName)%(Extension)')">
+ <File>%(Identity)</File>
+ </AllResolvedRuntimeDependencies>
+ <RunTimeDependecyCopyLocalFile Include="@(AllResolvedRuntimeDependencies)" Exclude="@(RunTimeDependecyExcludeFiles)"/>
+ <RunTimeDependecyCopyLocal Include="@(RunTimeDependecyCopyLocalFile -> '%(File)')" />
+ </ItemGroup>
+
+ <Copy
+ SourceFiles="@(RunTimeDependecyCopyLocal)"
+ DestinationFolder="$(CoreOverlay)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+
+ <ItemGroup>
+ <NonWindowsCrossGenFiles Include="..\packages\runtime.$(RuntimeID).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen"/>
+ </ItemGroup>
+
+ <Copy
+ SourceFiles="@(NonWindowsCrossGenFiles)"
+ DestinationFolder="$(CoreOverlay)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+
+ </Target>
+
+ <Target Name="CopyDependencyToRef"
+ Inputs="@(RefProjectLockJsonFiles)"
+ Outputs="$(RefDestination)\*.*">
+
+ <MSBuild Projects="$(SourceDir)Common\targeting_pack_ref\targeting_pack_ref.csproj"/>
+
+ <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
+ for the xunit wrapper projects -->
+ <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
+ IncludeFrameworkReferences="false"
+ NuGetPackagesDirectory="$(PackagesDir)"
+ RuntimeIdentifier="$(TestNugetRuntimeId)"
+ ProjectLanguage="$(Language)"
+ ProjectLockFile="%(RefProjectLockJsonFiles.Identity)"
+ TargetMonikers="@(TestTargetFramework)">
+ <Output TaskParameter="ResolvedAnalyzers" ItemName="RefAnalyzer" />
+ <Output TaskParameter="ResolvedReferences" ItemName="RefReference" />
+ <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RefRunTimeCopyLocal" />
+ </PrereleaseResolveNuGetPackageAssets>
+
+ <Copy
+ SourceFiles="@(RefRunTimeCopyLocal)"
+ DestinationFolder="$(RefDestination)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+ </Target>
+
+ <Target Name="CopyDependencyToProduct"
+ Inputs="@(ProductProjectLockJsonFiles)"
+ Outputs="$(ProductDestination)\*.*">
+
+ <MSBuild Projects="$(SourceDir)Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj"/>
+
+ <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items
+ for the xunit wrapper projects -->
+ <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
+ IncludeFrameworkReferences="false"
+ NuGetPackagesDirectory="$(PackagesDir)"
+ RuntimeIdentifier="$(TestNugetRuntimeId)"
+ ProjectLanguage="$(Language)"
+ ProjectLockFile="%(ProductProjectLockJsonFiles.Identity)"
+ TargetMonikers="@(TestTargetFramework)">
+ <Output TaskParameter="ResolvedAnalyzers" ItemName="RefAnalyzer" />
+ <Output TaskParameter="ResolvedReferences" ItemName="RefReference" />
+ <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RefRunTimeCopyLocal" />
+ </PrereleaseResolveNuGetPackageAssets>
+
+ <Copy
+ SourceFiles="@(RefRunTimeCopyLocal)"
+ DestinationFolder="$(ProductDestination)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+ </Target>
+
+ <Target Name="CopyCrossgenToProduct"
+ Outputs="$(ProductDestination)\crossgen.exe;$(CoreOverlay)\crossgen.exe">
+
+ <Copy
+ SourceFiles="@(CrossGenFiles)"
+ DestinationFolder="$(ProductDestination)"
+ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
+ OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+ Retries="$(CopyRetryCount)"
+ RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+ UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
+ <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
+ </Copy>
+
+ </Target>
+
</Project>
diff --git a/tests/runtest.cmd b/tests/runtest.cmd
index 5620789..23b4bb5 100644
--- a/tests/runtest.cmd
+++ b/tests/runtest.cmd
@@ -1,10 +1,11 @@
-@if not defined __echo @echo off
+@if not defined _echo @echo off
setlocal EnableDelayedExpansion
:: Set the default arguments
set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT
+set __MSBuildBuildArch=x64
:: Default to highest Visual Studio version available
set __VSVersion=vs2015
@@ -30,6 +31,8 @@ set __Sequential=
set __msbuildExtraArgs=
set __LongGCTests=
set __GCSimulatorTests=
+set __AgainstPackages=
+set __JitDisasm=
:Arg_Loop
if "%1" == "" goto ArgsDone
@@ -43,6 +46,7 @@ if /i "%1" == "-help" goto Usage
if /i "%1" == "x64" (set __BuildArch=x64&set __MSBuildBuildArch=x64&shift&goto Arg_Loop)
if /i "%1" == "x86" (set __BuildArch=x86&set __MSBuildBuildArch=x86&shift&goto Arg_Loop)
+if /i "%1" == "arm" (set __BuildArch=arm&set __MSBuildBuildArch=arm&shift&goto Arg_Loop)
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
@@ -55,6 +59,7 @@ if /i "%1" == "SkipWrapperGeneration" (set __SkipWrapperGeneration=true&shift&go
if /i "%1" == "Exclude" (set __Exclude=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "Exclude0" (set __Exclude0=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "TestEnv" (set __TestEnv=%2&shift&shift&goto Arg_Loop)
+if /i "%1" == "AgainstPackages" (set __AgainstPackages=1&shift&goto Arg_Loop)
if /i "%1" == "sequential" (set __Sequential=1&shift&goto Arg_Loop)
if /i "%1" == "crossgen" (set __DoCrossgen=1&shift&goto Arg_Loop)
if /i "%1" == "longgc" (set __LongGCTests=1&shift&goto Arg_Loop)
@@ -63,11 +68,12 @@ if /i "%1" == "jitstress" (set COMPlus_JitStress=%2&shift&shift&goto
if /i "%1" == "jitstressregs" (set COMPlus_JitStressRegs=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "jitminopts" (set COMPlus_JITMinOpts=1&shift&shift&goto Arg_Loop)
if /i "%1" == "jitforcerelocs" (set COMPlus_ForceRelocs=1&shift&shift&goto Arg_Loop)
+if /i "%1" == "jitdisasm" (set __JitDisasm=1&shift&goto Arg_Loop)
if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&set __SkipWrapperGeneration=true&shift&goto Arg_Loop)
if /i "%1" == "PerfTests" (set __PerfTests=true&set __SkipWrapperGeneration=true&shift&goto Arg_Loop)
if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop)
REM change it to COMPlus_GCStress when we stop using xunit harness
-if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
+if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
:: All the rest of the args will be collected and passed directly to msbuild.
@@ -142,6 +148,10 @@ if not defined __Sequential (
set __msbuildCommonArgs=%__msbuildCommonArgs% /p:ParallelRun=false
)
+if defined __AgainstPackages (
+ set __msbuildCommonArgs=%__msbuildCommonArgs% /p:BuildTestsAgainstPackages=true
+)
+
REM Prepare the Test Drop
REM Cleans any NI from the last run
powershell "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
@@ -160,8 +170,8 @@ xcopy /s "%__BinDir%" "%CORE_ROOT%"
:SkipCoreRootSetup
-if defined __Exclude (if not exist %__Exclude% echo %__MsgPrefix%Error: Exclusion .targets file not found && exit /b 1)
-if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Environment script not found && exit /b 1)
+if defined __Exclude (if not exist %__Exclude% echo %__MsgPrefix%Error: Exclusion file %__Exclude% not found && exit /b 1)
+if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Environment script %__TestEnv% not found && exit /b 1)
REM These log files are created automatically by the test run process. Q: what do they depend on being set?
set __TestRunHtmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.html
@@ -185,7 +195,7 @@ call :PrecompileFX
:SkipPrecompileFX
if defined __GenerateLayoutOnly (
- exit /b 1
+ exit /b 0
)
if not exist %CORE_ROOT%\coreclr.dll (
@@ -248,6 +258,8 @@ REM ============================================================================
REM Compile the managed assemblies in Core_ROOT before running the tests
:PrecompileAssembly
+if defined __JitDisasm goto :jitdisasm
+
REM Skip mscorlib since it is already precompiled.
if /I "%3" == "mscorlib.dll" exit /b 0
if /I "%3" == "mscorlib.ni.dll" exit /b 0
@@ -267,6 +279,27 @@ if %__exitCode% neq 0 (
echo Successfully precompiled %2
exit /b 0
+:jitdisasm
+
+if /I "%3" == "mscorlib.ni.dll" exit /b 0
+
+echo "%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2"
+"%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2"
+set /a __exitCode = %errorlevel%
+
+if "%__exitCode%" == "-2146230517" (
+ echo %2 is not a managed assembly.
+ exit /b 0
+)
+
+if %__exitCode% neq 0 (
+ echo Unable to precompile %2
+ exit /b 0
+)
+
+echo Successfully precompiled and generated dasm for %2
+exit /b 0
+
:PrecompileFX
for %%F in (%CORE_ROOT%\*.dll) do call :PrecompileAssembly "%CORE_ROOT%" "%%F" %%~nF%%~xF
exit /b 0
@@ -297,6 +330,7 @@ set __msbuildLogArgs=^
set __msbuildArgs=%* %__msbuildCommonArgs% %__msbuildLogArgs%
@REM The next line will overwrite the existing log file, if any.
+echo %_msbuildexe% %__msbuildArgs%
echo Invoking: %_msbuildexe% %__msbuildArgs% > "%__BuildLog%"
%_msbuildexe% %__msbuildArgs%
@@ -334,13 +368,23 @@ if defined __GCSimulatorTests (
set RunningGCSimulatorTests=1
)
+if defined __JitDisasm (
+ if defined __DoCrossgen (
+ echo Running jit disasm on framework and test assemblies
+ )
+ if not defined __DoCrossgen (
+ echo Running jit disasm on test assemblies only
+ )
+ set RunningJitDisasm=1
+)
+
set __BuildLogRootName=Tests_GenerateRuntimeLayout
call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:GenerateRuntimeLayout=true
if errorlevel 1 (
echo Test Dependency Resolution Failed
exit /b 1
)
-echo %__MsgPrefix% Created the runtime layout with all dependencies in %CORE_ROOT%
+echo %__MsgPrefix%Created the runtime layout with all dependencies in %CORE_ROOT%
exit /b 0
@@ -360,12 +404,14 @@ echo Set to "" to disable default exclusion file.
echo Exclude- Optional parameter - this will exclude individual tests from running, specified by ExcludeList ItemGroup in an .targets file.
echo TestEnv- Optional parameter - this will run a custom script to set custom test environment settings.
echo VSVersion- Optional parameter - VS2013 or VS2015 ^(default: VS2015^)
+echo AgainstPackages - Optional parameter - this indicates that we are running tests that were built against packages
echo GenerateLayoutOnly - If specified will not run the tests and will only create the Runtime Dependency Layout
echo RunCrossgenTests - Runs ReadytoRun tests
echo jitstress n - Runs the tests with COMPlus_JitStress=n
echo jitstressregs n - Runs the tests with COMPlus_JitStressRegs=n
echo jitminopts - Runs the tests with COMPlus_JITMinOpts=1
echo jitforcerelocs - Runs the tests with COMPlus_ForceRelocs=1
+echo jitdisasm - Runs jit-dasm on the tests
echo gcstresslevel n - Runs the tests with COMPlus_GCStress=n
echo 0: None 1: GC on all allocs and 'easy' places
echo 2: GC on transitions to preemptive GC 4: GC on every allowable JITed instr
diff --git a/tests/runtest.proj b/tests/runtest.proj
index c02b8c8..acc4545 100644
--- a/tests/runtest.proj
+++ b/tests/runtest.proj
@@ -64,7 +64,6 @@ $(_XunitEpilog)
]]>
</_XunitWrapperGen>
- <XunitVersionCompiled>2.1.0</XunitVersionCompiled>
<XunitWrapperGenCsProj>
<![CDATA[
<?xml version="1.0" encoding="utf-8"?>
@@ -120,7 +119,6 @@ $(_XunitEpilog)
<ProjectLockJson>%24(TestWrappersPackagesConfigFileDirectory)project.lock.json</ProjectLockJson>
</PropertyGroup>
<Import Project="$(SourceDir)dir.targets" />
- <Import Project="$(ProjectDir)helix.targets" />
<PropertyGroup>
<OutDir>$(XunitTestBinBase)\$(Category)\</OutDir>
</PropertyGroup>
@@ -307,31 +305,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
</Target>
<Target Name="CreateAllWrappers" DependsOnTargets="GetListOfTestCmds;FindCmdDirectories">
- <MSBuild Projects="$(MSBuildProjectFile)" Targets="CreateXunitWrapper" Properties="_CMDDIR=%(TestDirectories.Identity)" />
-
- <!--
- Contents of a project.json that will be restored once with errors turned off. This works
- around the package being incompatible with dotnet restore. Only the package contents are
- required so the compatibility errors can be ignored.
- -->
- <PropertyGroup>
- <XunitRunnerRestoreGenConfig>{ "dependencies": { "xunit.runner.msbuild": "$(XunitPackageVersion)" }, "frameworks": { "net45": {} } }</XunitRunnerRestoreGenConfig>
- <XunitRunnerRestoreProjectDir>$(BaseOutputPath)\tempRestoreProject</XunitRunnerRestoreProjectDir>
- <XunitRunnerRestoreProjectJsonPath>$(XunitRunnerRestoreProjectDir)\project.json</XunitRunnerRestoreProjectJsonPath>
- </PropertyGroup>
-
- <MakeDir Directories="$(XunitRunnerRestoreProjectDir)" />
- <WriteLinesToFile File="$(XunitRunnerRestoreProjectJsonPath)"
- Lines="$(XunitRunnerRestoreGenConfig)"
- Overwrite="true" />
-
- <Exec Command="$(DnuRestoreCommand) &quot;$(XunitRunnerRestoreProjectJsonPath)&quot;"
- StandardOutputImportance="Low"
- CustomErrorRegularExpression="^Unable to resolve .*"
- IgnoreExitCode="true"
- IgnoreStandardErrorWarningFormat="true" />
-
- <MSBuild Projects="$(MSBuildProjectFile)" Targets="BuildXunitWrapper" Properties="_CMDDIR=%(TestDirectories.Identity)" />
+ <MSBuild Projects="$(MSBuildProjectFile)" Targets="CreateXunitWrapper;BuildXunitWrapper" Properties="_CMDDIR=%(TestDirectories.Identity)" />
</Target>
<Target Name="GetListOfTestCmds">
@@ -349,6 +323,28 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
Properties="Language=C#" />
</Target>
+ <Target Name="CreateNonWindowsTestOverlay">
+ <MSBuild Projects="$(MSBuildProjectFile)"
+ Targets="CopyNonWindowsDependecyToCoreRoot"
+ Properties="Language=C#;NonWindowsRuntimeId=$(NonWindowsRuntimeId)" />
+ </Target>
+
+ <Target Name="BinPlaceRef">
+ <!-- Copy mscorlib.dll from TargetingPack to bin/Product/ref, if we're building against packages -->
+ <MSBuild Projects="$(MSBuildProjectFile)"
+ Targets="CopyDependencyToRef"
+ Properties="Language=C#"
+ Condition=" '$(BuildTestsAgainstPackages)'=='true' " />
+ </Target>
+
+ <Target Name="BinPlaceProduct">
+ <!-- Copy test dependencies to bin/Product, if we're building against packages -->
+ <MSBuild Projects="$(MSBuildProjectFile)"
+ Targets="CopyDependencyToProduct"
+ Properties="Language=C#"
+ Condition=" '$(BuildTestsAgainstPackages)'=='true' " />
+ </Target>
+
<!-- All the test projects need to add dependency to currently built runtime as they require that to run.
In addition the version number of built runtime can change so all project.json needs to be dynamically generated.
Instead the following task creates a project.json with dependencies like Microsoft.netcore.runtime.coreclr ..etc.
diff --git a/tests/runtest.sh b/tests/runtest.sh
index cd5da94..1c67a70 100755
--- a/tests/runtest.sh
+++ b/tests/runtest.sh
@@ -50,6 +50,7 @@ function print_usage {
echo ' --jitstressregs=<n> : Runs the tests with COMPlus_JitStressRegs=n'
echo ' --jitminopts : Runs the tests with COMPlus_JITMinOpts=1'
echo ' --jitforcerelocs : Runs the tests with COMPlus_ForceRelocs=1'
+ echo ' --jitdisasm : Runs jit-dasm on the tests'
echo ' --gcstresslevel n : Runs the tests with COMPlus_GCStress=n'
echo ' 0: None 1: GC on all allocs and '"'easy'"' places'
echo ' 2: GC on transitions to preemptive GC 4: GC on every allowable JITed instr'
@@ -392,30 +393,43 @@ function create_core_overlay {
# Test dependencies come from a Windows build, and mscorlib.ni.dll would be the one from Windows
rm -f "$coreOverlayDir/mscorlib.ni.dll"
fi
+ if [ -f "$coreOverlayDir/System.Private.CoreLib.ni.dll" ]; then
+ # Test dependencies come from a Windows build, and System.Private.CoreLib.ni.dll would be the one from Windows
+ rm -f "$coreOverlayDir/System.Private.CoreLib.ni.dll"
+ fi
+ copy_test_native_bin_to_test_root
}
function precompile_overlay_assemblies {
if [ $doCrossgen == 1 ]; then
-
local overlayDir=$CORE_ROOT
filesToPrecompile=$(ls -trh $overlayDir/*.dll)
for fileToPrecompile in ${filesToPrecompile}
do
local filename=${fileToPrecompile}
- # Precompile any assembly except mscorlib since we already have its NI image available.
- if [[ "$filename" != *"mscorlib.dll"* ]]; then
- if [[ "$filename" != *"mscorlib.ni.dll"* ]]; then
- echo Precompiling $filename
- $overlayDir/crossgen /Platform_Assemblies_Paths $overlayDir $filename 2>/dev/null
- local exitCode=$?
- if [ $exitCode == -2146230517 ]; then
- echo $filename is not a managed assembly.
- elif [ $exitCode != 0 ]; then
- echo Unable to precompile $filename.
- else
- echo Successfully precompiled $filename
+ if [ $jitdisasm == 1]; then
+
+ $overlayDir/corerun $overlayDir/jit-dasm.dll --crossgen $overlayDir/crossgen --platform $overlayDir --output $testRootDir/dasm $filename
+ local exitCode=$?
+ if [ $exitCode != 0 ]; then
+ echo Unable to generate dasm for $filename
+ fi
+ else
+ # Precompile any assembly except mscorlib since we already have its NI image available.
+ if [[ "$filename" != *"mscorlib.dll"* ]]; then
+ if [[ "$filename" != *"mscorlib.ni.dll"* ]]; then
+ echo Precompiling $filename
+ $overlayDir/crossgen /Platform_Assemblies_Paths $overlayDir $filename 2>/dev/null
+ local exitCode=$?
+ if [ $exitCode == -2146230517 ]; then
+ echo $filename is not a managed assembly.
+ elif [ $exitCode != 0 ]; then
+ echo Unable to precompile $filename.
+ else
+ echo Successfully precompiled $filename
+ fi
fi
fi
fi
@@ -737,10 +751,14 @@ function finish_test {
local testRunningTime=
local header=
+ if ((verbose == 1)); then
+ header=$(printf "[%4d]" $countTotalTests)
+ fi
+
if [ "$showTime" == "ON" ]; then
testEndTime=$(date +%s)
- testRunningTime=$(echo "$testEndTime - ${testStartTimes[$nextProcessIndex]}" | bc)
- header=$(printf "[%03d:%4.0fs] " "$countTotalTests" "$testRunningTime")
+ testRunningTime=$(( $testEndTime - ${testStartTimes[$nextProcessIndex]} ))
+ header=$header$(printf "[%4ds]" $testRunningTime)
fi
local xunitTestResult
@@ -790,6 +808,7 @@ function finish_remaining_tests {
function prep_test {
local scriptFilePath=$1
+ local scriptFileDir=$(dirname "$scriptFilePath")
test "$verbose" == 1 && echo "Preparing $scriptFilePath"
@@ -802,8 +821,8 @@ function prep_test {
chmod +x "$scriptFilePath"
#remove any NI and Locks
- rm -f *.ni.*
- rm -rf lock
+ rm -f $scriptFileDir/*.ni.*
+ rm -rf $scriptFileDir/lock
}
function start_test {
@@ -909,15 +928,9 @@ function coreclr_code_coverage {
}
function check_cpu_architecture {
- # Use uname to determine what the CPU is.
- local CPUName=$(uname -p)
+ local CPUName=$(uname -m)
local __arch=
- # Some Linux platforms report unknown for platform, but the arch for machine.
- if [ "$CPUName" == "unknown" ]; then
- CPUName=$(uname -m)
- fi
-
case $CPUName in
i686)
__arch=x86
@@ -941,6 +954,7 @@ function check_cpu_architecture {
}
ARCH=$(check_cpu_architecture)
+echo "Running on CPU- $ARCH"
# Exit code constants
readonly EXIT_CODE_SUCCESS=0 # Script ran normally.
@@ -973,6 +987,7 @@ limitedCoreDumps=
# Handle arguments
verbose=0
doCrossgen=0
+jitdisasm=0
for i in "$@"
do
@@ -999,6 +1014,9 @@ do
--jitforcerelocs)
export COMPlus_ForceRelocs=1
;;
+ --jitdisasm)
+ jitdisasm=1
+ ;;
--testRootDir=*)
testRootDir=${i#*=}
;;
@@ -1125,6 +1143,11 @@ if [ ! -z "$gcsimulator" ]; then
export RunningGCSimulatorTests=1
fi
+if [ ! -z "$jitdisasm" ]; then
+ echo "Running jit disasm"
+ export RunningJitDisasm=1
+fi
+
# If this is a coverage run, make sure the appropriate args have been passed
if [ "$CoreClrCoverage" == "ON" ]
then
@@ -1161,7 +1184,6 @@ fi
xunit_output_begin
create_core_overlay
precompile_overlay_assemblies
-copy_test_native_bin_to_test_root
if [ "$buildOverlayOnly" == "ON" ];
then
diff --git a/tests/scripts/arm32_ci_script.sh b/tests/scripts/arm32_ci_script.sh
index 1b016bb..85ee4d2 100755
--- a/tests/scripts/arm32_ci_script.sh
+++ b/tests/scripts/arm32_ci_script.sh
@@ -128,6 +128,8 @@ function clean_env {
#Check for revert of git changes
check_git_head
+
+ sudo rm -rf "/mnt/arm32_ci_temp"
}
#Trap Ctrl-C and handle it
@@ -173,37 +175,56 @@ function mount_emulator {
sudo mkdir "$__ARMRootfsMountPath"
fi
- set +x
- mount_with_checking "" "$__ARMEmulPath/platform/rootfs-t30.ext4" "$__ARMRootfsMountPath"
- mount_with_checking "-t proc" "/proc" "$__ARMRootfsMountPath/proc"
- mount_with_checking "-o bind" "/dev/" "$__ARMRootfsMountPath/dev"
- mount_with_checking "-o bind" "/dev/pts" "$__ARMRootfsMountPath/dev/pts"
- mount_with_checking "-t tmpfs" "shm" "$__ARMRootfsMountPath/run/shm"
- mount_with_checking "-o bind" "/sys" "$__ARMRootfsMountPath/sys"
- if [ ! -d "$__ARMRootfsMountPath/bindings/tmp" ]; then
- sudo mkdir -p "$__ARMRootfsMountPath/bindings/tmp"
+ if [ ! -d "$__ARMEmulRootfs" ]; then
+ sudo mkdir "$__ARMEmulRootfs"
+ fi
+
+ if [ ! -f "$__ARMEmulRootfs/arm-emulator-rootfs.tar" ]; then
+ if mountpoint -q -- "$__ARMRootfsMountPath"; then
+ sudo umount -l $__ARMRootfsMountPath
+ fi
+ mount_with_checking "" "$__ARMEmulPath/platform/rootfs-t30.ext4" "$__ARMRootfsMountPath"
+
+ cd $__ARMRootfsMountPath
+ sudo tar -cf "$__ARMEmulRootfs/arm-emulator-rootfs.tar" *
+ cd -
+ fi
+
+ sudo tar -xf "$__ARMEmulRootfs/arm-emulator-rootfs.tar" -C "$__ARMEmulRootfs"
+
+ mount_with_checking "-t proc" "/proc" "$__ARMEmulRootfs/proc"
+ mount_with_checking "-o bind" "/dev/" "$__ARMEmulRootfs/dev"
+ mount_with_checking "-o bind" "/dev/pts" "$__ARMEmulRootfs/dev/pts"
+ mount_with_checking "-t tmpfs" "shm" "$__ARMEmulRootfs/run/shm"
+ mount_with_checking "-o bind" "/sys" "$__ARMEmulRootfs/sys"
+ if [ ! -d "$__ARMEmulRootfs/bindings/tmp" ]; then
+ sudo mkdir -p "$__ARMEmulRootfs/bindings/tmp"
fi
- mount_with_checking "-o bind" "/mnt" "$__ARMRootfsMountPath/bindings/tmp"
+ mount_with_checking "-o bind" "/mnt" "$__ARMEmulRootfs/bindings/tmp"
+
+ if [ ! -d "$__ARMEmulRootfs/$__TempFolder" ]; then
+ sudo mkdir "$__ARMEmulRootfs/$__TempFolder"
+ fi
}
#Cross builds coreclr
function cross_build_coreclr {
#Export the needed environment variables
(set +x; echo 'Exporting LINUX_ARM_* environment variable')
- source "$__ARMRootfsMountPath"/dotnet/setenv/setenv_incpath.sh "$__ARMRootfsMountPath"
+ source "$__ARMEmulRootfs"/dotnet/setenv/setenv_incpath.sh "$__ARMEmulRootfs"
#Apply the changes needed to build for the emulator rootfs
(set +x; echo 'Applying cross build patch to suit Linux ARM emulator rootfs')
- git am < "$__ARMRootfsMountPath"/dotnet/setenv/coreclr_cross.patch
+ git am < "$__ARMEmulRootfs"/dotnet/setenv/coreclr_cross.patch
#Apply release optimization patch if needed
if [[ "$__buildConfig" == "Release" ]]; then
(set +x; echo 'Applying release optimization patch to build in Release mode')
- git am < "$__ARMRootfsMountPath"/dotnet/setenv/coreclr_release.patch
+ git am < "$__ARMEmulRootfs"/dotnet/setenv/coreclr_release.patch
fi
#Cross building for emulator rootfs
- ROOTFS_DIR="$__ARMRootfsMountPath" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS ./build.sh $__buildArch cross $__verboseFlag $__skipMscorlib clang3.5 $__buildConfig -rebuild
+ ROOTFS_DIR="$__ARMEmulRootfs" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS ./build.sh $__buildArch cross $__verboseFlag $__skipMscorlib clang3.5 $__buildConfig -rebuild
#Reset the code to the upstream version
(set +x; echo 'Rewinding HEAD to master code')
@@ -268,9 +289,10 @@ function copy_to_emulator {
#Runs tests in an emulated mode
function run_tests {
- sudo chroot $__ARMRootfsMountPath /bin/bash -x <<EOF
+ sudo chroot $__ARMEmulRootfs /bin/bash -x <<EOF
cd "$__ARMEmulCoreclr"
- ./tests/runtest.sh --testRootDir=$__testRootDirBase \
+ ./tests/runtest.sh --sequential\
+ --testRootDir=$__testRootDirBase \
--mscorlibDir=$__mscorlibDirBase \
--coreFxNativeBinDir=$__coreFxNativeBinDirBase \
--coreFxBinDir="$__coreFxBinDirBase" \
@@ -281,6 +303,7 @@ EOF
}
#Define script variables
+__ARMEmulRootfs=/mnt/arm-emulator-rootfs
__ARMEmulPath=
__ARMRootfsMountPath=
__buildConfig=
@@ -397,13 +420,8 @@ __buildDirName="$__buildOS.$__buildArch.$__buildConfig"
#Define emulator paths
__TempFolder="bindings/tmp/arm32_ci_temp"
-
-if [ ! -d "$__TempFolder" ]; then
- mkdir "$__TempFolder"
-fi
-
-__ARMRootfsCoreclrPath="$__ARMRootfsMountPath/$__TempFolder/coreclr"
-__ARMRootfsCorefxPath="$__ARMRootfsMountPath/$__TempFolder/corefx"
+__ARMRootfsCoreclrPath="$__ARMEmulRootfs/$__TempFolder/coreclr"
+__ARMRootfsCorefxPath="$__ARMEmulRootfs/$__TempFolder/corefx"
__ARMEmulCoreclr="/$__TempFolder/coreclr"
__ARMEmulCorefx="/$__TempFolder/corefx"
__testRootDirBase=
@@ -447,10 +465,10 @@ copy_to_emulator
(set +x; echo 'Running tests...')
run_tests
+
#Clean the environment
(set +x; echo 'Cleaning environment...')
clean_env
-rm -r "/mnt/arm32_ci_temp"
(set +x; echo 'Build and test complete')
diff --git a/tests/scripts/arm64_post_build.py b/tests/scripts/arm64_post_build.py
new file mode 100644
index 0000000..49f5f6a
--- /dev/null
+++ b/tests/scripts/arm64_post_build.py
@@ -0,0 +1,311 @@
+################################################################################
+################################################################################
+#
+# Module: arm64_post_build.py
+#
+# Notes:
+#
+# This script is responsible for starting the x64 dotnet client. In order to
+# do this it has to pass along the core_root that was built in the previous
+# build steps using build.cmd.
+#
+# After everything has run, the dotnet client will dump a bunch of information
+# to the console. It will be captured, parsed, and a series of xunit xml files
+# will be created so that jenkins can parse it to display results.
+#
+################################################################################
+################################################################################
+
+import argparse
+import errno
+import os
+import urllib
+import urllib2
+import shutil
+import subprocess
+import sys
+import zipfile
+
+from collections import defaultdict
+
+################################################################################
+# Globals
+################################################################################
+
+g_arm64ci_path = os.path.join(os.environ["USERPROFILE"], "bin")
+g_dotnet_url = "https://go.microsoft.com/fwlink/?LinkID=831469"
+g_test_url = "https://clrjit.blob.core.windows.net/arm64ci/CoreCLRTests-2c0a2c05ba82460a8d8a4b1e2d98e908e59d5d54.zip"
+g_x64_client_url = "https://clrjit.blob.core.windows.net/arm64ci/x64_client.zip"
+
+################################################################################
+# Argument Parser
+################################################################################
+
+description = """Python script to facilitate running an arm64/arm test run using
+ the cloud.
+ """
+
+parser = argparse.ArgumentParser(description=description)
+
+parser.add_argument("--force_update", dest="force_update", action="store_true", default=False)
+
+parser.add_argument("-repo_root", dest="repo_root", nargs='?', default=None)
+parser.add_argument("-arch", dest="arch", nargs='?', default=None)
+parser.add_argument("-build_type", dest="build_type", nargs='?', default=None)
+parser.add_argument("-scenario", dest="scenario", nargs='?', default=None)
+parser.add_argument("-key_location", dest="key_location", nargs='?', default=None)
+
+################################################################################
+# Helper Functions
+################################################################################
+
+def add_item_to_path(location):
+ """ Add the dotnet install to the path
+ """
+
+ os.environ["PATH"] = location + ";" + os.environ["PATH"]
+
+def copy_core_root(core_root):
+ """ Copy the core root directory to the current dir as "build"
+ Args:
+ core_root (str): location of the core_root directory
+ Returns:
+ copy_location (str): name of the location, for now hardcoded to build
+ : for backcompat in the old system
+ """
+
+ new_location = "build"
+
+ # Delete used instances.
+ if os.path.isdir(new_location):
+ try:
+ shutil.rmtree(new_location)
+ except:
+ assert not os.path.isdir(new_location)
+
+ try:
+ shutil.copytree(core_root, new_location)
+
+ except OSError as error:
+ log("Core Root not copied. Error: %s" % error)
+
+ return new_location
+
+def log(message):
+ """ Helper function to print logging information
+ Args:
+ message (str): message to be printed
+ """
+
+ print "[arm64_post_build]: %s" % (message)
+
+def setup_cli(force_update=False):
+ """ Install the dotnet cli onto the machine
+ Args:
+ force_update (bool): whether or not to force an update.
+ Return:
+ install_location (str): location of the installed cli
+ Notes:
+ This will be installed to %USERPROFILE%\dotnet. If force update is False
+ then we will not install the cli if it already exists.
+
+ """
+ global g_dotnet_url
+
+ install_path = os.path.join(os.environ["USERPROFILE"], "dotnet")
+
+ # Only install if the cli doesn't exist or we are forcing an update
+ if not os.path.isdir(install_path) or force_update:
+ log("Downloading the .NET CLI")
+ if os.path.isdir(install_path):
+ try:
+ shutil.rmtree(install_path)
+ except:
+ assert not os.path.isdir(install_path)
+
+ os.mkdir(install_path)
+
+ filename = os.path.join(install_path, 'dotnet-cli.zip')
+ urllib.urlretrieve(g_dotnet_url, filename)
+
+ if not os.path.isfile(filename):
+ raise Exception("Error failed to download cli.")
+
+ with zipfile.ZipFile(filename, 'r') as file_handle:
+ file_handle.extractall(install_path)
+
+ return install_path
+
+def setup_x64_client(key_location, force_update=True):
+ """ Setup the x64 client which will be used to communicate to the proxy
+ Args:
+ force_update (bool): whether or not to force an update, defaults to true
+ Return:
+ install_location (str): location of the installed x64_client
+ Notes:
+ Assume that the package has changed, so that every run will trigger an
+ update. If there is no update then the install will be fairly quick either
+ way.
+ """
+ global g_x64_client_url
+ install_path = os.path.join(os.environ["USERPROFILE"], "bin")
+
+ # If installed and force update is not set. Just return
+ if os.path.isdir(install_path) and not force_update:
+ return install_path
+
+ log("Downloading the x64_client")
+
+ if os.path.isdir(install_path):
+ # Delete the old location
+ try:
+ shutil.rmtree(install_path)
+ except:
+ assert not os.path.isdir(install_path)
+ os.mkdir(install_path)
+
+ filename = os.path.join(install_path, 'x64_client.zip')
+ urllib.urlretrieve(g_x64_client_url, filename)
+
+ if not os.path.isfile(filename):
+ raise Exception("Error failed to download the x64_client.")
+
+ with zipfile.ZipFile(filename, 'r') as file_handle:
+ file_handle.extractall(install_path)
+
+ # Copy key_location
+ shutil.copy2(key_location, install_path)
+
+ return install_path
+
+def validate_args(args):
+ """ Validate all of the arguments parsed.
+ Args:
+ args (argparser.ArgumentParser): Args parsed by the argument parser.
+ Returns:
+ (workspace, arch, build_type, scenario, force_update): (str,
+ str,
+ str,
+ str,
+ str,
+ bool)
+ Notes:
+ If the arguments are valid then return them all in a tuple. If not, raise
+ an exception stating x argument is incorrect.
+ """
+
+ repo_root = args.repo_root
+ arch = args.arch
+ build_type = args.build_type
+ scenario = args.scenario
+ key_location = args.key_location
+ force_update = args.force_update
+
+ def validate_arg(arg, check):
+ """ Validate an individual arg
+ Args:
+ arg (str|bool): argument to be validated
+ check (lambda: x-> bool): check that returns either True or False
+ : based on whether the check works.
+
+ Returns:
+ is_valid (bool): Is the argument valid?
+ """
+
+ helper = lambda item: item is not None and check(item)
+
+ if not helper(arg):
+ raise Exception("Argument: %s is not valid." % (arg))
+
+ valid_arches = ["arm", "arm64"]
+ valid_build_types = ["debug", "checked", "release"]
+ valid_scenarios = ["default", "pri1r2r", "gcstress0x3", "gcstress0xc"]
+
+ validate_arg(repo_root, lambda item: os.path.isdir(item))
+ validate_arg(arch, lambda item: item.lower() in valid_arches)
+ validate_arg(build_type, lambda item: item.lower() in valid_build_types)
+ validate_arg(scenario, lambda item: item.lower() in valid_scenarios)
+ validate_arg(key_location, lambda item: os.path.isfile(item))
+ validate_arg(force_update, lambda item: isinstance(item, bool))
+
+ arch = arch.lower()
+ build_type = build_type.lower()
+ scenario = scenario.lower()
+
+ args = (repo_root, arch, build_type, scenario, key_location, force_update)
+
+ log("Passed args: "
+ "Repo Root: %s, "
+ "Build Arch: %s, "
+ "Config: %s, "
+ "Scenario: %s, "
+ "Key Location: %s" % (repo_root, arch, build_type, scenario, key_location))
+
+ return args
+
+################################################################################
+# Main
+################################################################################
+
+def main(args):
+ global g_arm64ci_path
+ global g_test_url
+
+ repo_root, arch, build_type, scenario, key_location, force_update = validate_args(args)
+
+ core_root = os.path.join(repo_root,
+ "bin",
+ "Product",
+ "Windows_NT.%s.%s" % (arch, build_type))
+
+ cli_location = setup_cli(force_update=force_update)
+ add_item_to_path(cli_location)
+
+ g_arm64ci_path = setup_x64_client(key_location)
+
+ cwd = os.getcwd()
+ os.chdir(g_arm64ci_path)
+
+ core_root = copy_core_root(core_root)
+ log("Copied core_root to %s." % core_root)
+
+ # Make sure the lst file is copied into the core_root
+ lst_file = os.path.join(repo_root, "tests", arch, "Tests.lst")
+ shutil.copy2(lst_file, core_root)
+ log("Copied %s to %s." % (lst_file, core_root))
+
+ args = ["dotnet",
+ os.path.join(g_arm64ci_path, "x64_client.dll"),
+ arch,
+ build_type,
+ scenario,
+ core_root,
+ g_test_url]
+
+ log(" ".join(args))
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ std_out, std_err = proc.communicate()
+
+ # Restore directory
+ os.chdir(cwd)
+
+ if std_out == "":
+ print std_err
+ else:
+ print std_out
+
+ if std_out is not None and isinstance(std_out, str):
+ if len(std_out.split("TestID")) > 1:
+ sys.exit(1)
+
+ # This run has been successful.
+ elif len(std_out) > 0:
+ sys.exit(0)
+
+################################################################################
+# setup for Main
+################################################################################
+
+if __name__ == "__main__":
+ args = parser.parse_args(sys.argv[1:])
+ main(args)
diff --git a/tests/scripts/format.py b/tests/scripts/format.py
index 50a0d3d..9736c03 100644
--- a/tests/scripts/format.py
+++ b/tests/scripts/format.py
@@ -176,30 +176,52 @@ def main(argv):
my_env["PATH"] += os.pathsep + jitutilsBin
current_dir = os.getcwd()
- if os.path.isdir(jitutilsBin):
- os.chdir(jitutilsBin)
- else:
+ if not os.path.isdir(jitutilsBin):
print("Jitutils not built!")
return -1
- jitformat = ""
+ jitformat = jitutilsBin
if platform == 'Linux' or platform == 'OSX':
- jitformat = "jit-format"
+ jitformat = os.path.join(jitformat, "jit-format")
elif platform == 'Windows_NT':
- jitformat = "jit-format.cmd"
+ jitformat = os.path.join(jitformat,"jit-format.bat")
+ errorMessage = ""
+
+ builds = ["Checked", "Debug", "Release"]
+ projects = ["dll", "standalone", "crossgen"]
- for build in ["Checked", "Debug", "Release"]:
- for project in ["dll", "standalone", "crossgen"]:
+ for build in builds:
+ for project in projects:
proc = subprocess.Popen([jitformat, "-a", arch, "-b", build, "-o", platform, "-c", coreclr, "--verbose", "--projects", project], env=my_env)
output,error = proc.communicate()
errorcode = proc.returncode
if errorcode != 0:
+ errorMessage += "\tjit-format -a " + arch + " -b " + build + " -o " + platform
+ errorMessage += " -c <absolute-path-to-coreclr> --verbose --fix --projects " + project +"\n"
returncode = errorcode
+ # Fix mode doesn't return an error, so we have to run the build, then run with
+ # --fix to generate the patch. This means that it is likely only the first run
+ # of jit-format will return a formatting failure.
+ if errorcode == -2:
+ # If errorcode was -2, no need to run clang-tidy again
+ proc = subprocess.Popen([jitformat, "--fix", "--untidy", "-a", arch, "-b", build, "-o", platform, "-c", coreclr, "--verbose", "--projects", project], env=my_env)
+ output,error = proc.communicate()
+ else:
+ # Otherwise, must run both
+ proc = subprocess.Popen([jitformat, "--fix", "-a", arch, "-b", build, "-o", platform, "-c", coreclr, "--verbose", "--projects", project], env=my_env)
+ output,error = proc.communicate()
+
os.chdir(current_dir)
+ if returncode != 0:
+ # Create a patch file
+ patchFile = open("format.patch", "w")
+ proc = subprocess.Popen(["git", "diff", "--patch", "-U20"], env=my_env, stdout=patchFile)
+ output,error = proc.communicate()
+
if os.path.isdir(jitUtilsPath):
print("Deleting " + jitUtilsPath)
shutil.rmtree(jitUtilsPath, onerror=del_rw)
@@ -212,6 +234,14 @@ def main(argv):
print("Deleting " + bootstrapPath)
os.remove(bootstrapPath)
+ if returncode != 0:
+ buildUrl = my_env["BUILD_URL"]
+ print("There were errors in formatting. Please run jit-format locally with: \n")
+ print(errorMessage)
+ print("\nOr download and apply generated patch:")
+ print("wget " + buildUrl + "artifact/format.patch")
+ print("git apply format.patch")
+
return returncode
if __name__ == '__main__':
diff --git a/tests/scripts/perf-prep.sh b/tests/scripts/perf-prep.sh
new file mode 100755
index 0000000..27e4100
--- /dev/null
+++ b/tests/scripts/perf-prep.sh
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+
+function print_usage {
+ echo ''
+ echo 'CoreCLR perf test environment set up script on Linux.'
+ echo ''
+ echo 'Typical command line:'
+ echo ''
+ echo 'coreclr/tests/scripts/perf-perp.sh'
+ echo ' --branch="dotnet_coreclr"'
+ echo ''
+ echo 'Required arguments:'
+ echo ' --branch=<path> : branch where coreclr/corefx/test bits are copied from (e.g. dotnet_coreclr).'
+}
+
+# Exit code constants
+readonly EXIT_CODE_SUCCESS=0 # Script ran normally.
+
+# Argument variables
+perfArch="x64"
+perfConfig="Release"
+perfBranch=
+
+for i in "$@"
+do
+ case $i in
+ -h|--help)
+ print_usage
+ exit $EXIT_CODE_SUCCESS
+ ;;
+ --branch=*)
+ perfBranch=${i#*=}
+ ;;
+ *)
+ echo "Unknown switch: $i"
+ print_usage
+ exit $EXIT_CODE_SUCCESS
+ ;;
+ esac
+done
+
+perfBranch="dotnet_coreclr"
+echo "branch = $perfBranch"
+echo "architecture = $perfArch"
+echo "configuration = $perfConfig"
+
+# Since not all perf machines have Mono we cannot run nuget locally to get the Benchview tools
+# Instead we curl the package feed and use grep and sed to find the newest package.
+# We grep for content type and that returns us strings that contain the path to the nupkg
+# Then we match only the last line using '$' and use the s command to replace the entire line
+# with what we find inside of the quotes after src=. We then jump to label x on a match and if
+# we don't match we delete the line. This returns just the address of the last nupkg to curl.
+curl "http://benchviewtestfeed.azurewebsites.net/nuget/FindPackagesById()?id='Microsoft.BenchView.JSONFormat'" | grep "content type" | sed "$ s/.*src=\"\([^\"]*\)\".*/\1/;tx;d;:x" | xargs curl -o benchview.zip
+unzip -q -o benchview.zip -d ./tests/scripts/Microsoft.BenchView.JSONFormat
+
+# Install python 3.5.2 to run machinedata.py for machine data collection
+python3.5 --version
+python3.5 ./tests/scripts/Microsoft.BenchView.JSONFormat/tools/machinedata.py
+
+# Set up the copies
+# Coreclr build containing the tests and mscorlib
+curl http://ci.dot.net/job/$perfBranch/job/master/job/release_windows_nt/lastSuccessfulBuild/artifact/bin/tests/tests.zip -L -o tests.zip
+
+
+# Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
+mkdir corefx
+curl http://ci.dot.net/job/dotnet_corefx/job/master/job/ubuntu14.04_release/lastSuccessfulBuild/artifact/bin/build.tar.gz -L -o ./corefx/build.tar.gz
+
+# Unpack the corefx binaries
+pushd corefx > /dev/null
+tar -xf build.tar.gz
+popd > /dev/null
+
+# Unzip the tests first. Exit with 0
+mkdir bin
+mkdir bin/tests
+unzip -q -o tests.zip -d ./bin/tests/Windows_NT.$perfArch.$perfConfig || exit 0
+echo "unzip tests to ./bin/tests/Windows_NT.$perfArch.$perfConfig"
diff --git a/tests/scripts/project.json b/tests/scripts/project.json
index 8601127..b3c3a15 100644
--- a/tests/scripts/project.json
+++ b/tests/scripts/project.json
@@ -1,15 +1,18 @@
{
"dependencies": {
- "Microsoft.DotNet.xunit.performance.run.core": "1.0.0-alpha-build0035",
- "Microsoft.DotNet.xunit.performance.analysis.cli": "1.0.0-alpha-build0035",
- "Microsoft.DotNet.xunit.performance.runner.cli": "1.0.0-alpha-build0035",
- "Microsoft.DotNet.xunit.performance":"1.0.0-alpha-build0035",
- "xunit.console.netcore": "1.0.3-prerelease-00607-01",
- "Microsoft.DotNet.BuildTools.TestSuite": "1.0.0-prerelease-00629-04",
+ "Microsoft.DotNet.xunit.performance.run.core": "1.0.0-alpha-build0040",
+ "Microsoft.DotNet.xunit.performance.analysis.cli": "1.0.0-alpha-build0040",
+ "Microsoft.DotNet.xunit.performance.runner.cli": "1.0.0-alpha-build0040",
+ "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0040",
+ "xunit.console.netcore": "1.0.2-prerelease-00177",
+ "Microsoft.DotNet.BuildTools.TestSuite": "1.0.0-prerelease-00629-04"
},
"frameworks": {
- "netstandard1.3":{
- "imports":["dnxcore50", "portable-net45+win8"]
- }
+ "netstandard1.3": {
+ "imports": [
+ "dnxcore50",
+ "portable-net45+win8"
+ ]
+ }
}
-} \ No newline at end of file
+}
diff --git a/tests/scripts/run-xunit-perf.cmd b/tests/scripts/run-xunit-perf.cmd
index 89a7dac..a7d3c41 100644
--- a/tests/scripts/run-xunit-perf.cmd
+++ b/tests/scripts/run-xunit-perf.cmd
@@ -26,16 +26,18 @@ if NOT EXIST %CORECLR_OVERLAY% (
@echo --- setting up sandbox
-rd /s /q sandbox
-mkdir sandbox
+if exist sandbox rd /s /q sandbox
+if exist sandbox echo ERROR: Failed to remove the sandbox folder& exit /b 1
+if not exist sandbox mkdir sandbox
+if not exist sandbox echo ERROR: Failed to create the sandbox folder& exit /b 1
pushd sandbox
@rem stage stuff we need
@rem xunit and perf
-xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0035\tools\* . > %RUNLOG%
-xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0035\tools\* . >> %RUNLOG%
-xcopy /sy %CORECLR_REPO%\packages\xunit.console.netcore\1.0.2-prerelease-00101\runtimes\any\native\* . >> %RUNLOG%
+xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0040\tools\* . > %RUNLOG%
+xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0040\tools\* . >> %RUNLOG%
+xcopy /sy %CORECLR_REPO%\packages\xunit.console.netcore\1.0.2-prerelease-00177\runtimes\any\native\* . >> %RUNLOG%
xcopy /sy %CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root\* . >> %RUNLOG%
@rem find and stage the tests
@@ -43,6 +45,22 @@ for /R %CORECLR_PERF% %%T in (*.%TEST_FILE_EXT%) do (
call :DOIT %%T
)
+@rem optionally upload results to benchview
+if not [%BENCHVIEW_PATH%] == [] (
+ py "%BENCHVIEW_PATH%\submission.py" measurement.json ^
+ --build ..\build.json ^
+ --machine-data ..\machinedata.json ^
+ --metadata ..\submission-metadata.json ^
+ --group "CoreCLR" ^
+ --type "%RUN_TYPE%" ^
+ --config-name "%TEST_CONFIG%" ^
+ --config Configuration "%TEST_CONFIG%" ^
+ --config OS "Windows_NT" ^
+ --arch "%TEST_ARCH%" ^
+ --machinepool "PerfSnake"
+ py "%BENCHVIEW_PATH%\upload.py" submission.json --container coreclr
+)
+
goto :EOF
:DOIT
@@ -60,28 +78,16 @@ xunit.performance.run.exe %BENCHNAME%.%TEST_FILE_EXT% -runner xunit.console.netc
xunit.performance.analysis.exe %PERFOUT%.xml -xml %XMLOUT% > %BENCHNAME%-analysis.out
-@rem optionally upload results to benchview
+@rem optionally generate results for benchview
if not [%BENCHVIEW_PATH%] == [] (
- py %BENCHVIEW_PATH%\measurement.py xunit perf-%BENCHNAME%.xml --better desc --drop-first-value
- py %BENCHVIEW_PATH%\submission.py measurement.json ^
- --build ..\build.json ^
- --machine-data ..\machinedata.json ^
- --metadata ..\submission-metadata.json ^
- --group "CoreCLR" ^
- --type "%RUN_TYPE%" ^
- --config-name "%TEST_CONFIG%" ^
- --config Configuration "%TEST_CONFIG%" ^
- --config OS "Windows_NT" ^
- --arch "%TEST_ARCH%" ^
- --machinepool "PerfSnake"
- py %BENCHVIEW_PATH%\upload.py submission.json --container coreclr
+ py "%BENCHVIEW_PATH%\measurement.py" xunit "perf-%BENCHNAME%.xml" --better desc --drop-first-value --append
REM Save off the results to the root directory for recovery later in Jenkins
xcopy perf-%BENCHNAME%*.xml %CORECLR_REPO%\
xcopy perf-%BENCHNAME%*.etl %CORECLR_REPO%\
) else (
- type %XMLOUT% | findstr "test name"
- type %XMLOUT% | findstr Duration
- type %XMLOUT% | findstr InstRetired
+ type %XMLOUT% | findstr "test name"
+ type %XMLOUT% | findstr Duration
+ type %XMLOUT% | findstr InstRetired
)
goto :EOF
@@ -146,3 +152,5 @@ echo -uploadtoBenchview is used to specify a path to the Benchview tooling and w
echo set we will upload the results of the tests to the coreclr container in benchviewupload.
echo Runtype sets the runtype that we upload to Benchview, rolling for regular runs, and private for
echo PRs.
+
+goto :EOF
diff --git a/tests/scripts/run-xunit-perf.sh b/tests/scripts/run-xunit-perf.sh
index cea29c0..85ac433 100644..100755
--- a/tests/scripts/run-xunit-perf.sh
+++ b/tests/scripts/run-xunit-perf.sh
@@ -30,6 +30,11 @@ function print_usage {
echo ' (e.g. "corefx/bin/Linux.AnyCPU.Debug;corefx/bin/Unix.AnyCPU.Debug;corefx/bin/AnyOS.AnyCPU.Debug").'
echo ' If files with the same name are present in multiple directories, the first one wins.'
echo ' --coreFxNativeBinDir=<path> : Directory of the CoreFX native build (e.g. corefx/bin/Linux.x64.Debug).'
+ echo ' --uploadToBenchview : Specify this flag in order to have the results of the run uploaded to Benchview.'
+ echo ' This also requires that the os flag and runtype flag to be set. Lastly you must'
+ echo ' also have the BV_UPLOAD_SAS_TOKEN set to a SAS token for the Benchview upload container'
+ echo ' --benchViewOS=<os> : Specify the os that will be used to insert data into Benchview.'
+ echo ' --runType=<private|rolling> : Specify the runType for Benchview.'
}
# Variables for xUnit-style XML output. XML format: https://xunit.github.io/docs/format-xml-v2.html
@@ -311,6 +316,9 @@ coreClrBinDir=
mscorlibDir=
coreFxBinDir=
coreFxNativeBinDir=
+uploadToBenchview=
+benchViewOS=
+runType=
for i in "$@"
do
@@ -340,6 +348,15 @@ do
--coreFxNativeBinDir=*)
coreFxNativeBinDir=${i#*=}
;;
+ --benchViewOS=*)
+ benchViewOS=${i#*=}
+ ;;
+ --runType=*)
+ runType=${i#*=}
+ ;;
+ --uploadToBenchview)
+ uploadToBenchview=TRUE
+ ;;
*)
echo "Unknown switch: $i"
print_usage
@@ -371,11 +388,6 @@ fi
export NUGET_PACKAGES=$testNativeBinDir/../../../../packages
echo "NUGET_PACKAGES = $NUGET_PACKAGES"
-echo "dir $testNativeBinDir/../../../../Tools"
-dir $testNativeBinDir/../../../../Tools
-echo "dir $testNativeBinDir/../../../../Tools/dotnetcli"
-dir $testNativeBinDir/../../../../Tools/dotnetcli
-
pushd $testNativeBinDir/../../../../tests/scripts
$testNativeBinDir/../../../../Tools/dotnetcli/dotnet restore --fallbacksource https://dotnet.myget.org/F/dotnet-buildtools/ --fallbacksource https://dotnet.myget.org/F/dotnet-core/
popd
@@ -385,49 +397,45 @@ create_core_overlay
precompile_overlay_assemblies
copy_test_native_bin_to_test_root
-echo "find $testNativeBinDir/../../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'"
-find $testNativeBinDir/../../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'
-echo "find $testNativeBinDir/../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'"
-find $testNativeBinDir/../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'
-
# Deploy xunit performance packages
cd $CORE_ROOT
+echo "CORE_ROOT dir = $CORE_ROOT"
DO_SETUP=TRUE
if [ ${DO_SETUP} == "TRUE" ]; then
-
-echo "dir $testNativeBinDir/../../../../../"
-dir $testNativeBinDir/../../../../../
-echo "dir $testNativeBinDir/../../../../../packages"
-dir $testNativeBinDir/../../../../../packages
-echo "dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli"
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli
-echo "dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035"
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035
-echo "dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib"
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib
-echo "dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib/netstandard1.3"
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib/netstandard1.3
-
-sudo cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.runner.cli.dll .
-
-sudo cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.run.core/1.0.0-alpha-build0035/lib/dotnet/*.dll .
-
+cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0040/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.runner.cli.dll .
+cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.analysis.cli/1.0.0-alpha-build0040/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.analysis.cli.dll .
+cp $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.run.core/1.0.0-alpha-build0040/lib/dotnet/*.dll .
fi
# Run coreclr performance tests
echo "Test root dir is: $testRootDir"
-tests=($(find $testRootDir/JIT/Performance/CodeQuality -name '*.exe'))
+tests=($(find $testRootDir/JIT/Performance/CodeQuality -name '*.exe') $(find $testRootDir/performance/perflab/PerfLab -name '*.dll'))
+echo "current dir is $PWD"
+rm measurement.json
for testcase in ${tests[@]}; do
test=$(basename $testcase)
testname=$(basename $testcase .exe)
echo "....Running $testname"
-
cp $testcase .
+chmod u+x ./corerun
+echo "./corerun Microsoft.DotNet.xunit.performance.runner.cli.dll $test -runner xunit.console.netcore.exe -runnerhost ./corerun -verbose -runid perf-$testname"
./corerun Microsoft.DotNet.xunit.performance.runner.cli.dll $test -runner xunit.console.netcore.exe -runnerhost ./corerun -verbose -runid perf-$testname
-
+echo "./corerun Microsoft.DotNet.xunit.performance.analysis.cli.dll perf-$testname.xml -xml perf-$testname-summary.xml"
+./corerun Microsoft.DotNet.xunit.performance.analysis.cli.dll perf-$testname.xml -xml perf-$testname-summary.xml
+if [ "$uploadToBenchview" == "TRUE" ]
+ then
+ python3.5 ../../../../../tests/scripts/Microsoft.BenchView.JSONFormat/tools/measurement.py xunit perf-$testname.xml --better desc --drop-first-value --append
+fi
done
+if [ "$uploadToBenchview" == "TRUE" ]
+ then
+ python3.5 ../../../../../tests/scripts/Microsoft.BenchView.JSONFormat/tools/submission.py measurement.json --build ../../../../../build.json --machine-data ../../../../../machinedata.json --metadata ../../../../../submission-metadata.json --group "CoreCLR" --type "$runType" --config-name "Release" --config Configuration "Release" --config OS "$benchViewOS" --arch "x64" --machinepool "Perfsnake"
+ python3.5 ../../../../../tests/scripts/Microsoft.BenchView.JSONFormat/tools/upload.py submission.json --container coreclr
+fi
+mkdir ../../../../../sandbox
+cp *.xml ../../../../../sandbox
diff --git a/tests/setup-runtime-dependencies.cmd b/tests/setup-runtime-dependencies.cmd
index 6369457..0079d42 100755
--- a/tests/setup-runtime-dependencies.cmd
+++ b/tests/setup-runtime-dependencies.cmd
@@ -1,4 +1,4 @@
-@if not defined __echo @echo off
+@if not defined _echo @echo off
setlocal
set __ThisScriptShort=%0
diff --git a/tests/setup-runtime-dependencies.sh b/tests/setup-runtime-dependencies.sh
index 0658673..4573e08 100755
--- a/tests/setup-runtime-dependencies.sh
+++ b/tests/setup-runtime-dependencies.sh
@@ -87,6 +87,10 @@ fi
# This script must be located in coreclr/tests.
scriptDir=$(cd "$(dirname "$0")"; pwd -P)
+
+echo "Running init-tools.sh"
+$scriptDir/../init-tools.sh
+
dotnetToolsDir=$scriptDir/../Tools
dotnetCmd=${dotnetToolsDir}/dotnetcli/dotnet
packageDir=${scriptDir}/../packages
diff --git a/tests/src/CLRTest.Execute.Bash.targets b/tests/src/CLRTest.Execute.Bash.targets
index 367b58b..60270a1 100644
--- a/tests/src/CLRTest.Execute.Bash.targets
+++ b/tests/src/CLRTest.Execute.Bash.targets
@@ -99,7 +99,7 @@ fi
<Target Name="GenerateBashExecutionScript"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(OutputPath)\$(MSBuildProjectName).sh"
- DependsOnTargets="FetchExternalPropertiesForXpalt;$(BashScriptSnippetGen);GetIlasmRoundTripBashScript">
+ DependsOnTargets="FetchExternalPropertiesForXpalt;$(BashScriptSnippetGen);GetJitDisasmBashScript;GetIlasmRoundTripBashScript">
<Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
@@ -120,6 +120,14 @@ then
exit 0
fi
]]></BashCLRTestEnvironmentCompatibilityCheck>
+ <BashCLRTestEnvironmentCompatibilityCheck Condition="'$(HeapVerifyIncompatible)' == 'true'"><![CDATA[
+$(BashCLRTestEnvironmentCompatibilityCheck)
+if [ ! -z "$COMPlus_HeapVerify" ]
+then
+ echo SKIPPING EXECUTION BECAUSE COMPlus_HeapVerify IS SET
+ exit 0
+fi
+ ]]></BashCLRTestEnvironmentCompatibilityCheck>
<BashCLRTestExitCodePrep Condition="$(_CLRTestNeedsToRun)">
<![CDATA[
@@ -299,6 +307,7 @@ $(BashEnvironmentVariables)
$(BashCLRTestEnvironmentCompatibilityCheck)
$(BashCLRTestArgPrep)
$(BashCLRTestExitCodePrep)
+$(JitDisasmBashScript)
# IlasmRoundTrip Script
$(IlasmRoundTripBashScript)
# PreCommands
diff --git a/tests/src/CLRTest.Execute.Batch.targets b/tests/src/CLRTest.Execute.Batch.targets
index 8e2e5f1..5de78b4 100644
--- a/tests/src/CLRTest.Execute.Batch.targets
+++ b/tests/src/CLRTest.Execute.Batch.targets
@@ -95,7 +95,7 @@ IF NOT "!ERRORLEVEL!"=="0" (
<Target Name="GenerateBatchExecutionScript"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(OutputPath)\$(MSBuildProjectName).cmd"
- DependsOnTargets="FetchExternalProperties;$(BatchScriptSnippetGen);GetIlasmRoundTripBatchScript">
+ DependsOnTargets="FetchExternalProperties;$(BatchScriptSnippetGen);GetJitDisasmBatchScript;GetIlasmRoundTripBatchScript">
<Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
@@ -114,6 +114,13 @@ IF "%COMPlus_JitStress%"=="" IF "%COMPlus_JitStressRegs%"=="" IF "%COMPlus_JITMi
Exit /b 0
:Compatible1
]]></BatchCLRTestEnvironmentCompatibilityCheck>
+ <BatchCLRTestEnvironmentCompatibilityCheck Condition="'$(HeapVerifyIncompatible)' == 'true'"><![CDATA[
+$(BatchCLRTestEnvironmentCompatibilityCheck)
+IF NOT "%COMPlus_HeapVerify%"=="" (
+ ECHO SKIPPING EXECUTION BECAUSE COMPlus_HeapVerify IS SET
+ Exit /b 0
+)
+ ]]></BatchCLRTestEnvironmentCompatibilityCheck>
<BatchCLRTestExitCodePrep Condition="$(_CLRTestNeedsToRun)">
<![CDATA[
@@ -320,6 +327,8 @@ $(BatchEnvironmentVariables)
$(BatchCLRTestEnvironmentCompatibilityCheck)
+$(JitDisasmBatchScript)
+
REM IlasmRoundTrip Script
$(IlasmRoundTripBatchScript)
diff --git a/tests/src/CLRTest.Execute.targets b/tests/src/CLRTest.Execute.targets
index 17cb69f..b49785b 100644
--- a/tests/src/CLRTest.Execute.targets
+++ b/tests/src/CLRTest.Execute.targets
@@ -105,6 +105,7 @@ This file contains the logic for providing Execution Script generation.
<BatchScriptSnippetGen></BatchScriptSnippetGen>
</PropertyGroup>
+ <Import Project="CLRTest.Jit.targets" />
<Import Project="CLRTest.CrossGen.targets" />
<Import Project="CLRTest.GC.targets" />
<Import Project="CLRTest.Execute.*.targets" />
diff --git a/tests/src/CLRTest.Jit.targets b/tests/src/CLRTest.Jit.targets
new file mode 100644
index 0000000..4eb6327
--- /dev/null
+++ b/tests/src/CLRTest.Jit.targets
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+***********************************************************************************************
+CLRTest.Jit.targets
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+This file contains the logic for generating command scripts for special GC tests.
+
+WARNING: When setting properties based on their current state (for example:
+ <Foo Condition="'$(Foo)'==''>Bar</Foo>). Be very careful. Another script generation
+ target might be trying to do the same thing. It's better to avoid this by instead setting a new property.
+
+ Additionally, be careful with itemgroups. Include will propagate outside of the target too!
+
+***********************************************************************************************
+-->
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Target Name="GetJitDisasmBashScript"
+ Returns="$(JitDisasmBashScript)">
+ <PropertyGroup>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</InputAssemblyName>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+ <JitDisasmOut>$(BaseOutputPathWithConfig.Replace("\","/"))dasm/$(BuildProjectRelativeDir.Replace("\","/"))</JitDisasmOut>
+ <JitDisasmBashScript>
+<![CDATA[
+# JitDisasm Script
+if [ ! -z $RunningJitDisasm ]
+then
+ echo $CORE_ROOT/corerun "$CORE_ROOT/jit-dasm.dll" --crossgen $CORE_ROOT/crossgen.exe --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName)
+ "$CORE_ROOT/corerun" "$CORE_ROOT/jit-dasm" --crossgen $CORE_ROOT/crossgen.exe --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName)
+ if [ $ERRORLEVEL -ne 0 ]
+ then
+ echo EXECUTION OF JIT-DASM - FAILED $ERRORLEVEL
+ exit 1
+ fi
+fi
+]]>
+ </JitDisasmBashScript>
+ </PropertyGroup>
+ </Target>
+
+ <Target Name="GetJitDisasmBatchScript"
+ Returns="$(JitDisasmBatchScript)">
+ <PropertyGroup>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)))</InputAssemblyName>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+ <JitDisasmOut>$(BaseOutputPathWithConfig)dasm\$(BuildProjectRelativeDir)</JitDisasmOut>
+ <JitDisasmBatchScript>
+<![CDATA[
+REM JitDisasm Script
+if defined RunningJitDisasm (
+ echo %CORE_ROOT%\corerun %CORE_ROOT%\jit-dasm.dll --crossgen %CORE_ROOT%/crossgen.exe --platform %CORE_ROOT%%3B%25cd%25 --output $(JitDisasmOut) $(InputAssemblyName)
+ %CORE_ROOT%\corerun %CORE_ROOT%\jit-dasm.dll --crossgen %CORE_ROOT%/crossgen.exe --platform %CORE_ROOT%%3B%25cd%25 --output $(JitDisasmOut) $(InputAssemblyName)
+ IF NOT "!ERRORLEVEL!"=="0" (
+ ECHO EXECUTION OF JIT-DASM - FAILED !ERRORLEVEL!
+ Exit /b 1
+ )
+ Exit /b 0
+)
+ ]]>
+ </JitDisasmBatchScript>
+ </PropertyGroup>
+ </Target>
+
+ <PropertyGroup Condition="$(RunWithGcStress) != ''" >
+ <CLRTestBatchPreCommands>
+<![CDATA[
+ $(CLRTestBatchPreCommands)
+set COMPlus_GCStress=$(RunWithGcStress)
+ ]]>
+ </CLRTestBatchPreCommands>
+ <BashCLRTestPreCommands>
+<![CDATA[
+ $(BashCLRTestPreCommands)
+export COMPlus_GCStress=$(RunWithGcStress)
+ ]]>
+ </BashCLRTestPreCommands>
+ </PropertyGroup>
+
+
+</Project>
diff --git a/tests/src/Common/Platform/platformdefines.cpp b/tests/src/Common/Platform/platformdefines.cpp
index 4caead5..82061ac 100644
--- a/tests/src/Common/Platform/platformdefines.cpp
+++ b/tests/src/Common/Platform/platformdefines.cpp
@@ -89,7 +89,7 @@ int TP_slen(LPWSTR str)
return len;
}
-int TP_scmp_s(LPSTR str1, LPSTR str2)
+int TP_scmp_s(LPCSTR str1, LPCSTR str2)
{
// < 0 str1 less than str2
// 0 str1 identical to str2
@@ -277,7 +277,7 @@ DWORD TP_GetFullPathName(LPWSTR fileName, DWORD nBufferLength, LPWSTR lpBuffer)
return GetFullPathNameW(fileName, nBufferLength, lpBuffer, NULL);
#else
char nativeFullPath[MAX_PATH];
- realpath(HackyConvertToSTR(fileName), nativeFullPath);
+ (void)realpath(HackyConvertToSTR(fileName), nativeFullPath);
LPWSTR fullPathForCLR = HackyConvertToWSTR(nativeFullPath);
wcscpy_s(lpBuffer, MAX_PATH, fullPathForCLR);
return wcslen(lpBuffer);
diff --git a/tests/src/Common/Platform/platformdefines.h b/tests/src/Common/Platform/platformdefines.h
index d0760fd..0961e86 100644
--- a/tests/src/Common/Platform/platformdefines.h
+++ b/tests/src/Common/Platform/platformdefines.h
@@ -72,7 +72,7 @@ LPWSTR HackyConvertToWSTR(char* pszInput);
typedef pthread_t THREAD_ID;
typedef void* (*MacWorker)(void*);
-typedef DWORD (*LPTHREAD_START_ROUTINE)(void*);
+typedef DWORD __stdcall (*LPTHREAD_START_ROUTINE)(void*);
#ifdef UNICODE
typedef WCHAR TCHAR;
#else // ANSI
@@ -87,7 +87,7 @@ typedef void* HMODULE;
typedef void* ULONG_PTR;
typedef unsigned error_t;
typedef void* LPVOID;
-typedef char BYTE;
+typedef unsigned char BYTE;
typedef WCHAR OLECHAR;
#endif
@@ -97,7 +97,7 @@ typedef WCHAR OLECHAR;
error_t TP_scpy_s(LPWSTR strDestination, size_t sizeInWords, LPCWSTR strSource);
error_t TP_scat_s(LPWSTR strDestination, size_t sizeInWords, LPCWSTR strSource);
int TP_slen(LPWSTR str);
-int TP_scmp_s(LPSTR str1, LPSTR str2);
+int TP_scmp_s(LPCSTR str1, LPCSTR str2);
int TP_wcmp_s(LPWSTR str1, LPWSTR str2);
error_t TP_getenv_s(size_t* pReturnValue, LPWSTR buffer, size_t sizeInWords, LPCWSTR varname);
error_t TP_putenv_s(LPTSTR name, LPTSTR value);
diff --git a/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj b/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
new file mode 100644
index 0000000..63c5448
--- /dev/null
+++ b/tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <CLRTestKind>BuildOnly</CLRTestKind>
+ </PropertyGroup>
+ <ItemGroup>
+ <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project>
diff --git a/tests/src/Common/build_against_pkg_dependencies/project.json b/tests/src/Common/build_against_pkg_dependencies/project.json
new file mode 100644
index 0000000..5624855
--- /dev/null
+++ b/tests/src/Common/build_against_pkg_dependencies/project.json
@@ -0,0 +1,32 @@
+{
+ "dependencies": {
+ "Microsoft.NETCore.ILAsm": "1.2.0-beta-24820-02",
+ "Microsoft.NETCore.ILDAsm": "1.2.0-beta-24820-02",
+ "Microsoft.NETCore.Jit": "1.2.0-beta-24820-02",
+ "Microsoft.NETCore.Runtime.CoreCLR": "1.2.0-beta-24820-02",
+ "Microsoft.NETCore.TestHost": "1.2.0-beta-24820-02"
+ },
+ "frameworks": {
+ "netcoreapp1.1": {
+ "imports": [
+ "dnxcore50",
+ "portable-net45+win8"
+ ]
+ }
+ },
+ "runtimes": {
+ "win7-x86": {},
+ "win7-x64": {},
+ "win10-arm64": {},
+ "ubuntu.14.04-x64": {},
+ "ubuntu.16.04-x64": {},
+ "ubuntu.16.10-x64": {},
+ "osx.10.10-x64": {},
+ "centos.7-x64": {},
+ "rhel.7-x64": {},
+ "debian.8-x64": {},
+ "fedora.23-x64": {},
+ "opensuse.13.2-x64": {},
+ "opensuse.42.1-x64": {}
+ }
+}
diff --git a/tests/src/Common/empty/project.json b/tests/src/Common/empty/project.json
index c6d5104..1954111 100644
--- a/tests/src/Common/empty/project.json
+++ b/tests/src/Common/empty/project.json
@@ -2,7 +2,7 @@
"dependencies": {
},
"frameworks": {
- "netcoreapp1.0": {}
+ "netcoreapp1.1": {}
},
"runtimes": {
"win7-x86": {},
diff --git a/tests/src/Common/netcoreapp/project.json b/tests/src/Common/netcoreapp/project.json
new file mode 100644
index 0000000..51193fc
--- /dev/null
+++ b/tests/src/Common/netcoreapp/project.json
@@ -0,0 +1,74 @@
+{
+ "version": "1.0.0-*",
+ "buildOptions": {
+ "debugType": "portable",
+ "emitEntryPoint": true
+ },
+ "dependencies": {
+ "Microsoft.NETCore.Platforms": "1.2.0-beta-24820-02",
+ "Microsoft.NETCore.Targets": "1.2.0-beta-24820-02",
+ "System.Threading.Thread": "4.4.0-beta-24820-02",
+ "System.Collections": "4.4.0-beta-24820-02",
+ "System.Xml.XmlSerializer": "4.4.0-beta-24820-02",
+ "System.Collections.Concurrent": "4.4.0-beta-24820-02",
+ "System.ObjectModel": "4.4.0-beta-24820-02",
+ "System.Runtime.Numerics": "4.4.0-beta-24820-02",
+ "System.Collections.NonGeneric": "4.4.0-beta-24820-02",
+ "System.Collections.Specialized": "4.4.0-beta-24820-02",
+ "System.ComponentModel": "4.4.0-beta-24820-02",
+ "System.Reflection.Emit.Lightweight": "4.4.0-beta-24820-02",
+ "System.Reflection.TypeExtensions": "4.4.0-beta-24820-02",
+ "System.Console": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Contracts": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Debug": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Process": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Tools": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Tracing": "4.4.0-beta-24820-02",
+ "System.Dynamic.Runtime": "4.4.0-beta-24820-02",
+ "System.Globalization": "4.4.0-beta-24820-02",
+ "System.Globalization.Calendars": "4.4.0-beta-24820-02",
+ "System.IO": "4.4.0-beta-24820-02",
+ "System.IO.FileSystem": "4.4.0-beta-24820-02",
+ "System.IO.FileSystem.Primitives": "4.4.0-beta-24820-02",
+ "System.Linq": "4.4.0-beta-24820-02",
+ "System.Linq.Queryable": "4.4.0-beta-24820-02",
+ "System.Linq.Expressions": "4.4.0-beta-24820-02",
+ "System.Reflection": "4.4.0-beta-24820-02",
+ "System.Reflection.Extensions": "4.4.0-beta-24820-02",
+ "System.Resources.ResourceManager": "4.4.0-beta-24820-02",
+ "System.Runtime": "4.4.0-beta-24820-02",
+ "System.Runtime.CompilerServices.Unsafe": "4.4.0-beta-24820-02",
+ "System.Runtime.Extensions": "4.4.0-beta-24820-02",
+ "System.Runtime.Handles": "4.4.0-beta-24820-02",
+ "System.Runtime.InteropServices": "4.4.0-beta-24820-02",
+ "System.Runtime.InteropServices.RuntimeInformation": "4.4.0-beta-24820-02",
+ "System.Runtime.Loader": "4.4.0-beta-24820-02",
+ "System.Security.Cryptography.Algorithms": "4.4.0-beta-24820-02",
+ "System.Text.Encoding": "4.4.0-beta-24820-02",
+ "System.Text.Encoding.Extensions": "4.4.0-beta-24820-02",
+ "System.Text.RegularExpressions": "4.4.0-beta-24820-02",
+ "System.Threading": "4.4.0-beta-24820-02",
+ "System.Threading.AccessControl": "4.4.0-beta-24820-02",
+ "System.Threading.Overlapped": "4.4.0-beta-24820-02",
+ "System.Threading.Tasks": "4.4.0-beta-24820-02",
+ "System.Threading.Tasks.Parallel": "4.4.0-beta-24820-02",
+ "System.Threading.ThreadPool": "4.4.0-beta-24820-02",
+ "System.Threading.Timer": "4.4.0-beta-24820-02",
+ "System.Xml.ReaderWriter": "4.4.0-beta-24820-02",
+ "System.Xml.XDocument": "4.4.0-beta-24820-02",
+ "System.Xml.XmlDocument": "4.4.0-beta-24820-02",
+ "System.Xml.XPath": "4.4.0-beta-24820-02",
+ "System.Xml.XPath.XmlDocument": "4.4.0-beta-24820-02",
+ "System.Numerics.Vectors": "4.4.0-beta-24820-02"
+ },
+ "frameworks": {
+ "netcoreapp1.1": {
+ "dependencies": {
+ "Microsoft.NETCore.Runtime.CoreCLR": "1.2.0-beta-24820-02"
+ }
+ }
+ },
+ "runtimes": {
+ "win7-x64": {}
+ }
+}
diff --git a/tests/src/Common/targeting_pack_ref/project.json b/tests/src/Common/targeting_pack_ref/project.json
new file mode 100644
index 0000000..c1f033b
--- /dev/null
+++ b/tests/src/Common/targeting_pack_ref/project.json
@@ -0,0 +1,22 @@
+{
+ "dependencies": {
+ "Microsoft.TargetingPack.Private.CoreCLR": "1.2.0-beta-24820-02"
+ },
+ "frameworks": {
+ "netcoreapp1.1": {
+ "imports": [
+ "dnxcore50",
+ "portable-net45+win8"
+ ]
+ }
+ },
+ "runtimes": {
+ "win7-x86": {},
+ "win7-x64": {},
+ "ubuntu.14.04-x64": {},
+ "osx.10.10-x64": {},
+ "centos.7-x64": {},
+ "rhel.7-x64": {},
+ "debian.8-x64": {}
+ }
+}
diff --git a/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj b/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj
new file mode 100644
index 0000000..65e37c0
--- /dev/null
+++ b/tests/src/Common/targeting_pack_ref/targeting_pack_ref.csproj
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <CLRTestKind>BuildOnly</CLRTestKind>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <Target Name="Build"
+ DependsOnTargets="ResolveReferences" />
+</Project>
diff --git a/tests/src/Common/test_dependencies/project.json b/tests/src/Common/test_dependencies/project.json
index 46e2601..5f05914 100644
--- a/tests/src/Common/test_dependencies/project.json
+++ b/tests/src/Common/test_dependencies/project.json
@@ -1,76 +1,76 @@
{
"dependencies": {
- "xunit": "2.1.0",
- "xunit.console.netcore": "1.0.2-prerelease-00101",
- "xunit.runner.utility": "2.1.0",
+ "xunit": "2.2.0-beta2-build3300",
+ "xunit.console.netcore": "1.0.2-prerelease-00177",
+ "xunit.runner.utility": "2.2.0-beta2-build3300",
"Microsoft.CodeAnalysis.Compilers": "1.1.1",
- "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0035",
- "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0035",
- "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0035",
- "Microsoft.Win32.Primitives": "4.3.0",
- "Newtonsoft.Json": "7.0.1",
- "Microsoft.NETCore.Platforms": "1.1.0",
- "Microsoft.NETCore.Targets": "1.1.0",
- "System.Collections.Immutable": "1.3.0",
- "System.Threading.Thread": "4.3.0",
- "System.Collections": "4.3.0",
- "System.Xml.XmlSerializer": "4.3.0",
- "System.Collections.Concurrent": "4.3.0",
- "System.ObjectModel": "4.3.0",
- "System.Runtime.Numerics": "4.3.0",
- "System.Collections.NonGeneric": "4.3.0",
- "System.Collections.Specialized": "4.3.0",
- "System.ComponentModel": "4.3.0",
- "System.Reflection.Emit.Lightweight": "4.3.0",
- "System.Reflection.TypeExtensions": "4.3.0",
- "System.Console": "4.3.0",
- "System.Diagnostics.Contracts": "4.3.0",
- "System.Diagnostics.Debug": "4.3.0",
- "System.Diagnostics.Process": "4.3.0",
- "System.Diagnostics.Tools": "4.3.0",
- "System.Diagnostics.Tracing": "4.3.0",
- "System.Dynamic.Runtime": "4.3.0",
- "System.Globalization": "4.3.0",
- "System.Globalization.Calendars": "4.3.0",
- "System.IO": "4.3.0",
- "System.IO.FileSystem": "4.3.0",
- "System.IO.FileSystem.Primitives": "4.3.0",
- "System.Linq": "4.3.0",
- "System.Linq.Queryable": "4.3.0",
- "System.Linq.Expressions": "4.3.0",
- "System.Reflection": "4.3.0",
- "System.Reflection.Extensions": "4.3.0",
- "System.Resources.ResourceManager": "4.3.0",
- "System.Runtime": "4.3.0",
- "System.Runtime.CompilerServices.Unsafe": "4.3.0",
- "System.Runtime.Extensions": "4.3.0",
- "System.Runtime.Handles": "4.3.0",
- "System.Runtime.InteropServices": "4.3.0",
- "System.Runtime.InteropServices.RuntimeInformation": "4.3.0",
- "System.Runtime.Loader": "4.3.0",
- "System.Runtime.Serialization.Json": "4.3.0",
- "System.Runtime.Serialization.Primitives": "4.1.1",
- "System.Runtime.Serialization.Xml": "4.3.0",
- "System.Security.Cryptography.Algorithms": "4.3.0",
- "System.Text.Encoding": "4.3.0",
- "System.Text.Encoding.Extensions": "4.3.0",
- "System.Text.RegularExpressions": "4.3.0",
- "System.Threading": "4.3.0",
- "System.Threading.AccessControl": "4.3.0",
- "System.Threading.Overlapped": "4.3.0",
- "System.Threading.Tasks": "4.3.0",
- "System.Threading.Tasks.Parallel": "4.3.0",
- "System.Threading.ThreadPool": "4.3.0",
- "System.Threading.Timer": "4.3.0",
- "System.Xml.ReaderWriter": "4.3.0",
- "System.Xml.XDocument": "4.3.0",
- "System.Xml.XmlDocument": "4.3.0",
- "System.Xml.XPath": "4.3.0",
- "System.Xml.XPath.XmlDocument": "4.3.0",
- "System.Numerics.Vectors": "4.3.0"
+ "Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0040",
+ "Microsoft.DotNet.xunit.performance.analysis": "1.0.0-alpha-build0040",
+ "Microsoft.DotNet.xunit.performance.runner.Windows": "1.0.0-alpha-build0040",
+ "Microsoft.Win32.Primitives": "4.4.0-beta-24820-02",
+ "Newtonsoft.Json": "8.0.3",
+ "Microsoft.NETCore.Platforms": "1.2.0-beta-24820-02",
+ "Microsoft.NETCore.Targets": "1.2.0-beta-24820-02",
+ "System.Collections.Immutable": "1.4.0-beta-24820-02",
+ "System.Threading.Thread": "4.4.0-beta-24820-02",
+ "System.Collections": "4.4.0-beta-24820-02",
+ "System.Xml.XmlSerializer": "4.4.0-beta-24820-02",
+ "System.Collections.Concurrent": "4.4.0-beta-24820-02",
+ "System.ObjectModel": "4.4.0-beta-24820-02",
+ "System.Runtime.Numerics": "4.4.0-beta-24820-02",
+ "System.Collections.NonGeneric": "4.4.0-beta-24820-02",
+ "System.Collections.Specialized": "4.4.0-beta-24820-02",
+ "System.ComponentModel": "4.4.0-beta-24820-02",
+ "System.Reflection.Emit.Lightweight": "4.4.0-beta-24820-02",
+ "System.Reflection.TypeExtensions": "4.4.0-beta-24820-02",
+ "System.Console": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Contracts": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Debug": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Process": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Tools": "4.4.0-beta-24820-02",
+ "System.Diagnostics.Tracing": "4.4.0-beta-24820-02",
+ "System.Dynamic.Runtime": "4.4.0-beta-24820-02",
+ "System.Globalization": "4.4.0-beta-24820-02",
+ "System.Globalization.Calendars": "4.4.0-beta-24820-02",
+ "System.IO": "4.4.0-beta-24820-02",
+ "System.IO.FileSystem": "4.4.0-beta-24820-02",
+ "System.IO.FileSystem.Primitives": "4.4.0-beta-24820-02",
+ "System.Linq": "4.4.0-beta-24820-02",
+ "System.Linq.Queryable": "4.4.0-beta-24820-02",
+ "System.Linq.Expressions": "4.4.0-beta-24820-02",
+ "System.Reflection": "4.4.0-beta-24820-02",
+ "System.Reflection.Extensions": "4.4.0-beta-24820-02",
+ "System.Resources.ResourceManager": "4.4.0-beta-24820-02",
+ "System.Runtime": "4.4.0-beta-24820-02",
+ "System.Runtime.CompilerServices.Unsafe": "4.4.0-beta-24820-02",
+ "System.Runtime.Extensions": "4.4.0-beta-24820-02",
+ "System.Runtime.Handles": "4.4.0-beta-24820-02",
+ "System.Runtime.InteropServices": "4.4.0-beta-24820-02",
+ "System.Runtime.InteropServices.RuntimeInformation": "4.4.0-beta-24820-02",
+ "System.Runtime.Loader": "4.4.0-beta-24820-02",
+ "System.Runtime.Serialization.Json": "4.4.0-beta-24820-02",
+ "System.Runtime.Serialization.Primitives": "4.4.0-beta-24820-02",
+ "System.Runtime.Serialization.Xml": "4.4.0-beta-24820-02",
+ "System.Security.Cryptography.Algorithms": "4.4.0-beta-24820-02",
+ "System.Text.Encoding": "4.4.0-beta-24820-02",
+ "System.Text.Encoding.Extensions": "4.4.0-beta-24820-02",
+ "System.Text.RegularExpressions": "4.4.0-beta-24820-02",
+ "System.Threading": "4.4.0-beta-24820-02",
+ "System.Threading.AccessControl": "4.4.0-beta-24820-02",
+ "System.Threading.Overlapped": "4.4.0-beta-24820-02",
+ "System.Threading.Tasks": "4.4.0-beta-24820-02",
+ "System.Threading.Tasks.Parallel": "4.4.0-beta-24820-02",
+ "System.Threading.ThreadPool": "4.4.0-beta-24820-02",
+ "System.Threading.Timer": "4.4.0-beta-24820-02",
+ "System.Xml.ReaderWriter": "4.4.0-beta-24820-02",
+ "System.Xml.XDocument": "4.4.0-beta-24820-02",
+ "System.Xml.XmlDocument": "4.4.0-beta-24820-02",
+ "System.Xml.XPath": "4.4.0-beta-24820-02",
+ "System.Xml.XPath.XmlDocument": "4.4.0-beta-24820-02",
+ "System.Numerics.Vectors": "4.4.0-beta-24820-02"
},
"frameworks": {
- "netcoreapp1.0": {
+ "netcoreapp1.1": {
"imports": [
"dnxcore50",
"portable-net45+win8"
diff --git a/tests/src/Common/test_dependencies/test_dependencies.csproj b/tests/src/Common/test_dependencies/test_dependencies.csproj
index f475772..0649d2b 100644
--- a/tests/src/Common/test_dependencies/test_dependencies.csproj
+++ b/tests/src/Common/test_dependencies/test_dependencies.csproj
@@ -5,10 +5,10 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<CLRTestKind>BuildOnly</CLRTestKind>
- <CoreRootPackagesDir>$(CORE_ROOT)\.nuget\pkg</CoreRootPackagesDir>
+ <NugetTargetMoniker>.NETCoreApp,Version=v1.1</NugetTargetMoniker>
</PropertyGroup>
<ItemGroup>
- <DnuSourceList Include="$(CoreRootPackagesDir)" Condition="Exists('$(CoreRootPackagesDir)')" />
+ <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="Build"
diff --git a/tests/src/Common/test_runtime/project.json b/tests/src/Common/test_runtime/project.json
index 9c6fdf1..2c7c15f 100644
--- a/tests/src/Common/test_runtime/project.json
+++ b/tests/src/Common/test_runtime/project.json
@@ -1,9 +1,12 @@
{
"dependencies": {
"Microsoft.DotNet.CoreCLR.TestDependencies": "1.0.0-prerelease",
+ "jit-dasm": "0.0.1.1",
+ "cijobs": "0.0.1.2",
+ "jit-analyze": "0.0.1.0"
},
"frameworks": {
- "netcoreapp1.0": {
+ "netcoreapp1.1": {
"imports": [
"dnxcore50",
"portable-net45+win8"
diff --git a/tests/src/Common/test_runtime/test_runtime.csproj b/tests/src/Common/test_runtime/test_runtime.csproj
index 009655d..ad0093a 100644
--- a/tests/src/Common/test_runtime/test_runtime.csproj
+++ b/tests/src/Common/test_runtime/test_runtime.csproj
@@ -8,10 +8,10 @@
<!-- Reset the Default project.json-->
<ProjectJson></ProjectJson>
<ProjectLockJson></ProjectLockJson>
- <CoreRootPackagesDir>$(CORE_ROOT)\.nuget\pkg</CoreRootPackagesDir>
+ <NugetTargetMoniker>.NETCoreApp,Version=v1.1</NugetTargetMoniker>
</PropertyGroup>
<ItemGroup>
- <DnuSourceList Include="$(CoreRootPackagesDir)" Condition="Exists('$(CoreRootPackagesDir)')" />
+ <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
diff --git a/tests/src/CoreMangLib/cti/system/datetime/datetimeparse1.cs b/tests/src/CoreMangLib/cti/system/datetime/datetimeparse1.cs
index ee92958..d759d4f 100644
--- a/tests/src/CoreMangLib/cti/system/datetime/datetimeparse1.cs
+++ b/tests/src/CoreMangLib/cti/system/datetime/datetimeparse1.cs
@@ -472,7 +472,7 @@ public class DateTimeParse1
day = (TestLibrary.Generator.GetInt32(-55) % 27) + 1;
year = (TestLibrary.Generator.GetInt32(-55) % 100) + 1900;
month = (TestLibrary.Generator.GetInt32(-55) % 12);
- hour = (TestLibrary.Generator.GetInt32(-55) % 12) + hourshift; // Parse will convert perform GMT -> PST conversion
+ hour = (TestLibrary.Generator.GetInt32(-55) % 12) + hourshift; // Parse will convert perform GMT -> Local conversion
minute = (TestLibrary.Generator.GetInt32(-55) % 60);
second = (TestLibrary.Generator.GetInt32(-55) % 60);
dayOfWeek = (TestLibrary.Generator.GetInt32(-55) % 7);
@@ -489,10 +489,9 @@ public class DateTimeParse1
|| day != dateAfter.Day
|| year != dateAfter.Year
|| (DayOfWeek)dayOfWeek != dateAfter.DayOfWeek
- || minute != dateAfter.Minute
|| second != dateAfter.Second)
{
- TestLibrary.TestFramework.LogError("017", "DateTime.Parse(" + dateBefore + ") did not equal (" + c_DAYS_SH[(int)dateAfter.DayOfWeek] + ", " + dateAfter.Day + " " + c_MONTHS_SH[dateAfter.Month-1] + " " + dateAfter.Year + " " + dateAfter.Hour + ":" + dateAfter.Minute + ":" + dateAfter.Second + " GMT)");
+ TestLibrary.TestFramework.LogError("017", "DateTime.Parse(" + dateBefore + ") did not equal (" + c_DAYS_SH[(int)dateAfter.DayOfWeek] + ", " + dateAfter.Day + " " + c_MONTHS_SH[dateAfter.Month-1] + " " + dateAfter.Year + " " + dateAfter.Hour + ":" + dateAfter.Minute + ":" + dateAfter.Second + " " + dateAfter.Kind + ")");
retVal = false;
}
}
@@ -683,10 +682,9 @@ public class DateTimeParse1
if (month != dateAfter.Month
|| day != dateAfter.Day
|| year != dateAfter.Year
- || minute != dateAfter.Minute
|| second != dateAfter.Second)
{
- TestLibrary.TestFramework.LogError("025", "DateTime.Parse(" + dateBefore + ") did not equal (" + dateAfter.Year + "-" + dateAfter.Month + "-" + dateAfter.Day + " " + dateAfter.Hour + ":" + dateAfter.Minute + ":" + dateAfter.Second + "Z)");
+ TestLibrary.TestFramework.LogError("025", "DateTime.Parse(" + dateBefore + ") did not equal (" + dateAfter.Year + "-" + dateAfter.Month + "-" + dateAfter.Day + " " + dateAfter.Hour + ":" + dateAfter.Minute + ":" + dateAfter.Second + " " + dateAfter.Kind + ")");
retVal = false;
}
}
diff --git a/tests/src/CoreMangLib/system/span/BasicSpanTest.cs b/tests/src/CoreMangLib/system/span/BasicSpanTest.cs
new file mode 100644
index 0000000..18ec6f8
--- /dev/null
+++ b/tests/src/CoreMangLib/system/span/BasicSpanTest.cs
@@ -0,0 +1,804 @@
+using System;
+using System.Collections.Generic;
+
+class ReferenceType
+{
+ internal byte Value;
+ public ReferenceType(byte value) { Value = value; }
+}
+
+struct ValueTypeWithoutPointers
+{
+ internal byte Value;
+ public ValueTypeWithoutPointers(byte value) { Value = value; }
+}
+
+struct ValueTypeWithPointers
+{
+ internal object Reference;
+ public ValueTypeWithPointers(object reference) { Reference = reference; }
+}
+
+struct SevenBytesStruct
+{
+#pragma warning disable 0169
+ byte b1, b2, b3, b4, b5, b6, b7;
+#pragma warning restore 0169
+}
+
+class My
+{
+ static int Sum(Span<int> span)
+ {
+ int sum = 0;
+ for (int i = 0; i < span.Length; i++)
+ sum += span[i];
+ return sum;
+ }
+
+ static void Main()
+ {
+ int failedTestsCount = 0;
+
+ Test(CanAccessItemsViaIndexer, "CanAccessItemsViaIndexer", ref failedTestsCount);
+ Test(CanAccessItemsViaIndexerStartCtor, "CanAccessItemsViaIndexerStartCtor", ref failedTestsCount);
+ Test(CanAccessItemsViaIndexerStartLengthCtor, "CanAccessItemsViaIndexerStartLengthCtor", ref failedTestsCount);
+
+ Test(TestBoundaryEmptySpanStartCtor, "TestBoundaryEmptySpanStartCtor", ref failedTestsCount);
+ Test(TestBoundaryEmptySpanStartLengthCtor, "TestBoundaryEmptySpanStartLengthCtor", ref failedTestsCount);
+
+ Test(ReferenceTypesAreSupported, "ReferenceTypesAreSupported", ref failedTestsCount);
+
+ Test(CanUpdateUnderlyingArray, "CanUpdateUnderlyingArray", ref failedTestsCount);
+
+ Test(MustNotMoveGcTypesToUnmanagedMemory, "MustNotMoveGcTypesToUnmanagedMemory", ref failedTestsCount);
+
+ Test(TestArrayCoVariance, "TestArrayCoVariance", ref failedTestsCount);
+ Test(TestArrayCoVarianceStartCtor, "TestArrayCoVarianceStartCtor", ref failedTestsCount);
+ Test(TestArrayCoVarianceStartLengthCtor, "TestArrayCoVarianceStartLengthCtor", ref failedTestsCount);
+
+ Test(TestArrayCoVarianceReadOnly, "TestArrayCoVarianceReadOnly", ref failedTestsCount);
+
+ Test(CanCopyValueTypesWithoutPointersToSlice, "CanCopyValueTypesWithoutPointersToSlice", ref failedTestsCount);
+ Test(CanCopyValueTypesWithoutPointersToArray, "CanCopyValueTypesWithoutPointersToArray", ref failedTestsCount);
+
+ Test(CanCopyReferenceTypesToSlice, "CanCopyReferenceTypesToSlice", ref failedTestsCount);
+ Test(CanCopyReferenceTypesToArray, "CanCopyReferenceTypesToArray", ref failedTestsCount);
+
+ Test(CanCopyValueTypesWithPointersToSlice, "CanCopyValueTypesWithPointersToSlice", ref failedTestsCount);
+ Test(CanCopyValueTypesWithPointersToArray, "CanCopyValueTypesWithPointersToArray", ref failedTestsCount);
+
+ Test(CanCopyValueTypesWithoutPointersToUnmanagedMemory, "CanCopyValueTypesWithoutPointersToUnmanagedMemory", ref failedTestsCount);
+
+ Test(CanCopyOverlappingSlicesOfValueTypeWithoutPointers, "CanCopyOverlappingSlicesOfValueTypeWithoutPointers", ref failedTestsCount);
+ Test(CanCopyOverlappingSlicesOfValueTypeWithPointers, "CanCopyOverlappingSlicesOfValueTypeWithPointers", ref failedTestsCount);
+ Test(CanCopyOverlappingSlicesOfReferenceTypes, "CanCopyOverlappingSlicesOfReferenceTypes", ref failedTestsCount);
+
+ Test(MustNotCastSpanOfValueTypesWithPointers, "MustNotCastSpanOfValueTypesWithPointers", ref failedTestsCount);
+ Test(IntArraySpanCastedToByteArraySpanHasSameBytesAsOriginalArray, "IntArraySpanCastedToByteArraySpanHasSameBytesAsOriginalArray", ref failedTestsCount);
+ Test(ByteArraySpanCastedToIntArraySpanHasSameBytesAsOriginalArray, "ByteArraySpanCastedToIntArraySpanHasSameBytesAsOriginalArray", ref failedTestsCount);
+ Test(SourceTypeLargerThanTargetOneCorrectlyCalcsTargetsLength, "SourceTypeLargerThanTargetOneCorrectlyCalcsTargetsLength", ref failedTestsCount);
+ Test(WhenSourceDoesntFitIntoTargetLengthIsZero, "WhenSourceDoesntFitIntoTargetLengthIsZero", ref failedTestsCount);
+ Test(WhenSourceFitsIntoTargetOnceLengthIsOne, "WhenSourceFitsIntoTargetOnceLengthIsOne", ref failedTestsCount);
+ Test(WhenSourceTypeLargerThanTargetAndOverflowsInt32ThrowsException, "WhenSourceTypeLargerThanTargetAndOverflowsInt32ThrowsException", ref failedTestsCount);
+ Test(CanCreateSpanFromString, "CanCreateSpanFromString", ref failedTestsCount);
+
+ Test(WhenStartLargerThanLengthThrowsExceptionStartCtor, "WhenStartLargerThanLengthThrowsExceptionStartCtor", ref failedTestsCount);
+ Test(WhenStartLargerThanLengthThrowsExceptionStartLengthCtor, "WhenStartLargerThanLengthThrowsExceptionStartLengthCtor", ref failedTestsCount);
+ Test(WhenStartAndLengthLargerThanLengthThrowsExceptionStartLengthCtor, "WhenStartAndLengthLargerThanLengthThrowsExceptionStartLengthCtor", ref failedTestsCount);
+
+ Console.WriteLine(string.Format("{0} tests has failed", failedTestsCount));
+ Environment.Exit(failedTestsCount);
+ }
+
+ static void CanAccessItemsViaIndexer()
+ {
+ int[] a = new int[] { 1, 2, 3 };
+ Span<int> slice = new Span<int>(a);
+ AssertTrue(Sum(slice) == 6, "Failed to sum slice");
+
+ Span<int> subslice = slice.Slice(1, 2);
+ AssertTrue(Sum(subslice) == 5, "Failed to sum subslice");
+ }
+
+ static void CanAccessItemsViaIndexerStartCtor()
+ {
+ int[] a = new int[] { 1, 2, 3 };
+ Span<int> slice = new Span<int>(a, start: 1);
+ AssertTrue(Sum(slice) == 5, "Failed to sum slice");
+ }
+
+ static void CanAccessItemsViaIndexerStartLengthCtor()
+ {
+ int[] a = new int[] { 1, 2, 3 };
+ Span<int> slice = new Span<int>(a, start: 1, length: 1);
+ AssertTrue(Sum(slice) == 2, "Failed to sum slice");
+ }
+
+ static void TestBoundaryEmptySpanStartCtor()
+ {
+ int[] a = new int[5];
+
+ Span<int> slice = new Span<int>(a, start: a.Length);
+ AssertEqual(slice.Length, 0);
+ }
+
+ static void TestBoundaryEmptySpanStartLengthCtor()
+ {
+ int[] a = new int[5];
+
+ Span<int> slice = new Span<int>(a, a.Length, 0);
+ AssertEqual(slice.Length, 0);
+
+ Span<int> subSlice = new Span<int>(a).Slice(a.Length, 0);
+ AssertEqual(subSlice.Length, 0);
+ }
+
+ static void ReferenceTypesAreSupported()
+ {
+ var underlyingArray = new ReferenceType[] { new ReferenceType(0), new ReferenceType(1), new ReferenceType(2) };
+ var slice = new Span<ReferenceType>(underlyingArray);
+
+ for (int i = 0; i < underlyingArray.Length; i++)
+ {
+ AssertTrue(underlyingArray[i].Value == slice[i].Value, "Values are different");
+ AssertTrue(object.ReferenceEquals(underlyingArray[i], slice[i]), "References are broken");
+ }
+ }
+
+ static unsafe void MustNotMoveGcTypesToUnmanagedMemory()
+ {
+ byte* pointerToStack = stackalloc byte[256];
+
+ try
+ {
+ new Span<ValueTypeWithPointers>(pointerToStack, 1);
+ AssertTrue(false, "Expected exception for value types with references not thrown");
+ }
+ catch (System.ArgumentException ex)
+ {
+ AssertTrue(ex.Message == "Cannot use type 'ValueTypeWithPointers'. Only value types without pointers or references are supported.",
+ "Exception message is incorrect");
+ }
+
+ try
+ {
+ new Span<ReferenceType>(pointerToStack, 1);
+ AssertTrue(false, "Expected exception for reference types not thrown");
+ }
+ catch (System.ArgumentException ex)
+ {
+ AssertTrue(ex.Message == "Cannot use type 'ReferenceType'. Only value types without pointers or references are supported.",
+ "Exception message is incorrect");
+ }
+ }
+
+ static void TestArrayCoVariance()
+ {
+ var array = new ReferenceType[1];
+ var objArray = (object[])array;
+ try
+ {
+ new Span<object>(objArray);
+ AssertTrue(false, "Expected exception not thrown");
+ }
+ catch (ArrayTypeMismatchException)
+ {
+ }
+
+ var objEmptyArray = Array.Empty<ReferenceType>();
+ try
+ {
+ new Span<object>(objEmptyArray);
+ AssertTrue(false, "Expected exception not thrown");
+ }
+ catch (ArrayTypeMismatchException)
+ {
+ }
+ }
+
+ static void TestArrayCoVarianceStartCtor()
+ {
+ var array = new ReferenceType[1];
+ var objArray = (object[])array;
+ try
+ {
+ new Span<object>(objArray, start: 0);
+ AssertTrue(false, "Expected exception not thrown");
+ }
+ catch (ArrayTypeMismatchException)
+ {
+ }
+
+ var objEmptyArray = Array.Empty<ReferenceType>();
+ try
+ {
+ new Span<object>(objEmptyArray, start: 0);
+ AssertTrue(false, "Expected exception not thrown");
+ }
+ catch (ArrayTypeMismatchException)
+ {
+ }
+ }
+
+ static void TestArrayCoVarianceStartLengthCtor()
+ {
+ var array = new ReferenceType[1];
+ var objArray = (object[])array;
+ try
+ {
+ new Span<object>(objArray, start: 0, length: 1);
+ AssertTrue(false, "Expected exception not thrown");
+ }
+ catch (ArrayTypeMismatchException)
+ {
+ }
+
+ var objEmptyArray = Array.Empty<ReferenceType>();
+ try
+ {
+ new Span<object>(objEmptyArray, start: 0, length: 1);
+ AssertTrue(false, "Expected exception not thrown");
+ }
+ catch (ArrayTypeMismatchException)
+ {
+ }
+ }
+
+ static void TestArrayCoVarianceReadOnly()
+ {
+ var array = new ReferenceType[1];
+ var objArray = (object[])array;
+ AssertTrue(new ReadOnlySpan<object>(objArray).Length == 1, "Unexpected length");
+
+ var objEmptyArray = Array.Empty<ReferenceType>();
+ AssertTrue(new ReadOnlySpan<object>(objEmptyArray).Length == 0, "Unexpected length");
+ }
+
+ static void CanUpdateUnderlyingArray()
+ {
+ var underlyingArray = new int[] { 1, 2, 3 };
+ var slice = new Span<int>(underlyingArray);
+
+ slice[0] = 0;
+ slice[1] = 1;
+ slice[2] = 2;
+
+ AssertTrue(underlyingArray[0] == 0, "Failed to update underlying array");
+ AssertTrue(underlyingArray[1] == 1, "Failed to update underlying array");
+ AssertTrue(underlyingArray[2] == 2, "Failed to update underlying array");
+ }
+
+ static void CanCopyValueTypesWithoutPointersToSlice()
+ {
+ var source = new Span<ValueTypeWithoutPointers>(
+ new[]
+ {
+ new ValueTypeWithoutPointers(0),
+ new ValueTypeWithoutPointers(1),
+ new ValueTypeWithoutPointers(2),
+ new ValueTypeWithoutPointers(3)
+ });
+ var underlyingArray = new ValueTypeWithoutPointers[4];
+ var slice = new Span<ValueTypeWithoutPointers>(underlyingArray);
+
+ var result = source.TryCopyTo(slice);
+
+ AssertTrue(result, "Failed to copy value types without pointers");
+ for (int i = 0; i < 4; i++)
+ {
+ AssertTrue(source[i].Value == slice[i].Value, "Failed to copy value types without pointers, values were not equal");
+ AssertTrue(source[i].Value == underlyingArray[i].Value, "Failed to copy value types without pointers to underlying array, values were not equal");
+ }
+ }
+
+ static void CanCopyValueTypesWithoutPointersToArray()
+ {
+ var source = new Span<ValueTypeWithoutPointers>(
+ new[]
+ {
+ new ValueTypeWithoutPointers(0),
+ new ValueTypeWithoutPointers(1),
+ new ValueTypeWithoutPointers(2),
+ new ValueTypeWithoutPointers(3)
+ });
+ var array = new ValueTypeWithoutPointers[4];
+
+ var result = source.TryCopyTo(array);
+
+ AssertTrue(result, "Failed to copy value types without pointers");
+ for (int i = 0; i < 4; i++)
+ {
+ AssertTrue(source[i].Value == array[i].Value, "Failed to copy value types without pointers, values were not equal");
+ }
+ }
+
+ static void CanCopyReferenceTypesToSlice()
+ {
+ var source = new Span<ReferenceType>(
+ new[]
+ {
+ new ReferenceType(0),
+ new ReferenceType(1),
+ new ReferenceType(2),
+ new ReferenceType(3)
+ });
+ var underlyingArray = new ReferenceType[4];
+ var slice = new Span<ReferenceType>(underlyingArray);
+
+ var result = source.TryCopyTo(slice);
+
+ AssertTrue(result, "Failed to copy reference types");
+ for (int i = 0; i < 4; i++)
+ {
+ AssertTrue(source[i] != null && slice[i] != null, "Failed to copy reference types, references were null");
+ AssertTrue(object.ReferenceEquals(source[i], slice[i]), "Failed to copy reference types, references were not equal");
+ AssertTrue(source[i].Value == slice[i].Value, "Failed to copy reference types, values were not equal");
+
+ AssertTrue(underlyingArray[i] != null, "Failed to copy reference types to underlying array, references were null");
+ AssertTrue(object.ReferenceEquals(source[i], underlyingArray[i]), "Failed to copy reference types to underlying array, references were not equal");
+ AssertTrue(source[i].Value == underlyingArray[i].Value, "Failed to copy reference types to underlying array, values were not equal");
+ }
+ }
+
+ static void CanCopyReferenceTypesToArray()
+ {
+ var source = new Span<ReferenceType>(
+ new[]
+ {
+ new ReferenceType(0),
+ new ReferenceType(1),
+ new ReferenceType(2),
+ new ReferenceType(3)
+ });
+ var array = new ReferenceType[4];
+
+ var result = source.TryCopyTo(array);
+
+ AssertTrue(result, "Failed to copy reference types");
+ for (int i = 0; i < 4; i++)
+ {
+ AssertTrue(source[i] != null && array[i] != null, "Failed to copy reference types, references were null");
+ AssertTrue(object.ReferenceEquals(source[i], array[i]), "Failed to copy reference types, references were not equal");
+ AssertTrue(source[i].Value == array[i].Value, "Failed to copy reference types, values were not equal");
+ }
+ }
+
+ static void CanCopyValueTypesWithPointersToSlice()
+ {
+ var source = new Span<ValueTypeWithPointers>(
+ new[]
+ {
+ new ValueTypeWithPointers(new object()),
+ new ValueTypeWithPointers(new object()),
+ new ValueTypeWithPointers(new object()),
+ new ValueTypeWithPointers(new object())
+ });
+ var underlyingArray = new ValueTypeWithPointers[4];
+ var slice = new Span<ValueTypeWithPointers>(underlyingArray);
+
+ var result = source.TryCopyTo(slice);
+
+ AssertTrue(result, "Failed to copy value types with pointers");
+ for (int i = 0; i < 4; i++)
+ {
+ AssertTrue(object.ReferenceEquals(source[i].Reference, slice[i].Reference), "Failed to copy value types with pointers, references were not the same");
+ AssertTrue(object.ReferenceEquals(source[i].Reference, underlyingArray[i].Reference), "Failed to copy value types with pointers to underlying array, references were not the same");
+ }
+ }
+
+ static void CanCopyValueTypesWithPointersToArray()
+ {
+ var source = new Span<ValueTypeWithPointers>(
+ new[]
+ {
+ new ValueTypeWithPointers(new object()),
+ new ValueTypeWithPointers(new object()),
+ new ValueTypeWithPointers(new object()),
+ new ValueTypeWithPointers(new object())
+ });
+ var array = new ValueTypeWithPointers[4];
+
+ var result = source.TryCopyTo(array);
+
+ AssertTrue(result, "Failed to copy value types with pointers");
+ for (int i = 0; i < 4; i++)
+ {
+ AssertTrue(object.ReferenceEquals(source[i].Reference, array[i].Reference), "Failed to copy value types with pointers, references were not the same");
+ }
+ }
+
+ static unsafe void CanCopyValueTypesWithoutPointersToUnmanagedMemory()
+ {
+ var source = new Span<byte>(
+ new byte[]
+ {
+ 0,
+ 1,
+ 2,
+ 3
+ });
+ byte* pointerToStack = stackalloc byte[256];
+
+ var result = source.TryCopyTo(new Span<byte>(pointerToStack, 4));
+
+ AssertTrue(result, "Failed to copy value types without pointers to unamanaged memory");
+ for (int i = 0; i < 4; i++)
+ {
+ AssertTrue(source[i] == pointerToStack[i], "Failed to copy value types without pointers to unamanaged memory, values were not equal");
+ }
+ }
+
+ static void CanCopyOverlappingSlicesOfValueTypeWithoutPointers()
+ {
+ var sourceArray = new[]
+ {
+ new ValueTypeWithoutPointers(0),
+ new ValueTypeWithoutPointers(1),
+ new ValueTypeWithoutPointers(2)
+ };
+ var firstAndSecondElements = new Span<ValueTypeWithoutPointers>(sourceArray, 0, 2); // 0, 1
+ var secondAndThirdElements = new Span<ValueTypeWithoutPointers>(sourceArray, 1, 2); // 1, 2
+
+ // 0 1 2 sourceArray
+ // 0 1 - firstAndSecondElements
+ // - 1 2 secondAndThirdElements
+ var result = firstAndSecondElements.TryCopyTo(secondAndThirdElements); // to avoid overlap we should copy backward now
+ // - 0 1 secondAndThirdElements
+ // 0 0 - firstAndSecondElements
+ // 0 0 1 sourceArray
+
+ AssertTrue(result, "Failed to copy overlapping value types without pointers");
+
+ AssertTrue(secondAndThirdElements[1].Value == 1, "secondAndThirdElements[1] should get replaced by 1");
+ AssertTrue(secondAndThirdElements[0].Value == 0 && firstAndSecondElements[1].Value == 0, "secondAndThirdElements[0] and firstAndSecondElements[1] point to the same element, should get replaced by 0");
+ AssertTrue(firstAndSecondElements[0].Value == 0, "firstAndSecondElements[0] should remain the same");
+
+ // let's try the other direction to make sure it works as well!
+
+ sourceArray = new[]
+ {
+ new ValueTypeWithoutPointers(0),
+ new ValueTypeWithoutPointers(1),
+ new ValueTypeWithoutPointers(2)
+ };
+ firstAndSecondElements = new Span<ValueTypeWithoutPointers>(sourceArray, 0, 2); // 0, 1
+ secondAndThirdElements = new Span<ValueTypeWithoutPointers>(sourceArray, 1, 2); // 1, 2
+
+ // 0 1 2 sourceArray
+ // 0 1 - firstAndSecondElements
+ // - 1 2 secondAndThirdElements
+ result = secondAndThirdElements.TryCopyTo(firstAndSecondElements); // to avoid overlap we should copy forward now
+ // 1 2 - firstAndSecondElements
+ // - 2 2 secondAndThirdElements
+ // 1 2 2 sourceArray
+
+ AssertTrue(result, "Failed to copy overlapping value types without pointers");
+
+ AssertTrue(secondAndThirdElements[1].Value == 2, "secondAndThirdElements[1] should remain the same");
+ AssertTrue(firstAndSecondElements[1].Value == 2 && secondAndThirdElements[0].Value == 2, "secondAndThirdElements[0] && firstAndSecondElements[1] point to the same element, should get replaced by 2");
+ AssertTrue(firstAndSecondElements[0].Value == 1, "firstAndSecondElements[0] should get replaced by 1");
+ }
+
+ static void CanCopyOverlappingSlicesOfValueTypeWithPointers()
+ {
+ string zero = "0", one = "1", two = "2";
+ var sourceArray = new[]
+ {
+ new ValueTypeWithPointers(zero),
+ new ValueTypeWithPointers(one),
+ new ValueTypeWithPointers(two)
+ };
+ var firstAndSecondElements = new Span<ValueTypeWithPointers>(sourceArray, 0, 2); // 0, 1
+ var secondAndThirdElements = new Span<ValueTypeWithPointers>(sourceArray, 1, 2); // 1, 2
+
+ // 0 1 2 sourceArray
+ // 0 1 - firstAndSecondElements
+ // - 1 2 secondAndThirdElements
+ var result = firstAndSecondElements.TryCopyTo(secondAndThirdElements); // to avoid overlap we should copy backward now
+ // - 0 1 secondAndThirdElements
+ // 0 0 - firstAndSecondElements
+ // 0 0 1 sourceArray
+
+ AssertTrue(result, "Failed to copy overlapping value types with pointers");
+
+ AssertTrue(object.ReferenceEquals(secondAndThirdElements[1].Reference, one), "secondAndThirdElements[1] should get replaced by 1");
+ AssertTrue(object.ReferenceEquals(secondAndThirdElements[0].Reference, zero) && object.ReferenceEquals(firstAndSecondElements[1].Reference, zero), "secondAndThirdElements[0] and firstAndSecondElements[1] point to the same element, should get replaced by 0");
+ AssertTrue(object.ReferenceEquals(firstAndSecondElements[0].Reference, zero), "firstAndSecondElements[0] should remain the same");
+
+ // let's try the other direction to make sure it works as well!
+
+ sourceArray = new[]
+ {
+ new ValueTypeWithPointers(zero),
+ new ValueTypeWithPointers(one),
+ new ValueTypeWithPointers(two)
+ };
+ firstAndSecondElements = new Span<ValueTypeWithPointers>(sourceArray, 0, 2); // 0, 1
+ secondAndThirdElements = new Span<ValueTypeWithPointers>(sourceArray, 1, 2); // 1, 2
+
+ // 0 1 2 sourceArray
+ // 0 1 - firstAndSecondElements
+ // - 1 2 secondAndThirdElements
+ result = secondAndThirdElements.TryCopyTo(firstAndSecondElements); // to avoid overlap we should copy forward now
+ // 1 2 - firstAndSecondElements
+ // - 2 2 secondAndThirdElements
+ // 1 2 2 sourceArray
+
+ AssertTrue(result, "Failed to copy overlapping value types with pointers");
+
+ AssertTrue(object.ReferenceEquals(secondAndThirdElements[1].Reference, two), "secondAndThirdElements[1] should remain the same");
+ AssertTrue(object.ReferenceEquals(firstAndSecondElements[1].Reference, two) && object.ReferenceEquals(secondAndThirdElements[0].Reference, two), "secondAndThirdElements[0] && firstAndSecondElements[1] point to the same element, should get replaced by 2");
+ AssertTrue(object.ReferenceEquals(firstAndSecondElements[0].Reference, one), "firstAndSecondElements[0] should get replaced by 1");
+ }
+
+ static void CanCopyOverlappingSlicesOfReferenceTypes()
+ {
+ var sourceArray = new ReferenceType[] { new ReferenceType(0), new ReferenceType(1), new ReferenceType(2) };
+
+ var firstAndSecondElements = new Span<ReferenceType>(sourceArray, 0, 2); // 0, 1
+ var secondAndThirdElements = new Span<ReferenceType>(sourceArray, 1, 2); // 1, 2
+
+ // 0 1 2 sourceArray
+ // 0 1 - firstAndSecondElements
+ // - 1 2 secondAndThirdElements
+ var result = firstAndSecondElements.TryCopyTo(secondAndThirdElements); // to avoid overlap we should copy backward now
+ // - 0 1 secondAndThirdElements
+ // 0 0 - firstAndSecondElements
+ // 0 0 1 sourceArray
+
+ AssertTrue(result, "Failed to copy overlapping reference types");
+
+ AssertTrue(secondAndThirdElements[1].Value == 1, "secondAndThirdElements[1] should get replaced by 1");
+ AssertTrue(secondAndThirdElements[0].Value == 0 && firstAndSecondElements[1].Value == 0, "secondAndThirdElements[0] and firstAndSecondElements[1] point to the same element, should get replaced by 0");
+ AssertTrue(firstAndSecondElements[0].Value == 0, "firstAndSecondElements[0] should remain the same");
+
+ // let's try the other direction to make sure it works as well!
+
+ sourceArray = new[]
+ {
+ new ReferenceType(0),
+ new ReferenceType(1),
+ new ReferenceType(2)
+ };
+ firstAndSecondElements = new Span<ReferenceType>(sourceArray, 0, 2); // 0, 1
+ secondAndThirdElements = new Span<ReferenceType>(sourceArray, 1, 2); // 1, 2
+
+ // 0 1 2 sourceArray
+ // 0 1 - firstAndSecondElements
+ // - 1 2 secondAndThirdElements
+ result = secondAndThirdElements.TryCopyTo(firstAndSecondElements); // to avoid overlap we should copy forward now
+ // 1 2 - firstAndSecondElements
+ // - 2 2 secondAndThirdElements
+ // 1 2 2 sourceArray
+
+ AssertTrue(result, "Failed to copy overlapping reference types");
+
+ AssertTrue(secondAndThirdElements[1].Value == 2, "secondAndThirdElements[1] should remain the same");
+ AssertTrue(firstAndSecondElements[1].Value == 2 && secondAndThirdElements[0].Value == 2, "secondAndThirdElements[0] && firstAndSecondElements[1] point to the same element, should get replaced by 2");
+ AssertTrue(firstAndSecondElements[0].Value == 1, "firstAndSecondElements[0] should get replaced by 1");
+ }
+
+ static void MustNotCastSpanOfValueTypesWithPointers()
+ {
+ var spanOfValueTypeWithPointers = new Span<ValueTypeWithPointers>(new[] { new ValueTypeWithPointers(new object()) });
+
+ try
+ {
+ var impossible = spanOfValueTypeWithPointers.AsBytes();
+ AssertTrue(false, "Expected exception for wrong type not thrown");
+ }
+ catch (System.ArgumentException ex)
+ {
+ AssertTrue(ex.Message == "Cannot use type 'ValueTypeWithPointers'. Only value types without pointers or references are supported.",
+ "Exception message is incorrect");
+ }
+
+ try
+ {
+ var impossible = spanOfValueTypeWithPointers.NonPortableCast<ValueTypeWithPointers, byte>();
+ AssertTrue(false, "Expected exception for wrong type not thrown");
+ }
+ catch (System.ArgumentException ex)
+ {
+ AssertTrue(ex.Message == "Cannot use type 'ValueTypeWithPointers'. Only value types without pointers or references are supported.",
+ "Exception message is incorrect");
+ }
+
+ var spanOfBytes = new Span<byte>(new byte[10]);
+ try
+ {
+ var impossible = spanOfBytes.NonPortableCast<byte, ValueTypeWithPointers>();
+ AssertTrue(false, "Expected exception for wrong type not thrown");
+ }
+ catch (System.ArgumentException ex)
+ {
+ AssertTrue(ex.Message == "Cannot use type 'ValueTypeWithPointers'. Only value types without pointers or references are supported.",
+ "Exception message is incorrect");
+ }
+ }
+
+ static void IntArraySpanCastedToByteArraySpanHasSameBytesAsOriginalArray()
+ {
+ var ints = new int[100000];
+ Random r = new Random(42324232);
+ for (int i = 0; i < ints.Length; i++) { ints[i] = r.Next(); }
+ var bytes = new Span<int>(ints).AsBytes();
+ AssertEqual(bytes.Length, ints.Length * sizeof(int));
+ for (int i = 0; i < ints.Length; i++)
+ {
+ AssertEqual(bytes[i * 4], (ints[i] & 0xff));
+ AssertEqual(bytes[i * 4 + 1], (ints[i] >> 8 & 0xff));
+ AssertEqual(bytes[i * 4 + 2], (ints[i] >> 16 & 0xff));
+ AssertEqual(bytes[i * 4 + 3], (ints[i] >> 24 & 0xff));
+ }
+ }
+
+ static void ByteArraySpanCastedToIntArraySpanHasSameBytesAsOriginalArray()
+ {
+ var bytes = new byte[100000];
+ Random r = new Random(541345);
+ for (int i = 0; i < bytes.Length; i++) { bytes[i] = (byte)r.Next(256); }
+ var ints = new Span<byte>(bytes).NonPortableCast<byte, int>();
+ AssertEqual(ints.Length, bytes.Length / sizeof(int));
+ for (int i = 0; i < ints.Length; i++)
+ {
+ AssertEqual(BitConverter.ToInt32(bytes, i * 4), ints[i]);
+ }
+ }
+
+ static void SourceTypeLargerThanTargetOneCorrectlyCalcsTargetsLength()
+ {
+ for (int sourceLength = 0; sourceLength <= 4; sourceLength++)
+ {
+ var sourceSlice = new Span<SevenBytesStruct>(new SevenBytesStruct[sourceLength]);
+
+ var targetSlice = sourceSlice.NonPortableCast<SevenBytesStruct, short>();
+
+ AssertEqual((sourceLength * 7) / sizeof(short), targetSlice.Length);
+ }
+ }
+
+ static void WhenSourceDoesntFitIntoTargetLengthIsZero()
+ {
+ for (int sourceLength = 0; sourceLength <= 3; sourceLength++)
+ {
+ var sourceSlice = new Span<short>(new short[sourceLength]);
+
+ var targetSlice = sourceSlice.NonPortableCast<short, SevenBytesStruct>();
+
+ AssertEqual(0, targetSlice.Length);
+ }
+ }
+
+ static void WhenSourceFitsIntoTargetOnceLengthIsOne()
+ {
+ foreach (var sourceLength in new int[] { 4, 6 })
+ {
+ var sourceSlice = new Span<short>(new short[sourceLength]);
+
+ var targetSlice = sourceSlice.NonPortableCast<short, SevenBytesStruct>();
+
+ AssertEqual(1, targetSlice.Length);
+ }
+ }
+
+ static void WhenSourceTypeLargerThanTargetAndOverflowsInt32ThrowsException()
+ {
+ unsafe
+ {
+ byte dummy;
+ int sourceLength = 620000000;
+ var sourceSlice = new Span<SevenBytesStruct>(&dummy, sourceLength);
+
+ try
+ {
+ var targetSlice = sourceSlice.NonPortableCast<SevenBytesStruct, short>();
+ AssertTrue(false, "Expected exception for overflow not thrown");
+ }
+ catch (System.OverflowException)
+ {
+ }
+ }
+ }
+
+ static void CanCreateSpanFromString()
+ {
+ const string fullText = "new Span<byte>()";
+ var spanFromFull = fullText.Slice();
+ AssertEqualContent(fullText, spanFromFull);
+
+ string firstHalfOfString = fullText.Substring(0, fullText.Length / 2);
+ var spanFromFirstHalf = fullText.Slice(0, fullText.Length / 2);
+ AssertEqualContent(firstHalfOfString, spanFromFirstHalf);
+
+ string secondHalfOfString = fullText.Substring(fullText.Length / 2);
+ var spanFromSecondHalf = fullText.Slice(fullText.Length / 2);
+ AssertEqualContent(secondHalfOfString, spanFromSecondHalf);
+ }
+
+ static void WhenStartLargerThanLengthThrowsExceptionStartCtor()
+ {
+ try
+ {
+ var data = new byte[10];
+ var slice = new Span<byte>(data, start: 11);
+ AssertTrue(false, "Expected exception for Argument Out of Range not thrown");
+ }
+ catch (System.ArgumentOutOfRangeException)
+ {
+ }
+ }
+
+ static void WhenStartLargerThanLengthThrowsExceptionStartLengthCtor()
+ {
+ try
+ {
+ var data = new byte[10];
+ var slice = new Span<byte>(data, start: 11, length: 0);
+ AssertTrue(false, "Expected exception for Argument Out of Range not thrown");
+ }
+ catch (System.ArgumentOutOfRangeException)
+ {
+ }
+ }
+
+ static void WhenStartAndLengthLargerThanLengthThrowsExceptionStartLengthCtor()
+ {
+ try
+ {
+ var data = new byte[10];
+ var slice = new Span<byte>(data, start: 1, length: 10);
+ AssertTrue(false, "Expected exception for Argument Out of Range not thrown");
+ }
+ catch (System.ArgumentOutOfRangeException)
+ {
+ }
+ }
+
+ static void Test(Action test, string testName, ref int failedTestsCount)
+ {
+ try
+ {
+ test();
+
+ Console.WriteLine(testName + " test has passed");
+ }
+ catch (System.Exception ex)
+ {
+ Console.WriteLine(testName + " test has failed with exception: " + ex.Message);
+
+ ++failedTestsCount;
+ }
+ finally
+ {
+ Console.WriteLine("-------------------");
+ }
+ }
+
+ static void AssertTrue(bool condition, string errorMessage)
+ {
+ if (condition == false)
+ {
+ throw new Exception(errorMessage);
+ }
+ }
+
+ static void AssertEqual<T>(T left, T right)
+ where T : IEquatable<T>
+ {
+ if (left.Equals(right) == false)
+ {
+ throw new Exception(string.Format("Values were not equal! {0} and {1}", left, right));
+ }
+ }
+
+ static void AssertEqualContent(string text, ReadOnlySpan<char> span)
+ {
+ AssertEqual(text.Length, span.Length);
+ for (int i = 0; i < text.Length; i++)
+ {
+ AssertEqual(text[i], span[i]);
+ }
+ }
+}
diff --git a/tests/src/GC/API/GC/GetGenerationWR2.csproj b/tests/src/GC/API/GC/GetGenerationWR2.csproj
index 35a05a6..6b109e9 100644
--- a/tests/src/GC/API/GC/GetGenerationWR2.csproj
+++ b/tests/src/GC/API/GC/GetGenerationWR2.csproj
@@ -13,6 +13,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <GCStressIncompatible Condition="'$(Platform)' == 'x86'">true</GCStressIncompatible>
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
<CLRTestExecutionArguments></CLRTestExecutionArguments>
diff --git a/tests/src/GC/API/GCHandleCollector/Usage.cs b/tests/src/GC/API/GCHandleCollector/Usage.cs
index 14088f0..b78271b 100644
--- a/tests/src/GC/API/GCHandleCollector/Usage.cs
+++ b/tests/src/GC/API/GCHandleCollector/Usage.cs
@@ -146,7 +146,8 @@ public class Usage
// ensure threshold is increasing
if (!CheckPercentageIncrease(handleCount, prevHandleCount))
{
- Console.WriteLine("Case 3 failed: threshold not increasing!");
+ // see github#4093 for the rationale for fail-fast in this test.
+ Environment.FailFast(string.Empty);
return false;
}
prevHandleCount = handleCount;
diff --git a/tests/src/GC/Features/HeapExpansion/pluggaps.csproj b/tests/src/GC/Features/HeapExpansion/pluggaps.csproj
index cbeab56..42ba45a 100644
--- a/tests/src/GC/Features/HeapExpansion/pluggaps.csproj
+++ b/tests/src/GC/Features/HeapExpansion/pluggaps.csproj
@@ -14,6 +14,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
<GCStressIncompatible>true</GCStressIncompatible>
+ <HeapVerifyIncompatible Condition="'$(Platform)' == 'x86'">true</HeapVerifyIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
diff --git a/tests/src/GC/Performance/Framework/GCPerfTestFramework.csproj b/tests/src/GC/Performance/Framework/GCPerfTestFramework.csproj
index cc8261f..d013349 100644
--- a/tests/src/GC/Performance/Framework/GCPerfTestFramework.csproj
+++ b/tests/src/GC/Performance/Framework/GCPerfTestFramework.csproj
@@ -35,11 +35,12 @@
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Microsoft.Diagnostics.Tracing.TraceEvent, Version=1.0.39.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <HintPath>packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.39\lib\net40\Microsoft.Diagnostics.Tracing.TraceEvent.dll</HintPath>
+ <Reference Include="Microsoft.Diagnostics.Tracing.TraceEvent, Version=1.0.41.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.41\lib\net40\Microsoft.Diagnostics.Tracing.TraceEvent.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
+ <Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.IO.FileSystem.4.0.0\lib\net46\System.IO.FileSystem.dll</HintPath>
@@ -56,27 +57,27 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
- <HintPath>packages\Microsoft.DotNet.xunit.performance.metrics.1.0.0-alpha-build0030\lib\net46\xunit.abstractions.dll</HintPath>
+ <HintPath>packages\Microsoft.DotNet.xunit.performance.metrics.1.0.0-alpha-build0040\lib\net46\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
- <Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
- <HintPath>packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll</HintPath>
+ <Reference Include="xunit.core, Version=2.2.0.3300, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
+ <HintPath>packages\xunit.extensibility.core.2.2.0-beta2-build3300\lib\netstandard1.0\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
- <Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
- <HintPath>packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
+ <Reference Include="xunit.execution.desktop, Version=2.2.0.3300, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
+ <HintPath>packages\xunit.extensibility.execution.2.2.0-beta2-build3300\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
- <Reference Include="xunit.performance.core, Version=1.0.0.30, Culture=neutral, PublicKeyToken=67066efe964d3b03, processorArchitecture=MSIL">
- <HintPath>packages\Microsoft.DotNet.xunit.performance.metrics.1.0.0-alpha-build0030\lib\net46\xunit.performance.core.dll</HintPath>
+ <Reference Include="xunit.performance.core, Version=1.0.0.40, Culture=neutral, PublicKeyToken=67066efe964d3b03, processorArchitecture=MSIL">
+ <HintPath>packages\Microsoft.DotNet.xunit.performance.metrics.1.0.0-alpha-build0040\lib\net46\xunit.performance.core.dll</HintPath>
<Private>True</Private>
</Reference>
- <Reference Include="xunit.performance.execution.desktop, Version=1.0.0.30, Culture=neutral, PublicKeyToken=67066efe964d3b03, processorArchitecture=MSIL">
- <HintPath>packages\Microsoft.DotNet.xunit.performance.1.0.0-alpha-build0030\lib\net46\xunit.performance.execution.desktop.dll</HintPath>
+ <Reference Include="xunit.performance.execution.desktop, Version=1.0.0.40, Culture=neutral, PublicKeyToken=67066efe964d3b03, processorArchitecture=MSIL">
+ <HintPath>packages\Microsoft.DotNet.xunit.performance.1.0.0-alpha-build0040\lib\net46\xunit.performance.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
- <Reference Include="xunit.performance.metrics, Version=1.0.0.30, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>packages\Microsoft.DotNet.xunit.performance.metrics.1.0.0-alpha-build0030\lib\net46\xunit.performance.metrics.dll</HintPath>
+ <Reference Include="xunit.performance.metrics, Version=1.0.0.40, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>packages\Microsoft.DotNet.xunit.performance.metrics.1.0.0-alpha-build0040\lib\net46\xunit.performance.metrics.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
@@ -102,12 +103,12 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.39\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets" Condition="Exists('packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.39\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets')" />
+ <Import Project="packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.41\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets" Condition="Exists('packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.41\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
- <Error Condition="!Exists('packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.39\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.39\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets'))" />
+ <Error Condition="!Exists('packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.41\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.41\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/tests/src/GC/Performance/Framework/packages.config b/tests/src/GC/Performance/Framework/packages.config
index 1657276..c43e175 100644
--- a/tests/src/GC/Performance/Framework/packages.config
+++ b/tests/src/GC/Performance/Framework/packages.config
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Microsoft.Diagnostics.Tracing.TraceEvent" version="1.0.39" targetFramework="net461" />
- <package id="Microsoft.DotNet.xunit.performance" version="1.0.0-alpha-build0030" targetFramework="net461" />
- <package id="Microsoft.DotNet.xunit.performance.metrics" version="1.0.0-alpha-build0030" targetFramework="net461" />
+ <package id="Microsoft.Diagnostics.Tracing.TraceEvent" version="1.0.41" targetFramework="net461" />
+ <package id="Microsoft.DotNet.xunit.performance" version="1.0.0-alpha-build0040" targetFramework="net461" />
+ <package id="Microsoft.DotNet.xunit.performance.metrics" version="1.0.0-alpha-build0040" targetFramework="net461" />
<package id="System.Collections" version="4.0.10" targetFramework="net461" />
<package id="System.Diagnostics.Debug" version="4.0.10" targetFramework="net461" />
- <package id="System.Diagnostics.Tracing" version="4.0.20" targetFramework="net461" />
+ <package id="System.Diagnostics.Tracing" version="4.1.0" targetFramework="net461" />
<package id="System.Globalization" version="4.0.10" targetFramework="net461" />
- <package id="System.IO" version="4.0.10" targetFramework="net461" />
+ <package id="System.IO" version="4.1.0" targetFramework="net461" />
<package id="System.IO.FileSystem" version="4.0.0" targetFramework="net461" />
<package id="System.IO.FileSystem.Primitives" version="4.0.0" targetFramework="net461" />
- <package id="System.Linq" version="4.0.0" targetFramework="net461" />
- <package id="System.Reflection" version="4.0.10" targetFramework="net461" />
- <package id="System.Runtime" version="4.0.20" targetFramework="net461" />
- <package id="System.Runtime.Extensions" version="4.0.10" targetFramework="net461" />
+ <package id="System.Linq" version="4.1.0" targetFramework="net461" />
+ <package id="System.Reflection" version="4.1.0" targetFramework="net461" />
+ <package id="System.Runtime" version="4.1.0" targetFramework="net461" />
+ <package id="System.Runtime.Extensions" version="4.1.0" targetFramework="net461" />
<package id="System.Runtime.Handles" version="4.0.0" targetFramework="net461" />
<package id="System.Text.Encoding" version="4.0.10" targetFramework="net461" />
<package id="System.Threading" version="4.0.10" targetFramework="net461" />
<package id="System.Threading.Tasks" version="4.0.10" targetFramework="net461" />
- <package id="xunit.abstractions" version="2.0.0" targetFramework="net461" />
- <package id="xunit.extensibility.core" version="2.1.0" targetFramework="net461" />
- <package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net461" />
+ <package id="xunit.abstractions" version="2.0.1-rc2" targetFramework="net461" />
+ <package id="xunit.extensibility.core" version="2.2.0-beta2-build3300" targetFramework="net461" />
+ <package id="xunit.extensibility.execution" version="2.2.0-beta2-build3300" targetFramework="net461" />
</packages> \ No newline at end of file
diff --git a/tests/src/GC/Regressions/v2.0-rtm/494226/494226.csproj b/tests/src/GC/Regressions/v2.0-rtm/494226/494226.csproj
index 99623f4..fe23500 100644
--- a/tests/src/GC/Regressions/v2.0-rtm/494226/494226.csproj
+++ b/tests/src/GC/Regressions/v2.0-rtm/494226/494226.csproj
@@ -14,6 +14,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
<GCStressIncompatible>true</GCStressIncompatible>
+ <HeapVerifyIncompatible Condition="'$(Platform)' == 'x86'">true</HeapVerifyIncompatible>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
@@ -36,4 +37,4 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
</PropertyGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs b/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs
index a3a0c53..a17e95a 100644
--- a/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs
+++ b/tests/src/GC/Scenarios/DoublinkList/dlcollect.cs
@@ -77,6 +77,12 @@ namespace DoubLink {
GC.WaitForPendingFinalizers();
+ if (DLinkNode.FinalCount != iRep * iObj * 10)
+ {
+ // see github#4093 for the rationale for fail-fast in this test.
+ Environment.FailFast(string.Empty);
+ }
+
Console.WriteLine("{0} DLinkNodes finalized", DLinkNode.FinalCount);
return (DLinkNode.FinalCount==iRep*iObj*10);
}
diff --git a/tests/src/GC/Scenarios/DoublinkList/dlstack.cs b/tests/src/GC/Scenarios/DoublinkList/dlstack.cs
index 5aea958..5e207be 100644
--- a/tests/src/GC/Scenarios/DoublinkList/dlstack.cs
+++ b/tests/src/GC/Scenarios/DoublinkList/dlstack.cs
@@ -85,6 +85,12 @@ namespace DoubLink {
curTotalMemory = GC.GetTotalMemory(false);
}
+ if (DLinkNode.FinalCount != iRep * iObj * 10)
+ {
+ // see github#4093 for the rationale for fail-fast in this test.
+ Environment.FailFast(string.Empty);
+ }
+
Console.WriteLine("{0} DLinkNodes finalized", DLinkNode.FinalCount);
return (DLinkNode.FinalCount==iRep*iObj*10);
diff --git a/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs b/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs
index 9c5e4b6..76436ea 100644
--- a/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs
+++ b/tests/src/GC/Scenarios/DoublinkList/doublinkgen.cs
@@ -71,6 +71,12 @@ namespace DoubLink {
GC.WaitForPendingFinalizers();
GC.Collect();
+ if (DLinkNode.FinalCount != iRep * iObj)
+ {
+ // see github#4093 for the rationale for fail-fast in this test.
+ Environment.FailFast(string.Empty);
+ }
+
Console.Write(DLinkNode.FinalCount);
Console.WriteLine(" DLinkNodes finalized");
return (DLinkNode.FinalCount==iRep*iObj);
diff --git a/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs b/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs
index 0fda817..60a6861 100644
--- a/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs
+++ b/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs
@@ -17,6 +17,7 @@ public class FinalizeTimeout
do
{
finalizableObject = new BlockingFinalizerOnShutdown();
+ GC.KeepAlive(finalizableObject);
} while (!BlockingFinalizerOnShutdown.finalizerCompletedOnce);
// Start a bunch of threads that allocate continuously, to increase the chance that when Main returns, one of the
@@ -42,12 +43,15 @@ public class FinalizeTimeout
{
byte[] b;
while (true)
+ {
b = new byte[1024];
+ GC.KeepAlive(b);
+ }
}
private class BlockingFinalizerOnShutdown
{
- public static bool finalizerCompletedOnce = false;
+ public volatile static bool finalizerCompletedOnce = false;
public bool isLastObject = false;
~BlockingFinalizerOnShutdown()
@@ -68,6 +72,7 @@ public class FinalizeTimeout
do
{
o = new object();
+ GC.KeepAlive(o);
} while ((++i & 0xff) != 0 || (elapsed = DateTime.Now - start) < timeout);
Console.WriteLine("Finalizer end");
diff --git a/tests/src/GC/Scenarios/ServerModel/servermodel.csproj b/tests/src/GC/Scenarios/ServerModel/servermodel.csproj
index 33fc4ef..dff52fc 100644
--- a/tests/src/GC/Scenarios/ServerModel/servermodel.csproj
+++ b/tests/src/GC/Scenarios/ServerModel/servermodel.csproj
@@ -15,6 +15,7 @@
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
<CLRTestExecutionArguments>/numrequests:100</CLRTestExecutionArguments>
<GCStressIncompatible>true</GCStressIncompatible>
+ <HeapVerifyIncompatible Condition="'$(Platform)' == 'x86'">true</HeapVerifyIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
diff --git a/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj b/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj
index 9288e52..9dd878b 100644
--- a/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj
+++ b/tests/src/GC/Stress/Framework/ReliabilityFramework.csproj
@@ -52,6 +52,6 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<Target Name="AfterBuild">
- <MSBuild Projects="@(StressTests)" Properties="OutputPath=$(OutDir)\Tests" />
+ <MSBuild Projects="@(StressTests)" Properties="OutputPath=$(OutDir)\Tests;BuildingForReliabilityFramework=true" />
</Target>
</Project>
diff --git a/tests/src/GC/Stress/Tests/dir.targets b/tests/src/GC/Stress/Tests/dir.targets
new file mode 100644
index 0000000..d4f8bf9
--- /dev/null
+++ b/tests/src/GC/Stress/Tests/dir.targets
@@ -0,0 +1,6 @@
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <DisableProjectBuild Condition="'$(BuildingForReliabilityFramework)' != 'true'">true</DisableProjectBuild>
+ </PropertyGroup>
+ <Import Project="..\..\..\dir.targets" />
+</Project> \ No newline at end of file
diff --git a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp
index bf3d66d..27de41a 100644
--- a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp
+++ b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp
@@ -185,84 +185,84 @@ Function
/*----------------------------------------------------------------------------
marshal sequential strut
----------------------------------------------------------------------------*/
-extern "C" DLL_EXPORT BOOL TakeIntArraySeqStructByVal( S_INTArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeIntArraySeqStructByVal( S_INTArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( INT, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeUIntArraySeqStructByVal( S_UINTArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeUIntArraySeqStructByVal( S_UINTArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( UINT, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeShortArraySeqStructByVal( S_SHORTArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeShortArraySeqStructByVal( S_SHORTArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( SHORT, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeWordArraySeqStructByVal( S_WORDArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeWordArraySeqStructByVal( S_WORDArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( WORD, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeLong64ArraySeqStructByVal( S_LONG64Array s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLong64ArraySeqStructByVal( S_LONG64Array s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( LONG64, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeULong64ArraySeqStructByVal( S_ULONG64Array s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeULong64ArraySeqStructByVal( S_ULONG64Array s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( ULONG64, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeDoubleArraySeqStructByVal( S_DOUBLEArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeDoubleArraySeqStructByVal( S_DOUBLEArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( DOUBLE, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeFloatArraySeqStructByVal( S_FLOATArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeFloatArraySeqStructByVal( S_FLOATArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( FLOAT, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeByteArraySeqStructByVal( S_BYTEArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeByteArraySeqStructByVal( S_BYTEArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( BYTE, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeCharArraySeqStructByVal( S_CHARArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeCharArraySeqStructByVal( S_CHARArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
INIT_EXPECTED( CHAR, ARRAY_SIZE );
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeIntPtrArraySeqStructByVal(S_DWORD_PTRArray s, int size)
+extern "C" DLL_EXPORT BOOL WINAPI TakeIntPtrArraySeqStructByVal(S_DWORD_PTRArray s, int size)
{
CHECK_PARAM_NOT_EMPTY(s.arr);
INIT_EXPECTED( DWORD_PTR, ARRAY_SIZE);
return Equals(s.arr, size, expected, ARRAY_SIZE);
}
-extern "C" DLL_EXPORT BOOL TakeLPSTRArraySeqStructByVal( S_LPSTRArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPSTRArraySeqStructByVal( S_LPSTRArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
@@ -273,7 +273,7 @@ extern "C" DLL_EXPORT BOOL TakeLPSTRArraySeqStructByVal( S_LPSTRArray s, int siz
return Equals( s.arr, size, expected, ARRAY_SIZE );
}
-extern "C" DLL_EXPORT BOOL TakeLPCSTRArraySeqStructByVal( S_LPCSTRArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPCSTRArraySeqStructByVal( S_LPCSTRArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
@@ -286,7 +286,7 @@ extern "C" DLL_EXPORT BOOL TakeLPCSTRArraySeqStructByVal( S_LPCSTRArray s, int s
-extern "C" DLL_EXPORT BOOL TakeStructArraySeqStructByVal( S_StructArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeStructArraySeqStructByVal( S_StructArray s, int size )
{
CHECK_PARAM_NOT_EMPTY( s.arr );
@@ -297,69 +297,69 @@ extern "C" DLL_EXPORT BOOL TakeStructArraySeqStructByVal( S_StructArray s, int s
/*----------------------------------------------------------------------------
marshal sequential class
----------------------------------------------------------------------------*/
-extern "C" DLL_EXPORT BOOL TakeIntArraySeqClassByVal( S_INTArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeIntArraySeqClassByVal( S_INTArray *s, int size )
{
return TakeIntArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeUIntArraySeqClassByVal( S_UINTArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeUIntArraySeqClassByVal( S_UINTArray *s, int size )
{
return TakeUIntArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeShortArraySeqClassByVal( S_SHORTArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeShortArraySeqClassByVal( S_SHORTArray *s, int size )
{
return TakeShortArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeWordArraySeqClassByVal( S_WORDArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeWordArraySeqClassByVal( S_WORDArray *s, int size )
{
return TakeWordArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLong64ArraySeqClassByVal( S_LONG64Array *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLong64ArraySeqClassByVal( S_LONG64Array *s, int size )
{
return TakeLong64ArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeULong64ArraySeqClassByVal( S_ULONG64Array *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeULong64ArraySeqClassByVal( S_ULONG64Array *s, int size )
{
return TakeULong64ArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeDoubleArraySeqClassByVal( S_DOUBLEArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeDoubleArraySeqClassByVal( S_DOUBLEArray *s, int size )
{
return TakeDoubleArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeFloatArraySeqClassByVal( S_FLOATArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeFloatArraySeqClassByVal( S_FLOATArray *s, int size )
{
return TakeFloatArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeByteArraySeqClassByVal( S_BYTEArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeByteArraySeqClassByVal( S_BYTEArray *s, int size )
{
return TakeByteArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeCharArraySeqClassByVal( S_CHARArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeCharArraySeqClassByVal( S_CHARArray *s, int size )
{
return TakeCharArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLPSTRArraySeqClassByVal( S_LPSTRArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPSTRArraySeqClassByVal( S_LPSTRArray *s, int size )
{
return TakeLPSTRArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLPCSTRArraySeqClassByVal( S_LPCSTRArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPCSTRArraySeqClassByVal( S_LPCSTRArray *s, int size )
{
return TakeLPCSTRArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeStructArraySeqClassByVal( S_StructArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeStructArraySeqClassByVal( S_StructArray *s, int size )
{
return TakeStructArraySeqStructByVal( *s, size );
}
@@ -367,69 +367,69 @@ extern "C" DLL_EXPORT BOOL TakeStructArraySeqClassByVal( S_StructArray *s, int s
/*----------------------------------------------------------------------------
marshal explicit struct
----------------------------------------------------------------------------*/
-extern "C" DLL_EXPORT BOOL TakeIntArrayExpStructByVal( S_INTArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeIntArrayExpStructByVal( S_INTArray s, int size )
{
return TakeIntArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeUIntArrayExpStructByVal( S_UINTArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeUIntArrayExpStructByVal( S_UINTArray s, int size )
{
return TakeUIntArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeShortArrayExpStructByVal( S_SHORTArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeShortArrayExpStructByVal( S_SHORTArray s, int size )
{
return TakeShortArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeWordArrayExpStructByVal( S_WORDArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeWordArrayExpStructByVal( S_WORDArray s, int size )
{
return TakeWordArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLong64ArrayExpStructByVal( S_LONG64Array s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLong64ArrayExpStructByVal( S_LONG64Array s, int size )
{
return TakeLong64ArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeULong64ArrayExpStructByVal( S_ULONG64Array s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeULong64ArrayExpStructByVal( S_ULONG64Array s, int size )
{
return TakeULong64ArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeDoubleArrayExpStructByVal( S_DOUBLEArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeDoubleArrayExpStructByVal( S_DOUBLEArray s, int size )
{
return TakeDoubleArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeFloatArrayExpStructByVal( S_FLOATArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeFloatArrayExpStructByVal( S_FLOATArray s, int size )
{
return TakeFloatArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeByteArrayExpStructByVal( S_BYTEArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeByteArrayExpStructByVal( S_BYTEArray s, int size )
{
return TakeByteArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeCharArrayExpStructByVal( S_CHARArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeCharArrayExpStructByVal( S_CHARArray s, int size )
{
return TakeCharArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLPSTRArrayExpStructByVal( S_LPSTRArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPSTRArrayExpStructByVal( S_LPSTRArray s, int size )
{
return TakeLPSTRArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLPCSTRArrayExpStructByVal( S_LPCSTRArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPCSTRArrayExpStructByVal( S_LPCSTRArray s, int size )
{
return TakeLPCSTRArraySeqStructByVal( s, size );
}
-extern "C" DLL_EXPORT BOOL TakeStructArrayExpStructByVal( S_StructArray s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeStructArrayExpStructByVal( S_StructArray s, int size )
{
return TakeStructArraySeqStructByVal( s, size );
}
@@ -437,69 +437,69 @@ extern "C" DLL_EXPORT BOOL TakeStructArrayExpStructByVal( S_StructArray s, int s
/*----------------------------------------------------------------------------
marshal explicit class
----------------------------------------------------------------------------*/
-extern "C" DLL_EXPORT BOOL TakeIntArrayExpClassByVal( S_INTArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeIntArrayExpClassByVal( S_INTArray *s, int size )
{
return TakeIntArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeUIntArrayExpClassByVal( S_UINTArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeUIntArrayExpClassByVal( S_UINTArray *s, int size )
{
return TakeUIntArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeShortArrayExpClassByVal( S_SHORTArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeShortArrayExpClassByVal( S_SHORTArray *s, int size )
{
return TakeShortArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeWordArrayExpClassByVal( S_WORDArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeWordArrayExpClassByVal( S_WORDArray *s, int size )
{
return TakeWordArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLong64ArrayExpClassByVal( S_LONG64Array *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLong64ArrayExpClassByVal( S_LONG64Array *s, int size )
{
return TakeLong64ArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeULong64ArrayExpClassByVal( S_ULONG64Array *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeULong64ArrayExpClassByVal( S_ULONG64Array *s, int size )
{
return TakeULong64ArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeDoubleArrayExpClassByVal( S_DOUBLEArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeDoubleArrayExpClassByVal( S_DOUBLEArray *s, int size )
{
return TakeDoubleArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeFloatArrayExpClassByVal( S_FLOATArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeFloatArrayExpClassByVal( S_FLOATArray *s, int size )
{
return TakeFloatArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeByteArrayExpClassByVal( S_BYTEArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeByteArrayExpClassByVal( S_BYTEArray *s, int size )
{
return TakeByteArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeCharArrayExpClassByVal( S_CHARArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeCharArrayExpClassByVal( S_CHARArray *s, int size )
{
return TakeCharArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLPSTRArrayExpClassByVal( S_LPSTRArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPSTRArrayExpClassByVal( S_LPSTRArray *s, int size )
{
return TakeLPSTRArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeLPCSTRArrayExpClassByVal( S_LPCSTRArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeLPCSTRArrayExpClassByVal( S_LPCSTRArray *s, int size )
{
return TakeLPCSTRArraySeqStructByVal( *s, size );
}
-extern "C" DLL_EXPORT BOOL TakeStructArrayExpClassByVal( S_StructArray *s, int size )
+extern "C" DLL_EXPORT BOOL WINAPI TakeStructArrayExpClassByVal( S_StructArray *s, int size )
{
return TakeStructArraySeqStructByVal( *s, size );
}
@@ -507,77 +507,77 @@ extern "C" DLL_EXPORT BOOL TakeStructArrayExpClassByVal( S_StructArray *s, int s
/*----------------------------------------------------------------------------
return a struct including a C array
----------------------------------------------------------------------------*/
-extern "C" DLL_EXPORT S_INTArray* S_INTArray_Ret()
+extern "C" DLL_EXPORT S_INTArray* WINAPI S_INTArray_Ret()
{
INIT_EXPECTED_STRUCT( S_INTArray, ARRAY_SIZE, INT );
return expected;
}
-extern "C" DLL_EXPORT S_UINTArray* S_UINTArray_Ret()
+extern "C" DLL_EXPORT S_UINTArray* WINAPI S_UINTArray_Ret()
{
INIT_EXPECTED_STRUCT( S_UINTArray, ARRAY_SIZE, UINT );
return expected;
}
-extern "C" DLL_EXPORT S_SHORTArray* S_SHORTArray_Ret()
+extern "C" DLL_EXPORT S_SHORTArray* WINAPI S_SHORTArray_Ret()
{
INIT_EXPECTED_STRUCT( S_SHORTArray, ARRAY_SIZE, SHORT );
return expected;
}
-extern "C" DLL_EXPORT S_WORDArray* S_WORDArray_Ret()
+extern "C" DLL_EXPORT S_WORDArray* WINAPI S_WORDArray_Ret()
{
INIT_EXPECTED_STRUCT( S_WORDArray, ARRAY_SIZE, WORD );
return expected;
}
-extern "C" DLL_EXPORT S_LONG64Array* S_LONG64Array_Ret()
+extern "C" DLL_EXPORT S_LONG64Array* WINAPI S_LONG64Array_Ret()
{
INIT_EXPECTED_STRUCT( S_LONG64Array, ARRAY_SIZE, LONG64 );
return expected;
}
-extern "C" DLL_EXPORT S_ULONG64Array* S_ULONG64Array_Ret()
+extern "C" DLL_EXPORT S_ULONG64Array* WINAPI S_ULONG64Array_Ret()
{
INIT_EXPECTED_STRUCT( S_ULONG64Array, ARRAY_SIZE, ULONG64 );
return expected;
}
-extern "C" DLL_EXPORT S_DOUBLEArray* S_DOUBLEArray_Ret()
+extern "C" DLL_EXPORT S_DOUBLEArray* WINAPI S_DOUBLEArray_Ret()
{
INIT_EXPECTED_STRUCT( S_DOUBLEArray, ARRAY_SIZE, DOUBLE );
return expected;
}
-extern "C" DLL_EXPORT S_FLOATArray* S_FLOATArray_Ret()
+extern "C" DLL_EXPORT S_FLOATArray* WINAPI S_FLOATArray_Ret()
{
INIT_EXPECTED_STRUCT( S_FLOATArray, ARRAY_SIZE, FLOAT );
return expected;
}
-extern "C" DLL_EXPORT S_BYTEArray* S_BYTEArray_Ret()
+extern "C" DLL_EXPORT S_BYTEArray* WINAPI S_BYTEArray_Ret()
{
INIT_EXPECTED_STRUCT( S_BYTEArray, ARRAY_SIZE, BYTE );
return expected;
}
-extern "C" DLL_EXPORT S_CHARArray* S_CHARArray_Ret()
+extern "C" DLL_EXPORT S_CHARArray* WINAPI S_CHARArray_Ret()
{
INIT_EXPECTED_STRUCT( S_CHARArray, ARRAY_SIZE, CHAR );
return expected;
}
-extern "C" DLL_EXPORT S_LPSTRArray* S_LPSTRArray_Ret()
+extern "C" DLL_EXPORT S_LPSTRArray* WINAPI S_LPSTRArray_Ret()
{
S_LPSTRArray *expected = (S_LPSTRArray *)::CoTaskMemAlloc( sizeof(S_LPSTRArray) );
for ( int i = 0; i < ARRAY_SIZE; ++i )
@@ -587,7 +587,7 @@ extern "C" DLL_EXPORT S_LPSTRArray* S_LPSTRArray_Ret()
}
-extern "C" DLL_EXPORT S_StructArray* S_StructArray_Ret()
+extern "C" DLL_EXPORT S_StructArray* WINAPI S_StructArray_Ret()
{
S_StructArray *expected = (S_StructArray *)::CoTaskMemAlloc( sizeof(S_StructArray) );
for ( int i = 0; i < ARRAY_SIZE; ++i )
diff --git a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp
index ba8c10b..79ab5c9 100644
--- a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp
+++ b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp
@@ -116,8 +116,10 @@ extern "C" DLL_EXPORT BOOL __stdcall MarshalPointer_Out(/*[out]*/ BOOL *pboolVal
}
#pragma warning(push)
+#if _MSC_VER <= 1900
// 'BOOL' forcing value to bool 'true' or 'false'
#pragma warning(disable: 4800)
+#endif
extern "C" DLL_EXPORT bool __stdcall Marshal_As_In(/*[in]*/bool boolValue)
{
diff --git a/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp b/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp
index 09f4671..0d0af27 100755
--- a/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp
+++ b/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
-size_t LEN = 10;
+const int LEN = 10;
extern "C" BOOL DLL_EXPORT _cdecl MarshalRefCharArray_Cdecl(char ** pstr)
{
//Check the Input
diff --git a/tests/src/Interop/SimpleStruct/SimpleStructNative.cpp b/tests/src/Interop/SimpleStruct/SimpleStructNative.cpp
index 5fe8214..fb855a4 100644
--- a/tests/src/Interop/SimpleStruct/SimpleStructNative.cpp
+++ b/tests/src/Interop/SimpleStruct/SimpleStructNative.cpp
@@ -30,7 +30,7 @@ DLL_EXPORT BOOL _cdecl CdeclSimpleStructByRef(Sstr *p)
{
p->a = 100;
p->b=1;
- strncpy(p->str,"after",6);
+ strcpy_s(p->str, 7, "after");
return TRUE;
}
@@ -81,7 +81,7 @@ DLL_EXPORT ExplStruct* _cdecl CdeclSimpleExplStruct(ExplStruct p,BOOL *result)
}
extern "C"
-DLL_EXPORT voidPtr _cdecl GetFptr(int i)
+DLL_EXPORT voidPtr __stdcall GetFptr(int i)
{
switch(i)
{
diff --git a/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp b/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp
index f4e0f2f..7007651 100644
--- a/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp
+++ b/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp
@@ -6,7 +6,7 @@
const int NSTRINGS = 6;
#ifdef _WIN32
-wchar_t *utf8strings[] = { L"Managed",
+const wchar_t *utf8strings[] = { L"Managed",
L"S\x00EEne kl\x00E2wen durh die wolken sint geslagen" ,
L"\x0915\x093E\x091A\x0902 \x0936\x0915\x094D\x0928\x094B\x092E\x094D\x092F\x0924\x094D\x0924\x0941\x092E\x094D \x0964 \x0928\x094B\x092A\x0939\x093F\x0928\x0938\x094D\x0924\x093F \x092E\x093E\x092E\x094D",
L"\x6211\x80FD\x541E\x4E0B\x73BB\x7483\x800C\x4E0D\x4F24\x8EAB\x4F53",
@@ -17,7 +17,7 @@ L"\0"
-char* utf16_to_utf8(wchar_t *srcstring)
+char* utf16_to_utf8(const wchar_t *srcstring)
{
if ((srcstring == NULL) || (*srcstring == L'\0')) {
return 0;
diff --git a/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.cpp b/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.cpp
index fe9ceea..0895443 100644
--- a/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.cpp
+++ b/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.cpp
@@ -167,22 +167,10 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsSeqByValOut3(CharSetAns
}
extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsSeqByRefOut3(CharSetAnsiSequential* str1)
{
- char const* strSource = "change string";
- int len = strlen(strSource);
- LPCSTR temp = (LPCSTR)TP_CoTaskMemAlloc((sizeof(char)*len)+1);
- if(temp != NULL)
- {
- TP_CoTaskMemFree((void*)(str1->f1));
- strcpy((char*)temp,strSource);
- str1->f1 = temp;
- str1->f2 = 'n';
- return TRUE;
- }
- else
- {
- printf("Memory Allocated Failed !");
- return FALSE;
- }
+ TP_CoTaskMemFree((void*)(str1->f1));
+ str1->f1 = CoStrDup("change string");
+ str1->f2 = 'n';
+ return TRUE;
}
////////////////////////////////////////////////////////////////////////////////////////////////
@@ -663,7 +651,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsSeqByVal14(S11 str1)
{
if( str1.i32 != 0 || str1.i != 32 )
return FALSE;
- str1.i32 = (LPINT)(long)(str1.i);
+ str1.i32 = reinterpret_cast<LPINT>(static_cast<INT_PTR>(str1.i));
str1.i = 64;
return TRUE;
}
@@ -673,7 +661,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsSeqByRef14(S11* str1)
return FALSE;
else
{
- str1->i32 = (LPINT)(long)(str1->i);
+ str1->i32 = reinterpret_cast<LPINT>(static_cast<INT_PTR>(str1->i));
str1->i = 64;
return TRUE;
}
@@ -684,7 +672,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsSeqByRefIn14(S11* str1)
return FALSE;
else
{
- str1->i32 = (LPINT)(long)(str1->i);
+ str1->i32 = reinterpret_cast<LPINT>(static_cast<INT_PTR>(str1->i));
str1->i = 64;
return TRUE;
}
@@ -698,7 +686,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsSeqByValOut14(S11 str1)
}
extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsSeqByRefOut14(S11* str1)
{
- str1->i32 = (LPINT)(long)(str1->i);
+ str1->i32 = reinterpret_cast<LPINT>(static_cast<INT_PTR>(str1->i));
str1->i = 64;
return TRUE;
}
@@ -817,7 +805,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsExpByValInnerArrayExpli
return FALSE;
}
}
- if(memcmp((&outer2)->f4,"some string2",12) != 0)
+ if(memcmp((&outer2)->s.f4,"some string2",12) != 0)
{
printf("\tMarshalStructAsParam_AsExpByVal3:InnerArrayExplicit param f4 not as expected\n");
return FALSE;
@@ -835,7 +823,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsExpByRefInnerArrayExpli
return FALSE;
}
}
- if(memcmp(outer2->f4,"some string2",12) != 0)
+ if(memcmp(outer2->s.f4,"some string2",12) != 0)
{
printf("\tMarshalStructAsParam_AsExpByRef3:InnerArrayExplicit param f4 not as expected\n");
return FALSE;
@@ -844,11 +832,8 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsExpByRefInnerArrayExpli
{
outer2->arr[i].f1 = 77;
}
- char const * temp = "change string2";
- size_t len = strlen(temp);
- LPCSTR str = (LPCSTR)TP_CoTaskMemAlloc( sizeof(char)*(len+1) );
- strcpy((char*)str,temp);
- outer2->f4 = str;
+
+ outer2->s.f4 = CoStrDup("change string2");
return TRUE;
}
@@ -862,7 +847,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsExpByRefInInnerArrayExp
return FALSE;
}
}
- if(memcmp(outer2->f4, "some string2",12*(sizeof(char))) != 0)
+ if(memcmp(outer2->s.f4, "some string2",12*(sizeof(char))) != 0)
{
printf("\tMarshalStructAsParam_AsExpByRefIn3:InnerArrayExplicit param f4 not as expected\n");
return FALSE;
@@ -871,11 +856,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsExpByRefInInnerArrayExp
{
outer2->arr[i].f1 = 77;
}
- char const * temp = "change string2";
- size_t len = strlen(temp);
- LPCSTR str = (LPCSTR)TP_CoTaskMemAlloc( sizeof(char)*(len+1) );
- strcpy((char*)str,temp);
- outer2->f4 = str;
+ outer2->s.f4 = CoStrDup("change string2");
return TRUE;
}
extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsExpByRefOutInnerArrayExplicit(InnerArrayExplicit* outer2)
@@ -884,11 +865,7 @@ extern "C" DLL_EXPORT BOOL WINAPI MarshalStructAsParam_AsExpByRefOutInnerArrayEx
{
outer2->arr[i].f1 = 77;
}
- char const * temp = "change string2";
- size_t len = strlen(temp);
- LPCSTR str = (LPCSTR)TP_CoTaskMemAlloc( sizeof(char)*(len+1) );
- strcpy((char*)str,temp);
- outer2->f4 = str;
+ outer2->s.f4 = CoStrDup("change string2");
return TRUE;
}
diff --git a/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h b/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h
index bf76727..22ad037 100644
--- a/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h
+++ b/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h
@@ -1,6 +1,17 @@
#include "platformdefines.cpp"
#include <xplatform.h>
+inline char* CoStrDup(const char* str)
+{
+ size_t size = strlen(str) + 1;
+ char* dup = (char *)TP_CoTaskMemAlloc(size);
+ if (dup != nullptr)
+ {
+ strcpy_s(dup, size, str);
+ }
+ return dup;
+}
+
const int NumArrElements = 2;
struct InnerSequential
{
@@ -19,20 +30,7 @@ void ChangeInnerSequential(InnerSequential* p)
{
p->f1 = 77;
p->f2 = 77.0;
-
- char const * lpstr = "changed string";
- size_t size = sizeof(char) * (strlen(lpstr) + 1);
- LPSTR temp = (LPSTR)TP_CoTaskMemAlloc( size );
- memset(temp, 0, size);
- if(temp)
- {
- strcpy( (char*)temp, lpstr );
- p->f3 = temp;
- }
- else
- {
- printf("Memory Allocated Failed!");
- }
+ p->f3 = CoStrDup("changed string");
}
bool IsCorrectInnerSequential(InnerSequential* p)
@@ -41,13 +39,7 @@ bool IsCorrectInnerSequential(InnerSequential* p)
return false;
if(p->f2 != 1.0)
return false;
-
- char const * lpstr = "some string";
- size_t size = sizeof(char) * (strlen(lpstr) + 1);
- LPSTR temp = (LPSTR)TP_CoTaskMemAlloc( size );
- memset(temp, 0, size);
-
- if( strcmp((char*)p->f3, temp) != 0 )
+ if(strcmp(p->f3, "") != 0)
return false;
return true;
@@ -62,6 +54,7 @@ typedef unsigned short WORD;
typedef short SHORT;
typedef float FLOAT;
typedef double DOUBLE;
+typedef long INT_PTR;
#endif
struct INNER2 // size = 12 bytes
@@ -74,11 +67,7 @@ void ChangeINNER2(INNER2* p)
{
p->f1 = 77;
p->f2 = 77.0;
- char const * temp = "changed string";
- size_t len = strlen(temp);
- LPCSTR str = (LPCSTR)TP_CoTaskMemAlloc( sizeof(char)*(len+1) );
- strcpy((char*)str,temp);
- p->f3 = str;
+ p->f3 = CoStrDup("changed string");
}
void PrintINNER2(INNER2* p, char const * name)
{
@@ -132,12 +121,7 @@ void PrintInnerExplicit(InnerExplicit* p, char const * name)
void ChangeInnerExplicit(InnerExplicit* p)
{
p->f1 = 77;
-
- char const * temp = "changed string";
- size_t len = strlen(temp);
- LPCSTR str = (LPCSTR)TP_CoTaskMemAlloc( sizeof(char)*(len+1) );
- strcpy((char*)str,temp);
- p->f3 = str;
+ p->f3 = CoStrDup("changed string");
}
struct InnerArraySequential
@@ -157,25 +141,11 @@ void PrintInnerArraySequential(InnerArraySequential* p, char const * name)
void ChangeInnerArraySequential(InnerArraySequential* p)
{
- char const * lpstr = "changed string";
- LPSTR temp;
for(int i = 0; i < NumArrElements; i++)
{
(p->arr)[i].f1 = 77;
(p->arr)[i].f2 = 77.0;
-
- size_t size = sizeof(char) * (strlen(lpstr) + 1);
- temp = (LPSTR)TP_CoTaskMemAlloc( size );
- memset(temp, 0, size);
- if(temp)
- {
- strcpy( (char*)temp, lpstr );
- (p->arr)[i].f3 = temp;
- }
- else
- {
- printf("Memory Allocated Failed!");
- }
+ (p->arr)[i].f3 = CoStrDup("changed string");
}
}
@@ -199,13 +169,14 @@ union InnerArrayExplicit // size = 32 bytes
{
LONG64 _unused0;
LPCSTR f4;
- };
-
+ } s;
};
#ifdef WINDOWS
#ifdef _WIN64
+ #pragma warning(push)
+ #pragma warning(disable: 4201) // nonstandard extension used: nameless struct/union
union OUTER3 // size = 32 bytes
{
struct InnerSequential arr[2];
@@ -215,6 +186,7 @@ union InnerArrayExplicit // size = 32 bytes
LPCSTR f4;
};
};
+ #pragma warning(pop)
#else
struct OUTER3 // size = 28 bytes
{
@@ -244,22 +216,14 @@ void PrintOUTER3(OUTER3* p, char const * name)
}
void ChangeOUTER3(OUTER3* p)
{
- char const * temp = "changed string";
- size_t len = strlen(temp);
- LPCSTR str = NULL;
for(int i = 0; i < NumArrElements; i++)
{
(p->arr)[i].f1 = 77;
(p->arr)[i].f2 = 77.0;
-
- str = (LPCSTR)TP_CoTaskMemAlloc( sizeof(char)*(len+1) );
- strcpy((char*)str,temp);
- (p->arr)[i].f3 = str;
+ (p->arr)[i].f3 = CoStrDup("changed string");
}
- str = (LPCSTR)TP_CoTaskMemAlloc( sizeof(char)*(len+1) );
- strcpy((char*)str,temp);
- p->f4 = str;
+ p->f4 = CoStrDup("changed string");
}
bool IsCorrectOUTER3(OUTER3* p)
{
@@ -293,19 +257,8 @@ void PrintCharSetAnsiSequential(CharSetAnsiSequential* p, char const * name)
void ChangeCharSetAnsiSequential(CharSetAnsiSequential* p)
{
- char const * strSource = "change string";
- size_t size = strlen(strSource) + 1;
- LPSTR temp = (LPSTR)TP_CoTaskMemAlloc(size);
- if(temp != NULL)
- {
- strcpy((char*)temp,strSource);
- p->f1 = temp;
- p->f2 = 'n';
- }
- else
- {
- printf("Memory Allocated Failed!");
- }
+ p->f1 = CoStrDup("change string");
+ p->f2 = 'n';
}
bool IsCorrectCharSetAnsiSequential(CharSetAnsiSequential* p)
@@ -325,7 +278,11 @@ struct CharSetUnicodeSequential
};
void PrintCharSetUnicodeSequential(CharSetUnicodeSequential* p, char const * name)
{
+#ifdef _WIN32
+ wprintf(L"\t%S.f1 = %s\n", name, p->f1);
+#else
wprintf(L"\t%s.f1 = %S\n", name, p->f1);
+#endif
printf("\t%s.f2 = %c\n", name, p->f2);
}
@@ -336,7 +293,7 @@ void ChangeCharSetUnicodeSequential(CharSetUnicodeSequential* p)
#else
LPCWSTR strSource = u"change string";
#endif
- int len = wcslen(strSource);
+ size_t len = wcslen(strSource);
LPCWSTR temp = (LPCWSTR)TP_CoTaskMemAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
@@ -418,7 +375,7 @@ void ChangeNumberSequential(NumberSequential* p)
bool IsCorrectNumberSequential(NumberSequential* p)
{
- if(p->i32 != -0x80000000 || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
+ if(p->i32 != (-0x7fffffff - 1) || p->ui32 != 0xffffffff || p->s1 != -0x8000 || p->us1 != 0xffff || p->b != 0 ||
p->sb != 0x7f ||p->i16 != -0x8000 || p->ui16 != 0xffff || p->i64 != -1234567890 ||
p->ui64 != 1234567890 || (p->sgl) != 32.0 || p->d != 3.2)
{
@@ -448,17 +405,10 @@ void ChangeS3(S3* p)
{
p->flag = false;
- char const * strSource = "change string";
- int len = strlen(strSource);
-
- LPCSTR temp = (LPCSTR)TP_CoTaskMemAlloc((sizeof(char)*len) + 1);
- if(temp != NULL)
- {
- /*TP_CoTaskMemFree((void *)p->str);*/
- strcpy((char*)temp,strSource);
- p->str = temp;
- }
- for(int i = 1;i<257;i++)
+ /*TP_CoTaskMemFree((void *)p->str);*/
+ p->str = CoStrDup("change string");
+
+ for(int i = 1;i<257;i++)
{
p->vals[i-1] = i;
}
@@ -468,12 +418,7 @@ bool IsCorrectS3(S3* p)
{
int iflag = 0;
- char const * lpstr = "some string";
- size_t size = sizeof(char) * (strlen(lpstr) + 1);
- LPSTR temp = (LPSTR)TP_CoTaskMemAlloc( size );
- memset(temp, 0, size);
-
- if(!p->flag || strcmp((char*)p->str, temp) != 0)
+ if (!p->flag || strcmp(p->str, "") != 0)
return false;
for (int i = 0; i < 256; i++)
{
@@ -514,33 +459,16 @@ void PrintS5(S5* str, char const * name)
}
void ChangeS5(S5* str)
{
- Enum1 eInstance = e2;
- char const * strSource = "change string";
- int len = strlen(strSource);
- LPCSTR temp = (LPCSTR)TP_CoTaskMemAlloc(sizeof(char)*(len+1));
- if(temp != NULL)
- {
- strcpy((char*)temp,strSource);
- str->s4.name = temp;
- }
+ str->s4.name = CoStrDup("change string");
str->s4.age = 64;
- str->ef = eInstance;
+ str->ef = e2;
}
bool IsCorrectS5(S5* str)
{
- Enum1 eInstance = e1;
-
- char const * lpstr = "some string";
- size_t size = sizeof(char) * (strlen(lpstr) + 1);
- LPSTR temp = (LPSTR)TP_CoTaskMemAlloc( size );
- memset(temp, 0, size);
-
- if(str->s4.age != 32 || strcmp((char*)str->s4.name, temp) != 0)
+ if(str->s4.age != 32 || strcmp(str->s4.name, "") != 0)
return false;
- if(str->ef != eInstance)
- {
+ if(str->ef != e1)
return false;
- }
return true;
}
@@ -599,8 +527,13 @@ struct StringStructSequentialUnicode // size = 8 bytes
void PrintStringStructSequentialUnicode(StringStructSequentialUnicode* str, char const * name)
{
+#ifdef _WIN32
+ wprintf(L"\t%S.first = %s\n", name, str->first);
+ wprintf(L"\t%S.last = %s\n", name, str->last);
+#else
wprintf(L"\t%s.first = %s\n", name, str->first);
wprintf(L"\t%s.last = %s\n", name, str->last);
+#endif
}
bool IsCorrectStringStructSequentialUnicode(StringStructSequentialUnicode* str)
@@ -674,19 +607,7 @@ bool IsCorrectS8(S8* str)
void ChangeS8(S8* str)
{
- char const * lpstr = "world";
- size_t size = sizeof(char) * (strlen(lpstr) + 1);
- LPSTR temp = (LPSTR)TP_CoTaskMemAlloc( size );
- memset(temp, 0, size);
- if(temp)
- {
- strcpy( (char*)temp, lpstr );
- str->name = temp;
- }
- else
- {
- printf("Memory Allocated Failed!");
- }
+ str->name = CoStrDup("world");
str->gender = false;
str->jobNum = 1;
str->i32 = 256;
@@ -787,7 +708,7 @@ void ChangeU(U* p)
p->uiPtr = (LPVOID)(64);
p->s = 32767;
p->us = 0;
- p->b = -1;
+ p->b = 255;
p->sb = -128;
p->l = -1234567890;
p->ul = 0;
diff --git a/tests/src/Interop/common/types.h b/tests/src/Interop/common/types.h
index 7d7f776..cb59c42 100755
--- a/tests/src/Interop/common/types.h
+++ b/tests/src/Interop/common/types.h
@@ -28,7 +28,7 @@ typedef void* HMODULE;
typedef void* ULONG_PTR;
typedef unsigned error_t;
typedef void* LPVOID;
-typedef char BYTE;
+typedef unsigned char BYTE;
typedef WCHAR OLECHAR;
typedef unsigned int UINT_PTR;
@@ -54,4 +54,4 @@ typedef int* DWORD_PTR;
#define FALSE 0
#endif
-#endif //_INTEROP_TYPES__H \ No newline at end of file
+#endif //_INTEROP_TYPES__H
diff --git a/tests/src/JIT/CodeGenBringUpTests/Rotate.cs b/tests/src/JIT/CodeGenBringUpTests/Rotate.cs
index 74a936e..9c5d959 100644
--- a/tests/src/JIT/CodeGenBringUpTests/Rotate.cs
+++ b/tests/src/JIT/CodeGenBringUpTests/Rotate.cs
@@ -102,12 +102,38 @@ public class Test
[MethodImpl(MethodImplOptions.NoInlining)]
static ulong rol64const()
{
- ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0x123456789abcdef;
+ ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0xabcdef123456789;
int amount = 16;
return (value >> (64 - amount)) | (value << amount);
}
[MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong rol64_16(ulong value)
+ {
+ return (value >> (64 - 16)) | (value << 16);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong rol64_32(ulong value)
+ {
+ return (value >> (64 - 32)) | (value << 32);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong rol64_32_inplace(ulong value, ulong added)
+ {
+ ulong x = value + added;
+ x = (x >> (64 - 32)) | (x << 32);
+ return x;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong rol64_33(ulong value)
+ {
+ return (value >> (64 - 33)) | (value << 33);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
ulong rol64field(int amount)
{
return (field << amount) | (field >> (64 - amount));
@@ -128,12 +154,38 @@ public class Test
[MethodImpl(MethodImplOptions.NoInlining)]
static ulong ror64const()
{
- ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0x123456789abcdef;
+ ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0xabcdef123456789;
int amount = flag() ? 5 : 5;
return (value << (64 - amount)) | (value >> amount);
}
[MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong ror64_5(ulong value)
+ {
+ return (value << (64 - 5)) | (value >> 5);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong ror64_32(ulong value)
+ {
+ return (value << (64 - 32)) | (value >> 32);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong ror64_33(ulong value)
+ {
+ return (value << (64 - 33)) | (value >> 33);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong ror64_32_inplace(ulong value, ulong added)
+ {
+ ulong x = value + added;
+ x = (x << (64 - 32)) | (x >> 32);
+ return x;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
static ulong ror64sfield(int amount)
{
return (s_field << (64 - amount)) | (s_field >> amount);
@@ -244,6 +296,26 @@ public class Test
return Fail;
}
+ if (rol64_16(0x123456789abcdef) != 0x456789abcdef0123)
+ {
+ return Fail;
+ }
+
+ if (rol64_32(0x123456789abcdef) != rol64(0x123456789abcdef, 32))
+ {
+ return Fail;
+ }
+
+ if (rol64_33(0x123456789abcdef) != rol64(0x123456789abcdef, 33))
+ {
+ return Fail;
+ }
+
+ if (rol64_32_inplace(0x123456789abcdef, 0) != rol64(0x123456789abcdef, 32))
+ {
+ return Fail;
+ }
+
if (ror64(0x123456789abcdef, 0) != 0x123456789abcdef)
{
return Fail;
@@ -259,6 +331,26 @@ public class Test
return Fail;
}
+ if (ror64_5(0x123456789abcdef) != 0x78091a2b3c4d5e6f)
+ {
+ return Fail;
+ }
+
+ if (ror64_32(0x123456789abcdef) != ror64(0x123456789abcdef, 32))
+ {
+ return Fail;
+ }
+
+ if (ror64_33(0x123456789abcdef) != ror64(0x123456789abcdef, 33))
+ {
+ return Fail;
+ }
+
+ if (ror64_32_inplace(0x123456789abcdef, 0) != ror64(0x123456789abcdef, 32))
+ {
+ return Fail;
+ }
+
if (rol32_call(0x12345678, 16) != 0x56781234)
{
return Fail;
diff --git a/tests/src/JIT/CodeGenBringUpTests/Shift.cs b/tests/src/JIT/CodeGenBringUpTests/Shift.cs
new file mode 100644
index 0000000..085ad3f
--- /dev/null
+++ b/tests/src/JIT/CodeGenBringUpTests/Shift.cs
@@ -0,0 +1,86 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+//
+
+
+using System;
+using System.Runtime.CompilerServices;
+
+public class Test
+{
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong shl64(ulong shift, int count)
+ {
+ return shift << count;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong shl64_32_inplace(ulong shift, ulong addit)
+ {
+ ulong x = shift + addit;
+ x = x << 32;
+ return x;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong shl64_33_inplace(ulong shift, ulong addit)
+ {
+ ulong x = shift + addit;
+ x = x << 33;
+ return x;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong shr64(ulong shift, int count)
+ {
+ return shift >> count;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong shr64_32_inplace(ulong shift, ulong addit)
+ {
+ ulong x = shift + addit;
+ x = x >> 32;
+ return x;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static ulong shr1_32_add(ulong shift, ulong addit)
+ {
+ ulong x = (addit + (shift >> 1)) >> 31;
+ return x;
+ }
+
+ public static int Main()
+ {
+ const int Pass = 100;
+ const int Fail = -1;
+
+ if (shl64_32_inplace(0x123456789abcdef, 0) != shl64(0x123456789abcdef, 32))
+ {
+ Console.WriteLine("shl64_32");
+ return Fail;
+ }
+
+ if (shl64_33_inplace(0x123456789abcdef, 0) != shl64(0x123456789abcdef, 33))
+ {
+ Console.WriteLine("shl64_33");
+ return Fail;
+ }
+
+ if (shr64_32_inplace(0x123456789abcdef, 0) != shr64(0x123456789abcdef, 32))
+ {
+ Console.WriteLine("shr64_32 {0:X} {1:X}", shr64_32_inplace(0x123456789abcdef, 0), shr64(0x123456789abcdef, 32));
+ return Fail;
+ }
+
+ if (shr1_32_add(0x123456789abcdef, 0) != shr64(0x123456789abcdef, 32))
+ {
+ Console.WriteLine("HAHAHAHAHAHAHA {0:X}", shr1_32_add(0x123456789abcdef, 0));
+ return Fail;
+ }
+
+ return Pass;
+ }
+}
diff --git a/tests/src/JIT/CodeGenBringUpTests/Shift.csproj b/tests/src/JIT/CodeGenBringUpTests/Shift.csproj
new file mode 100644
index 0000000..2189ed3
--- /dev/null
+++ b/tests/src/JIT/CodeGenBringUpTests/Shift.csproj
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{AF7F2478-9B49-4776-BEAF-0BF8916E2D79}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Shift.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)threading+thread\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)threading+thread\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Directed/pinvoke/pinvoke-examples.cs b/tests/src/JIT/Directed/pinvoke/pinvoke-examples.cs
new file mode 100644
index 0000000..26080d8
--- /dev/null
+++ b/tests/src/JIT/Directed/pinvoke/pinvoke-examples.cs
@@ -0,0 +1,223 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// Test cases showing interaction of inlining and inline pinvoke,
+// along with the impact of EH.
+
+using System;
+using System.Runtime.CompilerServices;
+
+
+namespace PInvokeTest
+{
+ internal class Test
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static int AsForceInline()
+ {
+ return Environment.ProcessorCount;
+ }
+
+ static int AsNormalInline()
+ {
+ return Environment.ProcessorCount;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static int AsNoInline()
+ {
+ return Environment.ProcessorCount;
+ }
+
+ static bool FromTryCatch()
+ {
+ bool result = false;
+ try
+ {
+ // All pinvokes should be inline, except on x64
+ result = (Environment.ProcessorCount == AsNormalInline());
+ }
+ catch (Exception)
+ {
+ result = false;
+ }
+ return result;
+ }
+
+ static bool FromTryFinally()
+ {
+ bool result = false;
+ bool result1 = false;
+ bool result2 = false;
+ try
+ {
+ // All pinvokes should be inline, except on x64
+ result1 = (Environment.ProcessorCount == AsNormalInline());
+ result2 = (Environment.ProcessorCount == AsNormalInline());
+ }
+ finally
+ {
+ result = result1 && result2;
+ }
+ return result;
+ }
+
+ static bool FromTryFinally2()
+ {
+ bool result = false;
+ bool result1 = false;
+ bool result2 = false;
+
+ try
+ {
+ // These two pinvokes should be inline, except on x64
+ result1 = (Environment.ProcessorCount == AsNormalInline());
+ }
+ finally
+ {
+ // These two pinvokes should *not* be inline (finally)
+ result2 = (Environment.ProcessorCount == AsNormalInline());
+ result = result1 && result2;
+ }
+
+ return result;
+ }
+
+ static bool FromTryFinally3()
+ {
+ bool result = false;
+ bool result1 = false;
+ bool result2 = false;
+
+ try
+ {
+ // These two pinvokes should be inline, except on x64
+ result1 = (Environment.ProcessorCount == AsNormalInline());
+ }
+ finally
+ {
+ try
+ {
+ // These two pinvokes should *not* be inline (finally)
+ result2 = (Environment.ProcessorCount == AsNormalInline());
+ }
+ catch (Exception)
+ {
+ result2 = false;
+ }
+
+ result = result1 && result2;
+ }
+
+ return result;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static bool FromInline()
+ {
+ // These two pinvokes should be inline
+ bool result = (Environment.ProcessorCount == AsForceInline());
+ return result;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static bool FromInline2()
+ {
+ // These four pinvokes should be inline
+ bool result1 = (Environment.ProcessorCount == AsNormalInline());
+ bool result2 = (Environment.ProcessorCount == AsForceInline());
+ return result1 && result2;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static bool FromNoInline()
+ {
+ // The only pinvoke should be inline
+ bool result = (Environment.ProcessorCount == AsNoInline());
+ return result;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static bool FromNoInline2()
+ {
+ // Three pinvokes should be inline
+ bool result1 = (Environment.ProcessorCount == AsNormalInline());
+ bool result2 = (Environment.ProcessorCount == AsNoInline());
+ return result1 && result2;
+ }
+
+ static bool FromFilter()
+ {
+ bool result = false;
+
+ try
+ {
+ throw new Exception("expected");
+ }
+ // These two pinvokes should *not* be inline (filter)
+ //
+ // For the first call the jit won't inline the wrapper, so
+ // it just calls get_ProcessorCount.
+ //
+ // For the second call, the force inline works, and the
+ // subsequent inline of get_ProcessorCount exposes a call
+ // to the pinvoke GetProcessorCount. This pinvoke will
+ // not be inline.
+ catch (Exception) when (Environment.ProcessorCount == AsForceInline())
+ {
+ result = true;
+ }
+
+ return result;
+ }
+
+ static bool FromColdCode()
+ {
+ int pc = 0;
+ bool result1 = false;
+ bool result2 = false;
+
+ try
+ {
+ // This pinvoke should not be inline (cold)
+ pc = Environment.ProcessorCount;
+ throw new Exception("expected");
+ }
+ catch (Exception)
+ {
+ // These two pinvokes should not be inline (catch)
+ //
+ // For the first call the jit won't inline the
+ // wrapper, so it just calls get_ProcessorCount.
+ //
+ // For the second call, the force inline works, and
+ // the subsequent inline of get_ProcessorCount exposes
+ // a call to the pinvoke GetProcessorCount. This
+ // pinvoke will not be inline.
+ result1 = (pc == Environment.ProcessorCount);
+ result2 = (pc == AsForceInline());
+ }
+
+ return result1 && result2;
+ }
+
+ private static int Main()
+ {
+ bool result = true;
+
+ result &= FromTryCatch();
+ result &= FromTryFinally();
+ result &= FromTryFinally2();
+ result &= FromTryFinally3();
+ result &= FromInline();
+ result &= FromInline2();
+ result &= FromNoInline();
+ result &= FromNoInline2();
+ result &= FromFilter();
+ result &= FromColdCode();
+
+ return (result ? 100 : -1);
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/pinvoke/pinvoke-examples.csproj b/tests/src/JIT/Directed/pinvoke/pinvoke-examples.csproj
new file mode 100644
index 0000000..78cf447
--- /dev/null
+++ b/tests/src/JIT/Directed/pinvoke/pinvoke-examples.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType>PdbOnly</DebugType>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="pinvoke-examples.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_d.csproj b/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_d.csproj
index fed9ead..a405402 100644
--- a/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_d.csproj
+++ b/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_d.csproj
@@ -14,6 +14,9 @@
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+
+ <!-- NOTE: this test simply takes too long to complete under GC stress; it is not fundamentally incompatible -->
+ <GCStressIncompatible Condition="'$(Platform)' == 'x86'">true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -43,4 +46,4 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
</PropertyGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_r.csproj b/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_r.csproj
index 7d311bf..bd5ae97 100644
--- a/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_r.csproj
+++ b/tests/src/JIT/Methodical/fp/exgen/10w5d_cs_r.csproj
@@ -14,6 +14,9 @@
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+
+ <!-- NOTE: this test simply takes too long to complete under GC stress; it is not fundamentally incompatible -->
+ <GCStressIncompatible Condition="'$(Platform)' == 'x86'">true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -43,4 +46,4 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
</PropertyGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/tests/src/JIT/Methodical/structs/systemvbringup/structpinvoketests.cs b/tests/src/JIT/Methodical/structs/systemvbringup/structpinvoketests.cs
index 7fc5203..8eae606 100644
--- a/tests/src/JIT/Methodical/structs/systemvbringup/structpinvoketests.cs
+++ b/tests/src/JIT/Methodical/structs/systemvbringup/structpinvoketests.cs
@@ -364,650 +364,698 @@ namespace structinreg
s1.y = 2;
s1.z = 3;
s1.w = 4;
-
- InvokeCallback1((par) => {
- Console.WriteLine("S1: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
- {
- throw new System.Exception();
- }
- }, s1);
- S2 s2;
- s2.x = 1;
- s2.y = 2;
- s2.z = 3;
- InvokeCallback2((par) => {
- Console.WriteLine("S2: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ try
+ {
+ InvokeCallback1((par) =>
{
- throw new System.Exception();
- }
- }, s2);
-
- S3 s3;
- s3.x = 1;
- s3.y = 2;
- s3.z = 3;
- InvokeCallback3((par) => {
- Console.WriteLine("S3: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ Console.WriteLine("S1: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s1);
+
+ S2 s2;
+ s2.x = 1;
+ s2.y = 2;
+ s2.z = 3;
+ InvokeCallback2((par) =>
{
- throw new System.Exception();
- }
- }, s3);
-
- S4 s4;
- s4.x = 1;
- s4.y = 2;
- InvokeCallback4((par) => {
- Console.WriteLine("S4: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ Console.WriteLine("S2: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s2);
+
+ S3 s3;
+ s3.x = 1;
+ s3.y = 2;
+ s3.z = 3;
+ InvokeCallback3((par) =>
{
- throw new System.Exception();
- }
- }, s4);
-
- S5 s5;
- s5.x = 1;
- s5.y = 2;
- InvokeCallback5((par) => {
- Console.WriteLine("S5: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ Console.WriteLine("S3: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s3);
+
+ S4 s4;
+ s4.x = 1;
+ s4.y = 2;
+ InvokeCallback4((par) =>
{
- throw new System.Exception();
- }
- }, s5);
-
- S6 s6;
- s6.x = 1;
- s6.y = 2;
- s6.z = 3;
- s6.w = 4;
- InvokeCallback6((par) => {
- Console.WriteLine("S6: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ Console.WriteLine("S4: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s4);
+
+ S5 s5;
+ s5.x = 1;
+ s5.y = 2;
+ InvokeCallback5((par) =>
{
- throw new System.Exception();
- }
- }, s6);
-
- S7 s7;
- s7.x = 1;
- s7.y = 2;
- s7.z = 3;
- InvokeCallback7((par) => {
- Console.WriteLine("S7: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ Console.WriteLine("S5: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s5);
+
+ S6 s6;
+ s6.x = 1;
+ s6.y = 2;
+ s6.z = 3;
+ s6.w = 4;
+ InvokeCallback6((par) =>
{
- throw new System.Exception();
- }
- }, s7);
-
- S8 s8;
- s8.x = 1;
- s8.y = 2;
- InvokeCallback8((par) => {
- Console.WriteLine("S8: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ Console.WriteLine("S6: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s6);
+
+ S7 s7;
+ s7.x = 1;
+ s7.y = 2;
+ s7.z = 3;
+ InvokeCallback7((par) =>
{
- throw new System.Exception();
- }
- }, s8);
-
- S9 s9;
- s9.x = 1;
- s9.y = 2;
- s9.z = 3;
- s9.w = 4;
- InvokeCallback9((par) => {
- Console.WriteLine("S9: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ Console.WriteLine("S7: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s7);
+
+ S8 s8;
+ s8.x = 1;
+ s8.y = 2;
+ InvokeCallback8((par) =>
{
- throw new System.Exception();
- }
- }, s9);
-
- S10 s10;
- s10.a = 1;
- s10.b = 2;
- s10.c = 3;
- s10.d = 4;
- s10.e = 5;
- s10.f = 6;
- s10.g = 7;
- s10.h = 8;
- InvokeCallback10((par) => {
- Console.WriteLine("S10: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
- par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8)
+ Console.WriteLine("S8: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s8);
+
+ S9 s9;
+ s9.x = 1;
+ s9.y = 2;
+ s9.z = 3;
+ s9.w = 4;
+ InvokeCallback9((par) =>
{
- throw new System.Exception();
- }
- }, s10);
-
- S11 s11;
- s11.a = 1;
- s11.b = 2;
- s11.c = 3;
- s11.d = 4;
- s11.e = 5;
- InvokeCallback11((par) => {
- Console.WriteLine("S11: {0}, {1}, {2}, {3}, {4}", par.a, par.b, par.c, par.d, par.e);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 || par.e != 5)
+ Console.WriteLine("S9: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s9);
+
+ S10 s10;
+ s10.a = 1;
+ s10.b = 2;
+ s10.c = 3;
+ s10.d = 4;
+ s10.e = 5;
+ s10.f = 6;
+ s10.g = 7;
+ s10.h = 8;
+ InvokeCallback10((par) =>
{
- throw new System.Exception();
- }
- }, s11);
-
- S12 s12;
- s12.a = 1;
- s12.b = 2;
- s12.c = 3;
- s12.d = 4;
- s12.e = 5;
- s12.f = 6;
- s12.g = 7;
- s12.h = 8;
- s12.i = 9;
- InvokeCallback12((par) => {
- Console.WriteLine("S12: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
- par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ Console.WriteLine("S10: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
+ par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8)
+ {
+ throw new System.Exception();
+ }
+ }, s10);
+
+ S11 s11;
+ s11.a = 1;
+ s11.b = 2;
+ s11.c = 3;
+ s11.d = 4;
+ s11.e = 5;
+ InvokeCallback11((par) =>
{
- throw new System.Exception();
- }
- }, s12);
-
- S13 s13;
- s13.hasValue = 1;
- s13.x = 2;
- InvokeCallback13((par) => {
- Console.WriteLine("S13: {0}, {1}", par.hasValue, par.x);
- if (par.hasValue != 1 || par.x != 2)
+ Console.WriteLine("S11: {0}, {1}, {2}, {3}, {4}", par.a, par.b, par.c, par.d, par.e);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 || par.e != 5)
+ {
+ throw new System.Exception();
+ }
+ }, s11);
+
+ S12 s12;
+ s12.a = 1;
+ s12.b = 2;
+ s12.c = 3;
+ s12.d = 4;
+ s12.e = 5;
+ s12.f = 6;
+ s12.g = 7;
+ s12.h = 8;
+ s12.i = 9;
+ InvokeCallback12((par) =>
{
- throw new System.Exception();
- }
- }, s13);
-
- S14 s14;
- s14.x = 1;
- s14.y = 2;
- InvokeCallback14((par) => {
- Console.WriteLine("S14: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ Console.WriteLine("S12: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
+ par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ {
+ throw new System.Exception();
+ }
+ }, s12);
+
+ S13 s13;
+ s13.hasValue = 1;
+ s13.x = 2;
+ InvokeCallback13((par) =>
{
- throw new System.Exception();
- }
- }, s14);
-
- S15 s15;
- s15.a = 1;
- s15.b = 2;
- s15.c = 3;
- s15.d = 4;
- s15.e = 5;
- s15.f = 6;
- s15.g = 7;
- s15.h = 8;
- s15.i = 9;
- InvokeCallback15((par) => {
- Console.WriteLine("S15: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
- par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ Console.WriteLine("S13: {0}, {1}", par.hasValue, par.x);
+ if (par.hasValue != 1 || par.x != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s13);
+
+ S14 s14;
+ s14.x = 1;
+ s14.y = 2;
+ InvokeCallback14((par) =>
{
- throw new System.Exception();
- }
- }, s15);
-
- S16 s16;
- s16.x = 1;
- s16.y = 2;
- InvokeCallback16((par) => {
- Console.WriteLine("S16: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ Console.WriteLine("S14: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s14);
+
+ S15 s15;
+ s15.a = 1;
+ s15.b = 2;
+ s15.c = 3;
+ s15.d = 4;
+ s15.e = 5;
+ s15.f = 6;
+ s15.g = 7;
+ s15.h = 8;
+ s15.i = 9;
+ InvokeCallback15((par) =>
{
- throw new System.Exception();
- }
- }, s16);
-
- S17 s17;
- s17.x = 1;
- s17.y = 2;
- InvokeCallback17((par) => {
- Console.WriteLine("S17: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ Console.WriteLine("S15: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
+ par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ {
+ throw new System.Exception();
+ }
+ }, s15);
+
+ S16 s16;
+ s16.x = 1;
+ s16.y = 2;
+ InvokeCallback16((par) =>
{
- throw new System.Exception();
- }
- }, s17);
-
- S18 s18;
- s18.x = 1;
- s18.y = 2;
- s18.z = 3;
- InvokeCallback18((par) => {
- Console.WriteLine("S18: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ Console.WriteLine("S16: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s16);
+
+ S17 s17;
+ s17.x = 1;
+ s17.y = 2;
+ InvokeCallback17((par) =>
{
- throw new System.Exception();
- }
- }, s18);
-
- S19 s19;
- s19.x = 1;
- s19.y = 2;
- s19.z = 3;
- s19.w = 4;
- InvokeCallback19((par) => {
- Console.WriteLine("S19: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ Console.WriteLine("S17: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s17);
+
+ S18 s18;
+ s18.x = 1;
+ s18.y = 2;
+ s18.z = 3;
+ InvokeCallback18((par) =>
{
- throw new System.Exception();
- }
- }, s19);
-
- S20 s20;
- s20.x = 1;
- s20.y = 2;
- s20.z = 3;
- s20.w = 4;
- InvokeCallback20((par) => {
- Console.WriteLine("S20: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ Console.WriteLine("S18: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s18);
+
+ S19 s19;
+ s19.x = 1;
+ s19.y = 2;
+ s19.z = 3;
+ s19.w = 4;
+ InvokeCallback19((par) =>
{
- throw new System.Exception();
- }
- }, s20);
-
-/* These tests are not working on non Windows CoreCLR. Enable this when GH Issue #2076 is resolved.
- TestClass testClass = new TestClass();
- S28 s28;
- s28.x = null;
- s28.y = 1;
-
- InvokeCallback28((par) => {
- Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
- if (par.x != null || par.y != 1)
+ Console.WriteLine("S19: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s19);
+
+ S20 s20;
+ s20.x = 1;
+ s20.y = 2;
+ s20.z = 3;
+ s20.w = 4;
+ InvokeCallback20((par) =>
{
- throw new System.Exception();
- }
- }, s28);
-
- s28.x = testClass;
- s28.y = 5;
-
- InvokeCallback28((par) => {
- Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
- if (par.x != testClass || par.y != 5)
+ Console.WriteLine("S20: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s20);
+
+ /* These tests are not working on non Windows CoreCLR. Enable this when GH Issue #2076 is resolved.
+ TestClass testClass = new TestClass();
+ S28 s28;
+ s28.x = null;
+ s28.y = 1;
+
+ InvokeCallback28((par) => {
+ Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
+ if (par.x != null || par.y != 1)
+ {
+ throw new System.Exception();
+ }
+ }, s28);
+
+ s28.x = testClass;
+ s28.y = 5;
+
+ InvokeCallback28((par) => {
+ Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
+ if (par.x != testClass || par.y != 5)
+ {
+ throw new System.Exception();
+ }
+ }, s28);
+
+ S29 s29;
+ s29.x = 1;
+ s29.y = null;
+
+ InvokeCallback29((par) => {
+ Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
+ if (par.x != 1 || par.y != null)
+ {
+ throw new System.Exception();
+ }
+ }, s29);
+
+ s29.x = 5;
+ s29.y = testClass;
+
+ InvokeCallback29((par) => {
+ Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
+ if (par.x != 5 || par.y != testClass)
+ {
+ throw new System.Exception();
+ }
+ }, s29);
+ Enable this when GH Issue #2076 is resolved. */
+ S30 s30;
+ s30.x = 1;
+ s30.y = 2;
+
+ S30 s30_2;
+ s30_2.x = 3;
+ s30_2.y = 4;
+
+ S30 s30_3;
+ s30_3.x = 5;
+ s30_3.y = 6;
+
+ // Program p = new Program();
+ InvokeCallback30(p.Test30, s30, s30_2, s30_3);
+ S1 s1r = InvokeCallback1R((par) =>
{
- throw new System.Exception();
- }
- }, s28);
-
- S29 s29;
- s29.x = 1;
- s29.y = null;
-
- InvokeCallback29((par) => {
- Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
- if (par.x != 1 || par.y != null)
+ Console.WriteLine("S1: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+
+ }, s1);
+ Console.WriteLine("S1R: {0}, {1}, {2}, {3}", s1r.x, s1r.y, s1r.z, s1r.w);
+ if (s1r.x != 1 || s1r.y != 2 || s1r.z != 3 || s1r.w != 4)
{
throw new System.Exception();
}
- }, s29);
- s29.x = 5;
- s29.y = testClass;
-
- InvokeCallback29((par) => {
- Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
- if (par.x != 5 || par.y != testClass)
+ S2 s2r = InvokeCallback2R((par) =>
{
- throw new System.Exception();
- }
- }, s29);
- Enable this when GH Issue #2076 is resolved. */
- S30 s30;
- s30.x = 1;
- s30.y = 2;
-
- S30 s30_2;
- s30_2.x = 3;
- s30_2.y = 4;
-
- S30 s30_3;
- s30_3.x = 5;
- s30_3.y = 6;
-
- // Program p = new Program();
- InvokeCallback30(p.Test30, s30, s30_2, s30_3);
- S1 s1r = InvokeCallback1R((par) => {
- Console.WriteLine("S1: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ Console.WriteLine("S2: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s2);
+ Console.WriteLine("S2R: {0}, {1}, {2}", s2r.x, s2r.y, s2r.z);
+ if (s2r.x != 1 || s2r.y != 2 || s2r.z != 3)
{
throw new System.Exception();
}
- }, s1);
- Console.WriteLine("S1R: {0}, {1}, {2}, {3}", s1r.x, s1r.y, s1r.z, s1r.w);
- if (s1r.x != 1 || s1r.y != 2 || s1r.z != 3 || s1r.w != 4)
- {
- throw new System.Exception();
- }
-
- S2 s2r = InvokeCallback2R((par) => {
- Console.WriteLine("S2: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ S3 s3r = InvokeCallback3R((par) =>
+ {
+ Console.WriteLine("S3: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s3);
+ Console.WriteLine("S3R: {0}, {1}, {2}", s3r.x, s3r.y, s3r.z);
+ if (s3r.x != 1 || s3r.y != 2 || s3r.z != 3)
{
throw new System.Exception();
}
- }, s2);
- Console.WriteLine("S2R: {0}, {1}, {2}", s2r.x, s2r.y, s2r.z);
- if (s2r.x != 1 || s2r.y != 2 || s2r.z != 3)
- {
- throw new System.Exception();
- }
- S3 s3r = InvokeCallback3R((par) => {
- Console.WriteLine("S3: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ S4 s4r = InvokeCallback4R((par) =>
+ {
+ Console.WriteLine("S4: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s4);
+ Console.WriteLine("S4R: {0}, {1}", s4r.x, s4r.y);
+ if (s4r.x != 1 || s4r.y != 2)
{
throw new System.Exception();
}
- }, s3);
- Console.WriteLine("S3R: {0}, {1}, {2}", s3r.x, s3r.y, s3r.z);
- if (s3r.x != 1 || s3r.y != 2 || s3r.z != 3)
- {
- throw new System.Exception();
- }
- S4 s4r = InvokeCallback4R((par) => {
- Console.WriteLine("S4: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ S5 s5r = InvokeCallback5R((par) =>
+ {
+ Console.WriteLine("S5: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s5);
+ Console.WriteLine("S5R: {0}, {1}", s5r.x, s5r.y);
+ if (s5r.x != 1 || s5r.y != 2)
{
throw new System.Exception();
}
- }, s4);
- Console.WriteLine("S4R: {0}, {1}", s4r.x, s4r.y);
- if (s4r.x != 1 || s4r.y != 2)
- {
- throw new System.Exception();
- }
- S5 s5r = InvokeCallback5R((par) => {
- Console.WriteLine("S5: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ S6 s6r = InvokeCallback6R((par) =>
+ {
+ Console.WriteLine("S6: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s6);
+ Console.WriteLine("S6R: {0}, {1}, {2}, {3}", s6r.x, s6r.y, s6r.z, s6r.w);
+ if (s6r.x != 1 || s6r.y != 2 || s6r.z != 3 || s6r.w != 4)
{
throw new System.Exception();
}
- }, s5);
- Console.WriteLine("S5R: {0}, {1}", s5r.x, s5r.y);
- if (s5r.x != 1 || s5r.y != 2)
- {
- throw new System.Exception();
- }
- S6 s6r = InvokeCallback6R((par) => {
- Console.WriteLine("S6: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ S7 s7r = InvokeCallback7R((par) =>
+ {
+ Console.WriteLine("S7: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s7);
+ Console.WriteLine("S7R: {0}, {1}, {2}", s7r.x, s7r.y, s7r.z);
+ if (s7r.x != 1 || s7r.y != 2 || s7r.z != 3)
{
throw new System.Exception();
}
- }, s6);
- Console.WriteLine("S6R: {0}, {1}, {2}, {3}", s6r.x, s6r.y, s6r.z, s6r.w);
- if (s6r.x != 1 || s6r.y != 2 || s6r.z != 3 || s6r.w != 4)
- {
- throw new System.Exception();
- }
- S7 s7r = InvokeCallback7R((par) => {
- Console.WriteLine("S7: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ S8 s8r = InvokeCallback8R((par) =>
+ {
+ Console.WriteLine("S8: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s8);
+ Console.WriteLine("S8R: {0}, {1}", s8r.x, s8r.y);
+ if (s8r.x != 1 || s8r.y != 2)
{
throw new System.Exception();
}
- }, s7);
- Console.WriteLine("S7R: {0}, {1}, {2}", s7r.x, s7r.y, s7r.z);
- if (s7r.x != 1 || s7r.y != 2 || s7r.z != 3)
- {
- throw new System.Exception();
- }
- S8 s8r = InvokeCallback8R((par) => {
- Console.WriteLine("S8: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ S9 s9r = InvokeCallback9R((par) =>
+ {
+ Console.WriteLine("S9: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s9);
+ Console.WriteLine("S9R: {0}, {1}, {2}, {3}", s9r.x, s9r.y, s9r.z, s9r.w);
+ if (s9r.x != 1 || s9r.y != 2 || s9r.z != 3 || s9r.w != 4)
{
throw new System.Exception();
}
- }, s8);
- Console.WriteLine("S8R: {0}, {1}", s8r.x, s8r.y);
- if (s8r.x != 1 || s8r.y != 2)
- {
- throw new System.Exception();
- }
- S9 s9r = InvokeCallback9R((par) => {
- Console.WriteLine("S9: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ S10 s10r = InvokeCallback10R((par) =>
{
- throw new System.Exception();
- }
- }, s9);
- Console.WriteLine("S9R: {0}, {1}, {2}, {3}", s9r.x, s9r.y, s9r.z, s9r.w);
- if (s9r.x != 1 || s9r.y != 2 || s9r.z != 3 || s9r.w != 4)
- {
- throw new System.Exception();
- }
-
- S10 s10r = InvokeCallback10R((par) => {
- Console.WriteLine("S10: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
- par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8)
+ Console.WriteLine("S10: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
+ par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8)
+ {
+ throw new System.Exception();
+ }
+ }, s10);
+ Console.WriteLine("S10R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", s10r.a, s10r.b, s10r.c, s10r.d, s10r.e, s10r.f, s10r.g, s10r.h);
+ if (s10r.a != 1 || s10r.b != 2 || s10r.c != 3 || s10r.d != 4 ||
+ s10r.e != 5 || s10r.f != 6 || s10r.g != 7 || s10r.h != 8)
{
throw new System.Exception();
}
- }, s10);
- Console.WriteLine("S10R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", s10r.a, s10r.b, s10r.c, s10r.d, s10r.e, s10r.f, s10r.g, s10r.h);
- if (s10r.a != 1 || s10r.b != 2 || s10r.c != 3 || s10r.d != 4 ||
- s10r.e != 5 || s10r.f != 6 || s10r.g != 7 || s10r.h != 8)
- {
- throw new System.Exception();
- }
- S11 s11r = InvokeCallback11R((par) => {
- Console.WriteLine("S11: {0}, {1}, {2}, {3}, {4}", par.a, par.b, par.c, par.d, par.e);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 || par.e != 5)
+ S11 s11r = InvokeCallback11R((par) =>
+ {
+ Console.WriteLine("S11: {0}, {1}, {2}, {3}, {4}", par.a, par.b, par.c, par.d, par.e);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 || par.e != 5)
+ {
+ throw new System.Exception();
+ }
+ }, s11);
+ Console.WriteLine("S11R: {0}, {1}, {2}, {3}, {4}", s11r.a, s11r.b, s11r.c, s11r.d, s11r.e);
+ if (s11r.a != 1 || s11r.b != 2 || s11r.c != 3 || s11r.d != 4 || s11r.e != 5)
{
throw new System.Exception();
}
- }, s11);
- Console.WriteLine("S11R: {0}, {1}, {2}, {3}, {4}", s11r.a, s11r.b, s11r.c, s11r.d, s11r.e);
- if (s11r.a != 1 || s11r.b != 2 || s11r.c != 3 || s11r.d != 4 || s11r.e != 5)
- {
- throw new System.Exception();
- }
- S12 s12r = InvokeCallback12R((par) => {
- Console.WriteLine("S12: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
- par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ S12 s12r = InvokeCallback12R((par) =>
+ {
+ Console.WriteLine("S12: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
+ par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ {
+ throw new System.Exception();
+ }
+ }, s12);
+ Console.WriteLine("S12R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", s12r.a, s12r.b, s12r.c, s12r.d, s12r.e, s12r.f, s12r.g, s12r.h, s12r.i);
+ if (s12r.a != 1 || s12r.b != 2 || s12r.c != 3 || s12r.d != 4 ||
+ s12r.e != 5 || s12r.f != 6 || s12r.g != 7 || s12r.h != 8 || s12r.i != 9)
{
throw new System.Exception();
}
- }, s12);
- Console.WriteLine("S12R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", s12r.a, s12r.b, s12r.c, s12r.d, s12r.e, s12r.f, s12r.g, s12r.h, s12r.i);
- if (s12r.a != 1 || s12r.b != 2 || s12r.c != 3 || s12r.d != 4 ||
- s12r.e != 5 || s12r.f != 6 || s12r.g != 7 || s12r.h != 8 || s12r.i != 9)
- {
- throw new System.Exception();
- }
- S13 s13r = InvokeCallback13R((par) => {
- Console.WriteLine("S13: {0}, {1}", par.hasValue, par.x);
- if (par.hasValue != 1 || par.x != 2)
+ S13 s13r = InvokeCallback13R((par) =>
+ {
+ Console.WriteLine("S13: {0}, {1}", par.hasValue, par.x);
+ if (par.hasValue != 1 || par.x != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s13);
+ Console.WriteLine("S13R: {0}, {1}", s13r.hasValue, s13r.x);
+ if (s13r.hasValue != 1 || s13r.x != 2)
{
throw new System.Exception();
}
- }, s13);
- Console.WriteLine("S13R: {0}, {1}", s13r.hasValue, s13r.x);
- if (s13r.hasValue != 1 || s13r.x != 2)
- {
- throw new System.Exception();
- }
- S14 s14r = InvokeCallback14R((par) => {
- Console.WriteLine("S14: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ S14 s14r = InvokeCallback14R((par) =>
+ {
+ Console.WriteLine("S14: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s14);
+ Console.WriteLine("S14R: {0}, {1}", s14r.x, s14r.y);
+ if (s14r.x != 1 || s14r.y != 2)
{
throw new System.Exception();
}
- }, s14);
- Console.WriteLine("S14R: {0}, {1}", s14r.x, s14r.y);
- if (s14r.x != 1 || s14r.y != 2)
- {
- throw new System.Exception();
- }
- S15 s15r = InvokeCallback15R((par) => {
- Console.WriteLine("S15: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
- if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
- par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ S15 s15r = InvokeCallback15R((par) =>
+ {
+ Console.WriteLine("S15: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", par.a, par.b, par.c, par.d, par.e, par.f, par.g, par.h, par.i);
+ if (par.a != 1 || par.b != 2 || par.c != 3 || par.d != 4 ||
+ par.e != 5 || par.f != 6 || par.g != 7 || par.h != 8 || par.i != 9)
+ {
+ throw new System.Exception();
+ }
+ }, s15);
+ Console.WriteLine("S15R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", s15r.a, s15r.b, s15r.c, s15r.d, s15r.e, s15r.f, s15r.g, s15r.h, s15r.i);
+ if (s15r.a != 1 || s15r.b != 2 || s15r.c != 3 || s15r.d != 4 ||
+ s15r.e != 5 || s15r.f != 6 || s15r.g != 7 || s15r.h != 8 || s15r.i != 9)
{
throw new System.Exception();
}
- }, s15);
- Console.WriteLine("S15R: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", s15r.a, s15r.b, s15r.c, s15r.d, s15r.e, s15r.f, s15r.g, s15r.h, s15r.i);
- if (s15r.a != 1 || s15r.b != 2 || s15r.c != 3 || s15r.d != 4 ||
- s15r.e != 5 || s15r.f != 6 || s15r.g != 7 || s15r.h != 8 || s15r.i != 9)
- {
- throw new System.Exception();
- }
- S16 s16r = InvokeCallback16R((par) => {
- Console.WriteLine("S16: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y != 2)
+ S16 s16r = InvokeCallback16R((par) =>
+ {
+ Console.WriteLine("S16: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s16);
+ Console.WriteLine("S16R: {0}, {1}", s16r.x, s16r.y);
+ if (s16r.x != 1 || s16r.y != 2)
{
throw new System.Exception();
}
- }, s16);
- Console.WriteLine("S16R: {0}, {1}", s16r.x, s16r.y);
- if (s16r.x != 1 || s16r.y != 2)
- {
- throw new System.Exception();
- }
- S17 s17r = InvokeCallback17R((par) => {
- Console.WriteLine("S17: {0}, {1}", par.x, par.y);
- if (par.x != 1 || par.y!= 2)
+ S17 s17r = InvokeCallback17R((par) =>
+ {
+ Console.WriteLine("S17: {0}, {1}", par.x, par.y);
+ if (par.x != 1 || par.y != 2)
+ {
+ throw new System.Exception();
+ }
+ }, s17);
+ Console.WriteLine("S17R: {0}, {1}", s17r.x, s17r.y);
+ if (s17r.x != 1 || s17r.y != 2)
{
throw new System.Exception();
}
- }, s17);
- Console.WriteLine("S17R: {0}, {1}", s17r.x, s17r.y);
- if (s17r.x != 1 || s17r.y != 2)
- {
- throw new System.Exception();
- }
- S18 s18r = InvokeCallback18R((par) => {
- Console.WriteLine("S18: {0}, {1}, {2}", par.x, par.y, par.z);
- if (par.x != 1 || par.y != 2 || par.z != 3)
+ S18 s18r = InvokeCallback18R((par) =>
+ {
+ Console.WriteLine("S18: {0}, {1}, {2}", par.x, par.y, par.z);
+ if (par.x != 1 || par.y != 2 || par.z != 3)
+ {
+ throw new System.Exception();
+ }
+ }, s18);
+ Console.WriteLine("S18R: {0}, {1}, {2}", s18r.x, s18r.y, s18r.z);
+ if (s18r.x != 1 || s18r.y != 2 || s18r.z != 3)
{
throw new System.Exception();
}
- }, s18);
- Console.WriteLine("S18R: {0}, {1}, {2}", s18r.x, s18r.y, s18r.z);
- if (s18r.x != 1 || s18r.y != 2 || s18r.z != 3)
- {
- throw new System.Exception();
- }
- S19 s19r = InvokeCallback19R((par) => {
- Console.WriteLine("S19: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ S19 s19r = InvokeCallback19R((par) =>
+ {
+ Console.WriteLine("S19: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s19);
+ Console.WriteLine("S19R: {0}, {1}, {2}, {3}", s19r.x, s19r.y, s19r.z, s19r.w);
+ if (s19r.x != 1 || s19r.y != 2 || s19r.z != 3 || s19r.w != 4)
{
throw new System.Exception();
}
- }, s19);
- Console.WriteLine("S19R: {0}, {1}, {2}, {3}", s19r.x, s19r.y, s19r.z, s19r.w);
- if (s19r.x != 1 || s19r.y != 2 || s19r.z != 3 || s19r.w != 4)
- {
- throw new System.Exception();
- }
- S20 s20r = InvokeCallback20R((par) => {
- Console.WriteLine("S20: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
- if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ S20 s20r = InvokeCallback20R((par) =>
+ {
+ Console.WriteLine("S20: {0}, {1}, {2}, {3}", par.x, par.y, par.z, par.w);
+ if (par.x != 1 || par.y != 2 || par.z != 3 || par.w != 4)
+ {
+ throw new System.Exception();
+ }
+ }, s20);
+ Console.WriteLine("S20R: {0}, {1}, {2}, {3}", s20r.x, s20r.y, s20r.z, s20r.w);
+ if (s20r.x != 1 || s20r.y != 2 || s20r.z != 3 || s20r.w != 4)
{
throw new System.Exception();
}
- }, s20);
- Console.WriteLine("S20R: {0}, {1}, {2}, {3}", s20r.x, s20r.y, s20r.z, s20r.w);
- if (s20r.x != 1 || s20r.y != 2 || s20r.z != 3 || s20r.w != 4)
- {
- throw new System.Exception();
- }
-/* These tests are not working on non Windows CoreCLR. Enable this when GH Issue #2076 is resolved.
- s28.x = null;
- S28 s28r = InvokeCallback28R((par) => {
- Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
- if (par.x == null || par.y != 5)
+ /* These tests are not working on non Windows CoreCLR. Enable this when GH Issue #2076 is resolved.
+ s28.x = null;
+ S28 s28r = InvokeCallback28R((par) => {
+ Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
+ if (par.x == null || par.y != 5)
+ {
+ throw new System.Exception();
+ }
+ }, s28);
+ Console.WriteLine("S28R: {0}, {1}", s28r.x == null ? "Null" : "Not null", s28r.y);
+ if (s28r.x == null || s28r.y != 5)
{
throw new System.Exception();
}
- }, s28);
- Console.WriteLine("S28R: {0}, {1}", s28r.x == null ? "Null" : "Not null", s28r.y);
- if (s28r.x == null || s28r.y != 5)
- {
- throw new System.Exception();
- }
- s28.x = testClass;
- s28.y = 5;
-
- s28r = InvokeCallback28R((par) => {
- Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
- if (par.x != testClass || par.y != 5)
+ s28.x = testClass;
+ s28.y = 5;
+
+ s28r = InvokeCallback28R((par) => {
+ Console.WriteLine("S28: {0}, {1}", par.x == null ? "Null" : "Not null", par.y);
+ if (par.x != testClass || par.y != 5)
+ {
+ throw new System.Exception();
+ }
+ }, s28);
+ Console.WriteLine("S28R: {0}, {1}", s28r.x == null ? "Null" : "Not null", s28r.y);
+ if (s28r.x != testClass || s28r.y != 5)
{
throw new System.Exception();
}
- }, s28);
- Console.WriteLine("S28R: {0}, {1}", s28r.x == null ? "Null" : "Not null", s28r.y);
- if (s28r.x != testClass || s28r.y != 5)
- {
- throw new System.Exception();
- }
- s29.y = null;
- S29 s29r = InvokeCallback29R((par) => {
- Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
- if (par.x != 5 || par.y == null)
+ s29.y = null;
+ S29 s29r = InvokeCallback29R((par) => {
+ Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
+ if (par.x != 5 || par.y == null)
+ {
+ throw new System.Exception();
+ }
+ }, s29);
+ Console.WriteLine("S29R: {0}, {1}", s29r.x, s29r.y == null ? "Null" : "Not null");
+ if (s29r.x != 5 || s29r.y == null)
{
throw new System.Exception();
}
- }, s29);
- Console.WriteLine("S29R: {0}, {1}", s29r.x, s29r.y == null ? "Null" : "Not null");
- if (s29r.x != 5 || s29r.y == null)
- {
- throw new System.Exception();
- }
- s29.x = 5;
- s29.y = testClass;
- s29r = InvokeCallback29R((par) => {
- Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
- if (par.x != 5 || par.y != testClass)
+ s29.x = 5;
+ s29.y = testClass;
+ s29r = InvokeCallback29R((par) => {
+ Console.WriteLine("S29: {0}, {1}", par.x, par.y == null ? "Null" : "Not null");
+ if (par.x != 5 || par.y != testClass)
+ {
+ throw new System.Exception();
+ }
+ }, s29);
+ Console.WriteLine("S29R: {0}, {1}", s29r.x, s29r.y == null ? "Null" : "Not null");
+ if (s29r.x != 5 || s29r.y != testClass)
{
throw new System.Exception();
}
- }, s29);
- Console.WriteLine("S29R: {0}, {1}", s29r.x, s29r.y == null ? "Null" : "Not null");
- if (s29r.x != 5 || s29r.y != testClass)
+ Enable this when GH Issue #2076 is resolved. */
+ }
+ catch (Exception e)
{
- throw new System.Exception();
+ Console.WriteLine(e.Message);
+ return -1;
}
- Enable this when GH Issue #2076 is resolved. */
return 100;
}
diff --git a/tests/src/JIT/Methodical/structs/valuetuple.cs b/tests/src/JIT/Methodical/structs/valuetuple.cs
new file mode 100644
index 0000000..9e8af5e
--- /dev/null
+++ b/tests/src/JIT/Methodical/structs/valuetuple.cs
@@ -0,0 +1,95 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+//
+
+// This test is extracted and simplified from the corefx tests for the ValueTuple class.
+// It exposed an issue with assertion propagation not validating the assertions
+// for a containing struct when a field lclVar is defined.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+[StructLayout(LayoutKind.Auto)]
+public struct ValueTuple<T1, T2, T3>
+{
+ public T1 Item1;
+ public T2 Item2;
+ public T3 Item3;
+ public ValueTuple(T1 item1, T2 item2, T3 item3)
+ {
+ Item1 = item1;
+ Item2 = item2;
+ Item3 = item3;
+ }
+
+ public static ValueTuple<T1, T2, T3> Create(T1 item1, T2 item2, T3 item3) =>
+ new ValueTuple<T1, T2, T3>(item1, item2, item3);
+
+ public override bool Equals(object obj)
+ {
+ return obj is ValueTuple<T1, T2, T3> && Equals((ValueTuple<T1, T2, T3>)obj);
+ }
+
+ public bool Equals(ValueTuple<T1, T2, T3> other)
+ {
+ return Item1.Equals(other.Item1) && Item2.Equals(other.Item2) && Item3.Equals(other.Item3);
+ }
+ public override int GetHashCode()
+ {
+ return 0;
+ }
+}
+
+public static class TupleExtensions
+{
+ public static ValueTuple<T1, T2, T3>
+ ToValueTuple<T1, T2, T3>(
+ this Tuple<T1, T2, T3> value)
+ {
+ return ValueTuple<T1, T2, T3>.Create(value.Item1, value.Item2, value.Item3);
+ }
+ public static Tuple<T1, T2, T3>
+ ToTuple<T1, T2, T3>(
+ this ValueTuple<T1, T2, T3> value)
+ {
+ return Tuple.Create(value.Item1, value.Item2, value.Item3);
+ }
+}
+
+public class StructOptsTest
+{
+ const int Pass = 100;
+ const int Fail = -1;
+
+ public static int ConvertToRef3()
+ {
+ var refTuple = Tuple.Create(-1, -1, -1);
+ var valueTuple = ValueTuple<int,int,int>.Create(1, 2, 3);
+
+ refTuple = valueTuple.ToTuple();
+ if (!String.Equals("(1, 2, 3)", refTuple.ToString()))
+ {
+ Console.WriteLine("Expected (1, 2, 3); got " + refTuple.ToString());
+ return Fail;
+ }
+ return Pass;
+ }
+
+ public static int Main()
+ {
+ int returnVal = Fail;
+ try
+ {
+ returnVal = ConvertToRef3();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Unexpected exception " + e.Message);
+ returnVal = Fail;
+ }
+ return returnVal;
+ }
+}
diff --git a/tests/src/JIT/Methodical/structs/valuetuple.csproj b/tests/src/JIT/Methodical/structs/valuetuple.csproj
new file mode 100644
index 0000000..486744b
--- /dev/null
+++ b/tests/src/JIT/Methodical/structs/valuetuple.csproj
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0B8F1AF4-9355-4307-BC68-08A2947AD3B9}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ <IlasmRoundTrip>true</IlasmRoundTrip>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="valuetuple.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)threading+thread\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)threading+thread\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
index 427ec92..431d857 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
@@ -18,6 +18,8 @@ using Microsoft.Xunit.Performance;
[assembly: MeasureInstructionsRetired]
#endif // XUNIT_PERF
+namespace Benchstone.BenchF
+{
public static class Adams
{
#if DEBUG
@@ -41,7 +43,7 @@ public static class Adams
#if VERBOSE
Console.WriteLine(" ADAMS-MOULTON METHOD ");
-#endif // VERBOSE
+#endif // VERBOSE
n = 4;
h = 1.0 / 32.0;
@@ -67,7 +69,7 @@ public static class Adams
f[i] = xn + yn;
#if VERBOSE
Console.WriteLine("{0}, {1}, {2}, {3}, {4}", k, xn, yn, dn, en);
-#endif // VERBOSE
+#endif // VERBOSE
}
for (k = 4; k <= nstep; k++)
@@ -137,7 +139,7 @@ public static class Adams
bool result = true;
// Note: we can't check xn or yn better because of the precision
- // with which original results are given
+ // with which original results are given
result &= System.Math.Abs(g_xn_base - g_xn) <= 1.5e-7;
result &= System.Math.Abs(g_yn_base - g_yn) <= 1.5e-7;
result &= System.Math.Abs(g_dn) <= 2.5e-9;
@@ -161,3 +163,4 @@ public static class Adams
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs
index 9701644..c4cfc0b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMk2/BenchMk2.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class BenchMk2
{
#if DEBUG
@@ -64,3 +66,4 @@ public static class BenchMk2
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs
index 27a5fe6..f342b2d8 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/BenchMrk/BenchMrk.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class BenchMrk
{
#if DEBUG
@@ -64,3 +66,4 @@ public static class BenchMrk
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs
index 1c27003..724416a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Bisect/Bisect.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Bisect
{
#if DEBUG
@@ -161,3 +163,4 @@ public static class Bisect
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs
index a2c3a38..47c5e20 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/DMath/DMath.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class DMath
{
#if DEBUG
@@ -110,4 +112,5 @@ public static class DMath
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs
index 3e85327..8881eae 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/FFT/FFT.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class FFT
{
#if DEBUG
@@ -151,3 +153,4 @@ public static class FFT
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs
index ff54ea7..26096b7 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/InProd/InProd.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class InProd
{
#if DEBUG
@@ -132,3 +134,4 @@ public static class InProd
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs
index a5f387b..6ecfb62 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/InvMt/InvMt.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class InvMt
{
#if DEBUG
@@ -135,3 +137,4 @@ public static class InvMt
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs
index 6dcb6c4..73ec09a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/LLoops/LLoops.cs
@@ -60,6 +60,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public class LLoops
{
#if DEBUG
@@ -648,3 +650,4 @@ public class LLoops
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs
index bff6398..5819446 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Lorenz/Lorenz.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Lorenz
{
#if DEBUG
@@ -132,3 +134,4 @@ public static class Lorenz
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs
index eb5e33b..a00c29b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/MatInv4/MatInv4.cs
@@ -10,6 +10,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class MatInv4
{
#if DEBUG
@@ -217,11 +219,11 @@ public static class MatInv4
// 0 < ik <= n^2
ik = nk + i;
hold = a[ik - 1];
- // -n < ij <= 0
+ // -n < ij <= 0
ij = i - n;
for (j = 1; j <= n; ++j)
{
- // i <= n, ij <= n + n + ... + n (n times) or ij <= n * n
+ // i <= n, ij <= n + n + ... + n (n times) or ij <= n * n
ij = ij + n;
if (j == k)
{
@@ -237,7 +239,7 @@ public static class MatInv4
kj = k - n;
for (j = 1; j <= n; ++j)
{
- // k <= n, kj <= n + n + ... + n (n times) or kj <= n * n
+ // k <= n, kj <= n + n + ... + n (n times) or kj <= n * n
kj = kj + n;
if (j == k)
{
@@ -268,11 +270,11 @@ public static class MatInv4
jr = n * (i - 1);
for (j = 1; j <= n; ++j)
{
- // jk <= n^2 - n + n
+ // jk <= n^2 - n + n
// jk <= n^2
jk = jq + j;
hold = a[jk - 1];
- // ji <= n^2 - n + n
+ // ji <= n^2 - n + n
// ji <= n^2
ji = jr + j;
a[jk - 1] = -a[ji - 1];
@@ -288,7 +290,7 @@ public static class MatInv4
ki = k - n;
for (i = 1; i <= n; ++i)
{
- // ki <= n + n + ... + n (n times) or ki <= n * n
+ // ki <= n + n + ... + n (n times) or ki <= n * n
ki = ki + n;
hold = a[ki - 1];
// if i=1, ji = (1 + (n-1) * n) - 1 + n ==> ij = n^2
@@ -378,7 +380,7 @@ public static class MatInv4
{
if (j != k)
{
- // Accessing upto n^2 - n + n - 1 ==> n^2 - 1
+ // Accessing upto n^2 - n + n - 1 ==> n^2 - 1
a[(i - 1) * n + (j - 1)] = a[(i - 1) * n + (k - 1)] * a[(k - 1) * n + (j - 1)] + a[(i - 1) * n + (j - 1)];
}
}
@@ -493,3 +495,4 @@ public static class MatInv4
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs
index 0fc1413..47f90d8 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtE/NewtE.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class NewtE
{
#if DEBUG
@@ -133,3 +135,4 @@ public static class NewtE
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs
index cf945bc..c590f6e 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/NewtR/NewtR.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class NewtR
{
#if DEBUG
@@ -129,3 +131,4 @@ public static class NewtR
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs
index 9743ab6..0011288 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Regula/Regula.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Regula
{
#if DEBUG
@@ -191,3 +193,4 @@ public static class Regula
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs
index 5824cd4..a4d56f7 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Romber/Romber.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Romber
{
#if DEBUG
@@ -167,3 +169,4 @@ public static class Romber
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs
index e7d1ace..060fb5b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Secant/Secant.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Secant
{
#if DEBUG
@@ -140,3 +142,4 @@ public static class Secant
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs
index e1e9f0e..5b2df29 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Simpsn/Simpsn.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Simpsn
{
#if DEBUG
@@ -91,3 +93,4 @@ public static class Simpsn
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs
index 673757c..b22aad8 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class SqMtx
{
#if DEBUG
@@ -101,3 +103,4 @@ public static class SqMtx
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs
index a5e3e5c..3a0de10 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Trap/Trap.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Trap
{
#if DEBUG
@@ -94,3 +96,4 @@ public static class Trap
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs
index 2ab0b61..ffe3fa5 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Whetsto/Whetsto.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchF
+{
public static class Whetsto
{
#if DEBUG
@@ -240,3 +242,4 @@ public static class Whetsto
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs
index 76ed0c8..e641ee0 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/8Queens/8Queens.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class EightQueens
{
@@ -68,7 +70,7 @@ public static class EightQueens
}
i = i + 1;
}
-
+
TryMe(1, ref q, b, a);
return (q == 1);
@@ -92,9 +94,10 @@ public static class EightQueens
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs
index 512f35f..5bfa196 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Ackermann/Ackermann.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class Ackermann
{
@@ -40,7 +42,7 @@ public static class Ackermann
int a33 = Acker(3, 3);
return (a00 == 1) && (a11 == 3) && (a22 == 7) & (a33 == 61);
}
-
+
[Benchmark]
public static void Test() {
foreach (var iteration in Benchmark.Iterations) {
@@ -59,9 +61,10 @@ public static class Ackermann
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs
index 0fa2ff9..d38e6b4 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray/AddArray.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class AddArray
{
@@ -48,14 +50,14 @@ public static class AddArray
m = j;
flags4[m] = flags3[l] + m + m + m + m;
}
-
+
for (j = 0; j <= Size; j++) {
k = j;
l = j;
m = j;
flags1[j] = flags1[j] + flags2[k] + flags3[l] + flags4[m] - flags2[k - j + l];
}
-
+
// Escape each flags array so that their elements will appear live-out
Escape(flags1);
Escape(flags2);
@@ -83,9 +85,10 @@ public static class AddArray
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs
index 865b944..a6004f0 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/AddArray2/AddArray2.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class AddArray2
{
#if DEBUG
@@ -129,3 +131,4 @@ public static class AddArray2
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs
index 8d5dbd6..780b7ce 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Array1/Array1.cs
@@ -18,6 +18,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class Array1
{
#if DEBUG
@@ -152,3 +154,4 @@ public static class Array1
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs
index 1b720b9..dac100c 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Array2/Array2.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class Array2
{
@@ -75,7 +77,7 @@ public static class Array2
}
bool result = VerifyCopy(s, d);
-
+
return result;
}
@@ -92,9 +94,10 @@ public static class Array2
bool result = Bench(Iterations);
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs
index 9cf7d77..b16c482 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BenchE/BenchE.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class BenchE
{
#if DEBUG
@@ -115,3 +117,4 @@ public static class BenchE
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs
index 78626ff..558484d 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort/BubbleSort.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class BubbleSort
{
@@ -43,7 +45,7 @@ public static class BubbleSort
return false;
}
}
-
+
return true;
}
@@ -79,9 +81,10 @@ public static class BubbleSort
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs
index 55e5a5f..8c2e63a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/BubbleSort2/BubbleSort2.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class BubbleSort2
{
@@ -82,9 +84,10 @@ public static class BubbleSort2
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs
index 606f740..aca2637 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/CSieve/CSieve.cs
@@ -12,6 +12,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class CSieve
{
@@ -74,9 +76,10 @@ public static class CSieve
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs
index 01064bb..ee028db 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Fib/Fib.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class Fib
{
@@ -30,7 +32,7 @@ public static class Fib
return 1;
}
}
-
+
[MethodImpl(MethodImplOptions.NoInlining)]
static bool Bench() {
int fib = Fibonacci(Number);
@@ -55,9 +57,10 @@ public static class Fib
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs
index 9fd7aa3..64b5c8f 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/HeapSort/HeapSort.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class HeapSort
{
@@ -32,7 +34,7 @@ public static class HeapSort
j = i;
k = j / 2;
m = x[i];
-
+
// 0 < k <= (n / 2)
// 1 <= j <= n
while (k > 0) {
@@ -113,9 +115,10 @@ public static class HeapSort
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs
index 78fa233..268af7b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/IniArray/IniArray.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class IniArray
{
@@ -52,9 +54,10 @@ public static class IniArray
bool result = Bench();
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs
index f5ff746..c5b4e3b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/LogicArray/LogicArray.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class LogicArray
{
@@ -89,9 +91,10 @@ public static class LogicArray
bool result = Bench();
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs
index 6e4f193..9146874 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Midpoint/Midpoint.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class Midpoint
{
@@ -96,9 +98,10 @@ public static class Midpoint
bool result = Bench();
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs
index 3f9c224..a45c012 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/MulMatrix/MulMatrix.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class MulMatrix
{
@@ -19,7 +21,7 @@ public static class MulMatrix
#else
public const int Iterations = 100;
#endif
-
+
const int Size = 75;
static volatile object VolatileObject;
@@ -132,9 +134,10 @@ public static class MulMatrix
bool result = Bench();
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs
index c252674..33effcb 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/NDhrystone/NDhrystone.cs
@@ -7,7 +7,7 @@
// Dhrystone: a synthetic systems programming benchmark
// Reinhold P. Weicker
// Communications of the ACM, Volume 27 Issue 10, Oct 1984, Pages 1013-1030
-
+
using Microsoft.Xunit.Performance;
using System;
using System.Runtime.CompilerServices;
@@ -16,6 +16,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class NDhrystone
{
@@ -63,9 +65,9 @@ public static class NDhrystone
int intLoc2;
int intLoc3 = 0;
Enumeration enumLoc;
-
+
int i; /* modification */
-
+
m_ptrGlb.PtrComp = m_ptrGlbNext;
m_ptrGlb.Discr = Enumeration.Ident1;
m_ptrGlb.EnumComp = Enumeration.Ident3;
@@ -117,12 +119,12 @@ public static class NDhrystone
ptrParIn = ptrParIn.PtrComp;
}
}
-
+
static void Proc2(ref int intParIO) {
int intLoc;
Enumeration enumLoc = Enumeration.Ident2;
intLoc = intParIO + 10;
-
+
for (;;) {
if (s_char1Glob == 'A') {
--intLoc;
@@ -142,17 +144,17 @@ public static class NDhrystone
else {
s_intGlob = 100;
}
-
+
Proc7(10, s_intGlob, ref m_ptrGlb.IntComp);
}
-
+
static void Proc4() {
bool boolLoc;
boolLoc = s_char1Glob == 'A';
boolLoc |= s_boolGlob;
s_char2Glob = 'B';
}
-
+
static void Proc5() {
s_char1Glob = 'A';
s_boolGlob = false;
@@ -163,12 +165,12 @@ public static class NDhrystone
if (!Func3(enumParIn)) {
enumParOut = Enumeration.Ident4;
}
-
+
switch (enumParIn) {
- case Enumeration.Ident1:
+ case Enumeration.Ident1:
enumParOut = Enumeration.Ident1;
break;
- case Enumeration.Ident2:
+ case Enumeration.Ident2:
if (s_intGlob > 100) {
enumParOut = Enumeration.Ident1;
}
@@ -176,12 +178,12 @@ public static class NDhrystone
enumParOut = Enumeration.Ident4;
}
break;
- case Enumeration.Ident3:
+ case Enumeration.Ident3:
enumParOut = Enumeration.Ident2;
break;
- case Enumeration.Ident4:
+ case Enumeration.Ident4:
break;
- case Enumeration.Ident5:
+ case Enumeration.Ident5:
enumParOut = Enumeration.Ident3;
break;
}
@@ -192,7 +194,7 @@ public static class NDhrystone
intLoc = intParI1 + 2;
intParOut = intParI2 + intLoc;
}
-
+
static void Proc8(int[] array1Par, int[][] array2Par, int intParI1, int intParI2) {
int intLoc;
intLoc = intParI1 + 5;
@@ -206,7 +208,7 @@ public static class NDhrystone
array2Par[intLoc + 20][intLoc] = array1Par[intLoc];
s_intGlob = 5;
}
-
+
static Enumeration Func1(char charPar1, char charPar2) {
char charLoc1;
char charLoc2;
@@ -219,7 +221,7 @@ public static class NDhrystone
return (Enumeration.Ident2);
}
}
-
+
static bool Func2(char[] strParI1, char[] strParI2) {
int intLoc;
char charLoc = '\0';
@@ -243,18 +245,18 @@ public static class NDhrystone
return true;
}
}
-
+
return false;
}
}
-
+
static bool Func3(Enumeration enumParIn) {
Enumeration enumLoc;
enumLoc = enumParIn;
if (enumLoc == Enumeration.Ident3) {
return true;
}
-
+
return false;
}
@@ -278,9 +280,10 @@ public static class NDhrystone
bool result = Bench();
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs
index d7457cd..43fc28b 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Permutate/Permutate.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public class Permutate
{
#if DEBUG
@@ -114,3 +116,4 @@ public class Permutate
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs
index 112ff6d..2fe0918 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Pi/Pi.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class Pi
{
@@ -78,9 +80,10 @@ public static class Pi
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs
index 2b1c284..2271e02 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/Puzzle/Puzzle.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public class Puzzle
{
#if DEBUG
@@ -391,3 +393,4 @@ public class Puzzle
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs
index 191211a..7cdac96 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/QuickSort/QuickSort.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class QuickSort
{
@@ -52,7 +54,7 @@ public static class QuickSort
arr[j] = temp;
}
}
-
+
// need to swap the pivot and a[i](or a[j] as i==j) so
// that the pivot will be at its final place in the sorted array
@@ -108,9 +110,10 @@ public static class QuickSort
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs
index 8a24240..2867abc 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeInsert/TreeInsert.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public class TreeInsert
{
#if DEBUG
@@ -136,3 +138,4 @@ public class TreeInsert
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs
index 68b5c96..e097134 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/TreeSort/TreeSort.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class TreeSort
{
@@ -74,7 +76,7 @@ public static class TreeSort
else {
Insert(n, t.Left);
}
- }
+ }
else if (n < t.Val) {
if (t.Right == null) {
t.Right = new Node(n);
@@ -117,7 +119,7 @@ public static class TreeSort
bool result = CheckTree(tree);
return result;
}
-
+
[MethodImpl(MethodImplOptions.NoInlining)]
static bool Bench() {
int[] sortList = new int[SortElements + 1];
@@ -143,9 +145,10 @@ public static class TreeSort
}
return result;
}
-
+
public static int Main() {
bool result = TestBase();
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs b/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs
index 0bb17b8..de8b486 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchI/XposMatrix/XposMatrix.cs
@@ -11,6 +11,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Benchstone.BenchI
+{
public static class XposMatrix
{
public const int ArraySize = 100;
@@ -48,11 +50,11 @@ public static class XposMatrix
matrix[i][j] = 1;
}
}
-
+
if (matrix[n][n] != 1) {
return false;
}
-
+
Inner(matrix, n);
if (matrix[n][n] != 1) {
@@ -88,3 +90,4 @@ public static class XposMatrix
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs
index e4118b2..c77e802 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees.csharp.cs
@@ -2,9 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/* The Computer Language Benchmarks Game
- http://benchmarksgame.alioth.debian.org/
+ http://benchmarksgame.alioth.debian.org/
- contributed by Marek Safar
+ contributed by Marek Safar
modified for use with xunit-performance
*/
@@ -17,6 +17,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace BenchmarksGame
+{
public class BinaryTrees
{
private const int minDepth = 4;
@@ -149,3 +151,4 @@ public class BinaryTrees
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs
index c58ce0b..92fbceb 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta.csharp-2.cs
@@ -18,6 +18,8 @@ using System.Text;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace BenchmarksGame
+{
public class Fasta
{
#if DEBUG
@@ -218,3 +220,4 @@ public class Fasta
s.Write(s_buf, 0, s_index);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs
index 7128e32..df8999a 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/fastaredux/fastaredux.csharp.cs
@@ -18,6 +18,8 @@ using System.Text;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace BenchmarksGame
+{
public static class FastaRedux
{
#if DEBUG
@@ -181,4 +183,5 @@ public static class FastaRedux
if (br < BUF_LEN) s.Write(s_buf, 0, BUF_LEN - br);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs
index 70c8709..2124cf4 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/nbody/nbody.csharp-3.cs
@@ -15,6 +15,8 @@ using System;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace BenchmarksGame
+{
public class NBody
{
public static int Main(String[] args)
@@ -153,4 +155,5 @@ internal class NBodySystem
return e;
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs
index 3395e29..7e36f0e 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pi-digits.cs
@@ -6,7 +6,7 @@
*
* Port of the C code that uses GMP
* Just switched it to use C#'s BigInteger instead
- *
+ *
* To compile use csc /o+ /r:System.Numerics.dll
*
* modified for use with xunit-performance
@@ -20,6 +20,8 @@ using System.Text;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace BenchmarksGame
+{
public class pidigits
{
#if DEBUG
@@ -111,4 +113,5 @@ public class pidigits
}
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs
index 9e98486..01eeea07 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm.cs
@@ -3,8 +3,8 @@
// See the LICENSE file in the project root for more information.
/* The Computer Language Benchmarks Game
http://benchmarksgame.alioth.debian.org/
-
- contributed by Isaac Gouy
+
+ contributed by Isaac Gouy
modified for use with xunit-performance
*/
@@ -15,6 +15,8 @@ using System;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace BenchmarksGame
+{
public class SpectralNorm
{
#if DEBUG
@@ -78,7 +80,7 @@ public class SpectralNorm
}
// B=AtA A multiplied by A transposed
- // v.Bv /(v.v) eigenvalue of v
+ // v.Bv /(v.v) eigenvalue of v
double vBv = 0, vv = 0;
for (int i = 0; i < n; i++)
{
@@ -124,3 +126,4 @@ public class SpectralNorm
MultiplyAtv(n, u, AtAv);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsByte.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsByte.cs
index 8271c40..3b28f87 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsByte.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsByte.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsByte
{
@@ -928,3 +930,4 @@ public static class ConstantArgsByte
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsChar.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsChar.cs
index 0d1f928..0cc4b9c 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsChar.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsChar.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsChar
{
@@ -928,3 +930,4 @@ public static class ConstantArgsChar
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsDouble.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsDouble.cs
index 6c95d48..4bd5683 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsDouble.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsDouble.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsDouble
{
@@ -808,3 +810,4 @@ public static class ConstantArgsDouble
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsFloat.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsFloat.cs
index bbd65a4..f609a4b 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsFloat.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsFloat.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsFloat
{
@@ -808,3 +810,4 @@ public static class ConstantArgsFloat
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsInt.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsInt.cs
index 03d59f9..f54e800 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsInt.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsInt.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsInt
{
@@ -928,3 +930,4 @@ public static class ConstantArgsInt
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsLong.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsLong.cs
index f4e45f5..e5679f16 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsLong.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsLong.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsLong
{
@@ -928,3 +930,4 @@ public static class ConstantArgsLong
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsSByte.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsSByte.cs
index b329122..0ec29b8 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsSByte.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsSByte.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsSByte
{
@@ -928,3 +930,4 @@ public static class ConstantArgsSByte
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsShort.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsShort.cs
index 8718111..f8cf23e 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsShort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsShort.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsShort
{
@@ -928,3 +930,4 @@ public static class ConstantArgsShort
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsString.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsString.cs
index b731908..38a3f7e 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsString.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsString.cs
@@ -16,6 +16,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsString
{
@@ -328,3 +330,4 @@ public static class ConstantArgsString
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUInt.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUInt.cs
index db3316e..e3f6e2a 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUInt.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUInt.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsUInt
{
@@ -888,3 +890,4 @@ public static class ConstantArgsUInt
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsULong.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsULong.cs
index 7208707..7585a3e 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsULong.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsULong.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsULong
{
@@ -888,3 +890,4 @@ public static class ConstantArgsULong
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUShort.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUShort.cs
index 249e985..c96274e 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUShort.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/ConstantArgsUShort.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class ConstantArgsUShort
{
@@ -928,3 +930,4 @@ public static class ConstantArgsUShort
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs
new file mode 100644
index 0000000..660627c
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.cs
@@ -0,0 +1,148 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+// In CoreCLR String.Format(ref, ref) is small and readily inlined.
+// The inline introduces a System.Parms GC struct local which is
+// untracked and must be zero initialized in the prolog. When the
+// inlined callsite is in a cold path, the inline hurts performance.
+//
+// There are two test methods below, one of which calls String.Format
+// on a cold path and the other which has similar structure but
+// does not call String.Format. Expectation is that they will have
+// similar performance.
+//
+// See https://github.com/dotnet/coreclr/issues/7569 for context.
+
+using Microsoft.Xunit.Performance;
+using System;
+using System.Runtime.CompilerServices;
+using Xunit;
+
+[assembly: OptimizeForBenchmarks]
+[assembly: MeasureInstructionsRetired]
+
+namespace Inlining
+{
+public class InlineGCStruct
+{
+#if DEBUG
+ public const int Iterations = 1;
+#else
+ public const int Iterations = 2500000;
+#endif
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int FastFunctionNotCallingStringFormat(int param)
+ {
+ if (param < 0)
+ {
+ throw new Exception(String.Format("We do not like the value {0:N0}.", param));
+ }
+
+ if (param == int.MaxValue)
+ {
+ throw new Exception(String.Format("{0:N0} is maxed out.", param));
+ }
+
+ if (param > int.MaxValue / 2)
+ {
+ throw new Exception(String.Format("We do not like the value {0:N0} either.", param));
+ }
+
+ return param * 2;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int FastFunctionNotHavingStringFormat(int param)
+ {
+ if (param < 0)
+ {
+ throw new ArgumentOutOfRangeException("param", "We do not like this value.");
+ }
+
+ if (param == int.MaxValue)
+ {
+ throw new ArgumentOutOfRangeException("param", "Maxed out.");
+ }
+
+ if (param > int.MaxValue / 2)
+ {
+ throw new ArgumentOutOfRangeException("param", "We do not like this value either.");
+ }
+
+ return param * 2;
+ }
+
+ [Benchmark]
+ public static bool WithFormat()
+ {
+ int result = 0;
+
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ for (int i = 0; i < Iterations; i++)
+ {
+ result |= FastFunctionNotCallingStringFormat(11);
+ }
+ }
+ }
+
+ return (result == 22);
+ }
+
+ [Benchmark]
+ public static bool WithoutFormat()
+ {
+ int result = 0;
+
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ for (int i = 0; i < Iterations; i++)
+ {
+ result |= FastFunctionNotHavingStringFormat(11);
+ }
+ }
+ }
+
+ return (result == 22);
+ }
+
+ public static bool WithoutFormatBase()
+ {
+ int result = 0;
+
+ for (int i = 0; i < Iterations; i++)
+ {
+ result |= FastFunctionNotHavingStringFormat(11);
+ }
+
+ return (result == 22);
+ }
+
+ public static bool WithFormatBase()
+ {
+ int result = 0;
+
+ for (int i = 0; i < Iterations; i++)
+ {
+ result |= FastFunctionNotCallingStringFormat(11);
+ }
+
+ return (result == 22);
+ }
+
+ public static int Main()
+ {
+ bool withFormat = WithFormatBase();
+ bool withoutFormat = WithoutFormatBase();
+
+ return (withFormat && withoutFormat ? 100 : -1);
+ }
+}
+}
+
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj
new file mode 100644
index 0000000..cb33816
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/InlineGCStruct.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="InlineGCStruct.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs b/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs
index 9b689ce..dc05f44 100644
--- a/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Inlining/NoThrowInline.cs
@@ -13,6 +13,8 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Inlining
+{
public static class NoThrowInline
{
#if DEBUG
@@ -34,7 +36,7 @@ public static class NoThrowInline
//
// We expect ThrowArgumentNullException to not be inlined into Bench, the throw code is pretty
- // large and throws are extremly slow. However, we need to be careful not to degrade the
+ // large and throws are extremly slow. However, we need to be careful not to degrade the
// non-exception path performance by preserving registers across the call. For this the compiler
// will have to understand that ThrowArgumentNullException never returns and omit the register
// preservation code.
@@ -73,3 +75,4 @@ public static class NoThrowInline
return (Bench("a", "bc", "def", "ghij") == 10) ? 100 : -1;
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs b/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs
index ed7f675..5ab0820 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/ConsoleMandel/ConsoleMandel.cs
@@ -11,9 +11,9 @@ using Xunit;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
-namespace ConsoleMandel
+namespace SIMD
{
- public static class Program
+ public static class ConsoleMandel
{
private const int Pass = 100;
private const int Fail = -1;
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs b/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs
index 064f860..254672b 100644
--- a/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/RayTracer/RayTracerBench.cs
@@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//
-// Based on the Raytracer example from
-// Samples for Parallel Programming with the .NET Framework
+// Based on the Raytracer example from
+// Samples for Parallel Programming with the .NET Framework
// https://code.msdn.microsoft.com/windowsdesktop/Samples-for-Parallel-b4b76364
using Microsoft.Xunit.Performance;
@@ -16,6 +16,8 @@ using System.Collections.Concurrent;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace SIMD
+{
public class RayTracerBench
{
#if DEBUG
@@ -142,3 +144,4 @@ public class RayTracerBench
return (result ? 100 : -1);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs
new file mode 100644
index 0000000..34c0ab8
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs
@@ -0,0 +1,159 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Microsoft.Xunit.Performance;
+using System;
+using System.Numerics;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Reflection;
+using System.Collections.Generic;
+using Xunit;
+
+[assembly: OptimizeForBenchmarks]
+[assembly: MeasureInstructionsRetired]
+
+public static class SeekUnroll
+{
+
+ // The purpose of this micro-benchmark is to measure the effect of unrolling
+ // on this loop (taken from https://github.com/aspnet/KestrelHttpServer/pull/1138)
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static int FindByte(ref Vector<byte> byteEquals)
+ {
+ var vector64 = Vector.AsVectorInt64(byteEquals);
+ long longValue = 0;
+ var i = 0;
+ for (; i < Vector<long>.Count; i++)
+ {
+ longValue = vector64[i];
+ if (longValue == 0) continue;
+ break;
+ }
+
+ // Flag least significant power of two bit
+ var powerOfTwoFlag = (ulong)(longValue ^ (longValue - 1));
+ // Shift all powers of two into the high byte and extract
+ var foundByteIndex = (int)((powerOfTwoFlag * _xorPowerOfTwoToHighByte) >> 57);
+ // Single LEA instruction with jitted const (using function result)
+ return i * 8 + foundByteIndex;
+ }
+
+ // Magic constant used in FindByte
+ const ulong _xorPowerOfTwoToHighByte = (0x07ul |
+ 0x06ul << 8 |
+ 0x05ul << 16 |
+ 0x04ul << 24 |
+ 0x03ul << 32 |
+ 0x02ul << 40 |
+ 0x01ul << 48) + 1;
+
+ // Inner loop to repeatedly call FindByte
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static void InnerLoop(ref int foundIndex, ref Vector<Byte> vector)
+ {
+ for (int i = 0; i < InnerIterations; i++)
+ {
+ foundIndex = FindByte(ref vector);
+ }
+ }
+
+ // Iteration counts for inner loop set to have each call take 1 or
+ // 2 seconds or so in release, finish quickly in debug.
+#if DEBUG
+ const int InnerIterations = 1;
+#else
+ const int InnerIterations = 1000000000;
+#endif
+
+ // Function to meaure InnerLoop using the xunit-perf benchmark measurement facilities
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static void XunitBenchmarkLoop(ref int foundIndex, ref Vector<Byte> vector)
+ {
+ foreach (var iteration in Benchmark.Iterations)
+ {
+ using (iteration.StartMeasurement())
+ {
+ InnerLoop(ref foundIndex, ref vector);
+ }
+ }
+ }
+
+ // Function to measure InnerLoop with manual use of a stopwatch timer
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ static void ManualTimerLoop(ref int foundIndex, ref Vector<Byte> vector)
+ {
+ for (int iteration = 0; iteration < ManualLoopTimes.Length; ++iteration)
+ {
+ var timer = System.Diagnostics.Stopwatch.StartNew();
+ InnerLoop(ref foundIndex, ref vector);
+ timer.Stop();
+ ManualLoopTimes[iteration] = timer.ElapsedMilliseconds;
+ }
+ }
+ static long[] ManualLoopTimes;
+
+ // Function that tests one input, dispatching to either the xunit-perf
+ // loop or the manual timer loop
+ static bool Test(int index, bool isXunitBenchmark)
+ {
+ if (index >= Vector<Byte>.Count)
+ {
+ // FindByte assumes index is in range
+ index = 0;
+ }
+ var bytes = new Byte[Vector<Byte>.Count];
+ bytes[index] = 255;
+ Vector<Byte> vector = new Vector<Byte>(bytes);
+
+ int foundIndex = -1;
+
+ if (isXunitBenchmark)
+ {
+ XunitBenchmarkLoop(ref foundIndex, ref vector);
+ }
+ else
+ {
+ ManualTimerLoop(ref foundIndex, ref vector);
+ }
+
+ Assert.Equal(index, foundIndex);
+ return (index == foundIndex);
+ }
+
+ // Set of indices to pass to Test(int, bool)
+ static int[] IndicesToTest = new int[] { 1, 3, 11, 19, 27 };
+
+ // Entrypoint for xunit-perf to call the benchmark
+ [Benchmark]
+ [MemberData(nameof(ArrayedBoxedIndicesToTest))]
+ public static bool Test(object boxedIndex)
+ {
+ return Test((int)boxedIndex, true);
+ }
+
+ // IndicesToTest wrapped up in arrays of boxes since that's
+ // what xunit-perf needs
+ public static IEnumerable<object[]> ArrayedBoxedIndicesToTest =
+ IndicesToTest.Select((int index) => new object[] { index });
+
+
+ // Main method entrypoint runs the manual timer loop
+ public static int Main()
+ {
+ int failures = 0;
+ foreach(int index in IndicesToTest)
+ {
+ ManualLoopTimes = new long[10];
+ bool passed = Test(index, false);
+ if (!passed)
+ {
+ ++failures;
+ }
+ Console.WriteLine("Index {0}, times (ms) [{1}]", index, String.Join(", ", ManualLoopTimes));
+ }
+
+ return 100 + failures;
+ }
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj
new file mode 100644
index 0000000..53cfe42
--- /dev/null
+++ b/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.csproj
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9AE6E18D-B3F9-4216-9809-125824387175}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="SeekUnroll.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)benchmark\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)benchmark\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs b/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs
index b0ed00d..56fc266 100644
--- a/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Serialization/Deserialize.cs
@@ -15,6 +15,8 @@ using Microsoft.Xunit.Performance;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Serialization
+{
public class JsonBenchmarks
{
@@ -26,7 +28,7 @@ public class JsonBenchmarks
public const int JsonNetIterations = 90000;
#endif
- const string DataContractXml = @"<JsonBenchmarks.TestObject xmlns=""http://schemas.datacontract.org/2004/07/"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""><Id>33</Id><Name>SqMtx</Name><Results xmlns:a=""http://schemas.microsoft.com/2003/10/Serialization/Arrays""><a:double>101.3</a:double><a:double>99.8</a:double><a:double>99.6</a:double><a:double>100.4</a:double></Results><WhenRun>2015-01-01T00:00:00-08:00</WhenRun></JsonBenchmarks.TestObject>";
+ const string DataContractXml = @"<JsonBenchmarks.TestObject xmlns=""http://schemas.datacontract.org/2004/07/Serialization"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""><Id>33</Id><Name>SqMtx</Name><Results xmlns:a=""http://schemas.microsoft.com/2003/10/Serialization/Arrays""><a:double>101.3</a:double><a:double>99.8</a:double><a:double>99.6</a:double><a:double>100.4</a:double></Results><WhenRun>2015-01-01T00:00:00-08:00</WhenRun></JsonBenchmarks.TestObject>";
const string DataContractJson = @"{""Id"":33,""Name"":""SqMtx"",""Results"":[101.3,99.8,99.6,100.4],""WhenRun"":""\/Date(1420099200000-0800)\/""}";
@@ -83,7 +85,7 @@ public class JsonBenchmarks
}
[Benchmark]
- private void DeserializeDataContract()
+ private void DeserializeDataContract()
{
foreach (var iteration in Benchmark.Iterations) {
using (iteration.StartMeasurement()) {
@@ -199,3 +201,4 @@ public class JsonBenchmarks
return result ? 100 : -1;
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs b/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs
index 905cf56..39ab587 100644
--- a/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs
+++ b/tests/src/JIT/Performance/CodeQuality/Serialization/Serialize.cs
@@ -14,6 +14,8 @@ using Microsoft.Xunit.Performance;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
+namespace Serialization
+{
public class JsonBenchmarks
{
@@ -72,7 +74,7 @@ public class JsonBenchmarks
}
[Benchmark]
- private void SerializeDataContract()
+ private void SerializeDataContract()
{
foreach (var iteration in Benchmark.Iterations) {
using (iteration.StartMeasurement()) {
@@ -186,3 +188,4 @@ public class JsonBenchmarks
return result ? 100 : -1;
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs b/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs
index 23eab8d..620e012 100644
--- a/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs
+++ b/tests/src/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs
@@ -46,7 +46,7 @@ using System.Globalization;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
-namespace Crypto
+namespace V8.Crypto
{
public class Support
{
diff --git a/tests/src/JIT/Performance/CodeQuality/V8/DeltaBlue/DeltaBlue.cs b/tests/src/JIT/Performance/CodeQuality/V8/DeltaBlue/DeltaBlue.cs
index ee14b8b..27f7718 100644
--- a/tests/src/JIT/Performance/CodeQuality/V8/DeltaBlue/DeltaBlue.cs
+++ b/tests/src/JIT/Performance/CodeQuality/V8/DeltaBlue/DeltaBlue.cs
@@ -24,13 +24,15 @@ using System.Collections;
[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]
-/*
+/*
Strengths are used to measure the relative importance of constraints.
New strengths may be inserted in the strength hierarchy without
disrupting current constraints. Strengths cannot be created outside
this class, so pointer comparison can be used for value comparison.
*/
+namespace V8
+{
internal class Strength
{
private int _strengthValue;
@@ -1066,3 +1068,4 @@ public class deltablue
throw new Exception(s);
}
}
+}
diff --git a/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs b/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs
index 6d26593..5095d22 100644
--- a/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs
+++ b/tests/src/JIT/Performance/CodeQuality/V8/Richards/Richards.cs
@@ -20,7 +20,7 @@ using System.Collections.Generic;
// using System.Diagnostics;
// using System.Text.RegularExpressions;
-namespace Richards
+namespace V8.Richards
{
/// <summary>
/// Support is used for a place to generate any 'miscellaneous' methods generated as part
@@ -501,7 +501,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
TaskControlBlock run(Packet packet)
{
@@ -521,7 +521,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
String toString()
{
@@ -548,7 +548,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
TaskControlBlock run(Packet packet)
{
@@ -568,7 +568,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
String toString()
{
@@ -598,7 +598,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
TaskControlBlock run(Packet packet)
{
@@ -630,7 +630,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
String toString()
{
@@ -658,7 +658,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
TaskControlBlock run(Packet packet)
{
@@ -700,7 +700,7 @@ namespace Richards
public
#if !INTF_FOR_TASK
- override
+ override
#endif
String toString()
{
diff --git a/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.cmd b/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.cmd
index e85e226..e7b8917 100644
--- a/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.cmd
+++ b/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.cmd
@@ -9,7 +9,7 @@
@rem of the enlistment(repo). It also requires that CoreCLR has been built,
@rem and that all CoreCLR tests have been built.
@rem
-@rem The preformance harness "RunBencchmarks.exe" is built as a test case
+@rem The preformance harness "RunBenchmarks.exe" is built as a test case
@rem as are all the performance tests it runs.
@rem
@rem For the ByteMark tests, it must copy the command scripts to the
diff --git a/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.sh b/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.sh
new file mode 100755
index 0000000..ee70916
--- /dev/null
+++ b/tests/src/JIT/Performance/RunBenchmarks/RunBenchmarks.sh
@@ -0,0 +1,53 @@
+# ***************************************************************************
+# RunBenchmarks.sh
+#
+# This is a sample script for how to run benchmarks on Unix-like system.
+#
+# It requires the user to set CORECLR_ROOT to the root directory
+# of the enlistment(repo). It also requires that CoreCLR has been built,
+# and that all CoreCLR tests have been built.
+#
+# The preformance harness "RunBenchmarks.exe" is built as a test case
+# as are all the performance tests it runs.
+#
+# For the ByteMark tests, it must copy the command scripts to the
+# binary directory for the tests.
+#
+# By default, the performance harness is run on top of CoreCLR. There
+# is a commented out section that can be used to run on top of DesktopCLR.
+#
+# A standard benchmark run is done with one warmup run, and five iterations
+# of the benchmark.
+#
+# ***************************************************************************
+
+ARCH=${1:-x64}
+BUILD=${2:-Release}
+
+CORERUN=${CORERUN:-corerun}
+
+# *** set this appropriately for enlistment you are running benchmarks in
+
+if [ -z "$CORECLR_ROOT" ]; then
+ echo "You must set CORECLR_ROOT to be the root of your coreclr repo (e.g. /git/repos/coreclr)"
+ exit 1
+fi
+
+# *** Currently we can build test cases only on Windows, so "Windows_NT" is hard-coded in the variables.
+BENCHMARK_ROOT_DIR="$CORECLR_ROOT/bin/tests/Windows_NT.$ARCH.$BUILD/JIT/Performance/CodeQuality"
+BENCHMARK_SRC_DIR="$CORECLR_ROOT/tests/src/JIT/Performance/RunBenchmarks"
+BENCHMARK_HOST="$CORERUN $CORECLR_ROOT/bin/tests/Windows_NT.$ARCH.$BUILD/JIT/Performance/RunBenchmarks/RunBenchmarks/RunBenchmarks.exe"
+BENCHMARK_RUNNER="-runner $CORERUN"
+
+# *** need to copy command files for Bytemark
+mkdir -p ${BENCHMARK_ROOT_DIR}/Bytemark/Bytemark
+cp -rf $CORECLR_ROOT/tests/src/JIT/Performance/CodeQuality/Bytemark/commands ${BENCHMARK_ROOT_DIR}/Bytemark/Bytemark/commands
+
+BENCHMARK_CONTROLS="-run -v -w -n 5"
+BENCHMARK_SET="-f $BENCHMARK_SRC_DIR/coreclr_benchmarks.xml -notags broken"
+BENCHMARK_OUTPUT="-csvfile $BENCHMARK_SRC_DIR/coreclr_benchmarks.csv"
+BENCHMARK_SWITCHES="$BENCHMARK_CONTROLS -r $BENCHMARK_ROOT_DIR"
+
+echo "$BENCHMARK_HOST $BENCHMARK_RUNNER $BENCHMARK_SET $BENCHMARK_OUTPUT $BENCHMARK_SWITCHES"
+$BENCHMARK_HOST $BENCHMARK_RUNNER $BENCHMARK_SET $BENCHMARK_OUTPUT $BENCHMARK_SWITCHES
+
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b475589/b475589.il b/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b475589/b475589.il
deleted file mode 100644
index dce3d69..0000000
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b475589/b475589.il
+++ /dev/null
@@ -1,71 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console
-{
- .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
- .ver 4:0:0:0
-}
-
-.assembly extern mscorlib { auto }
-.assembly b475598 {}
-.module b475589.exe
-
-.class Program
-{
- .method static void Nasty()
- {
- .maxstack 2
-
- call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::PrepareConstrainedRegions()
- br start_try
-
- start_catch:
- ldstr "Cathed!"
- call void [System.Console]System.Console::WriteLine(string)
- leave.s end
- end_catch:
-
- start_try:
- newobj instance void [mscorlib]System.Exception::.ctor()
- throw
- end_try:
-
- end:
- ret
-
- .try start_try to end_try catch [mscorlib]System.Exception handler start_catch to end_catch
- }
- .method static int32 Main(string[] args)
- {
- .maxstack 2
- .entrypoint
-
-
- start_try:
-
- call void Program::Nasty()
- leave.s end_failure
-
- end_try:
- start_catch:
-
- leave.s end_success
- end_catch:
-
- end_success:
- ldstr "Test SUCCESS"
- call void [System.Console]System.Console::WriteLine(string)
- ldc.i4 100
- ret
-
- end_failure:
- ldstr "Test FAILURE"
- call void [System.Console]System.Console::WriteLine(string)
- ldc.i4 -1
- ret
-
- .try start_try to end_try catch [mscorlib]System.NotSupportedException handler start_catch to end_catch
- }
-} \ No newline at end of file
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.cs b/tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.cs
new file mode 100644
index 0000000..7b01517
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.cs
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+
+using System;
+using System.Runtime.CompilerServices;
+
+// This test case is meant to test an optimization in morph that
+// transforms helper call JIT_Stelem_Ref(a, null, i) to a[i] = null,
+// which further gets transformed into an array address and bounds
+// check nodes with references to the array local and the index
+// local. It is expected while doing such a transform, array
+// local and index local are appropriately ref counted and Value
+// number is updated post-global-morph and jit compilation
+// won't run into any asserts.
+class DevDiv_142976
+{
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static String Foo()
+ {
+ return null;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static void Bar()
+ {
+ String[] args = new String[10];
+ if (args != null)
+ {
+ throw new Exception();
+ }
+
+ String s = Foo();
+ if (s == null)
+ {
+ // This will result in JIT_Stelem_Ref(args, null, 0) call
+ // which gets re-morphed into args[0] = null.
+ args[0] = s;
+ }
+ }
+
+ public static int Main()
+ {
+ try
+ {
+ Bar();
+ }
+ catch (Exception)
+ {
+ }
+
+ Console.WriteLine("Pass");
+ return 100;
+ }
+} \ No newline at end of file
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.csproj b/tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.csproj
new file mode 100644
index 0000000..0c1a10e
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/DevDiv_142976/DevDiv_142976.csproj
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="DevDiv_142976.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.cs b/tests/src/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.cs
new file mode 100644
index 0000000..05f1d90
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.cs
@@ -0,0 +1,62374 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.CompilerServices;
+
+public class Test
+{
+ static bool f;
+
+ public static int Main()
+ {
+ f = true;
+ Test test = new Test();
+ return test.HugeMethod();
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public int HugeMethod()
+ {
+ int i = 0;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if