summaryrefslogtreecommitdiff
path: root/tests/src
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/src
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/src')
-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/generics/Visibility/A_Types.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/PrivateInterfaceImpl/Test2_NonFriendPriInterface.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/B_Types.csproj)12
276 files changed, 74972 insertions, 5855 deletions
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 (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++;
+ if (f) i++