From: Alexander Soldatov Date: Tue, 14 Mar 2017 13:34:39 +0000 (+0300) Subject: Added Array tests to CodeGenBringUpTests X-Git-Tag: submit/tizen/20210909.063632~11030^2~7724^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1e8dc311559a356482497b57af745e20a104742;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Added Array tests to CodeGenBringUpTests Commit migrated from https://github.com/dotnet/coreclr/commit/f734e77607bdf9b39049216948fc6ce243c69852 --- diff --git a/src/coreclr/tests/src/AllTestProjects.sln b/src/coreclr/tests/src/AllTestProjects.sln index 4711e81..be437ec 100644 --- a/src/coreclr/tests/src/AllTestProjects.sln +++ b/src/coreclr/tests/src/AllTestProjects.sln @@ -623,6 +623,24 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Args4", "JIT\CodeGenBringUp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Args5", "JIT\CodeGenBringUpTests\Args5.csproj", "{30993D25-1F0D-4CF4-98C0-5F6470B87382}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array1", "JIT\CodeGenBringUpTests\Array1.csproj", "{7E3680E3-36FC-4B6B-841A-80B8D0C4394C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array2", "JIT\CodeGenBringUpTests\Array2.csproj", "{4689170F-4BC1-4592-9753-CD4209D950D7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array3", "JIT\CodeGenBringUpTests\Array3.csproj", "{B4FE2E03-298E-41B8-A32C-8FD0F1BF7E8C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array4", "JIT\CodeGenBringUpTests\Array4.csproj", "{11F01248-05A0-4FA0-9345-75273E7276C9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayExc", "JIT\CodeGenBringUpTests\ArrayExc.csproj", "{DBC775DF-5D8A-42A5-87A5-CC51AAAABE3C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayJagged", "JIT\CodeGenBringUpTests\ArrayJagged.csproj", "{0E6C1DC4-EFF7-45CC-8A27-37BA07AC30EE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayMD1", "JIT\CodeGenBringUpTests\ArrayMD1.csproj", "{30A8AD2E-3B3B-4813-88E1-9EF2E75BB685}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayMD2", "JIT\CodeGenBringUpTests\ArrayMD2.csproj", "{C46B2CCD-C66B-40C8-A031-67FED61AFEDB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayObj", "JIT\CodeGenBringUpTests\ArrayObj.csproj", "{AA342BCA-74DE-41AC-88E9-5608E2DCFFAB}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsgAdd1", "JIT\CodeGenBringUpTests\AsgAdd1.csproj", "{2DBCC16D-CB12-43D1-A4B8-9E82BE1DB891}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsgAnd1", "JIT\CodeGenBringUpTests\AsgAnd1.csproj", "{18FD8738-0685-482B-9D97-CEB598AAAC5A}" diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.cs new file mode 100644 index 0000000..0281615 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.cs @@ -0,0 +1,28 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static void Array1(int[] a) + { + a[1] = 5; + } + + static int Main() + { + int[] a = {1, 2, 3, 4}; + Array1(a); + + if (a[1] != 5) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj new file mode 100644 index 0000000..c2c0592 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {7E3680E3-36FC-4B6B-841A-80B8D0C4394C} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array2.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array2.cs new file mode 100644 index 0000000..e73b271 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array2.cs @@ -0,0 +1,26 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int Array2(int[] a) + { + return a[1]; + } + + static int Main() + { + int[] a = {1, 2, 3, 4}; + if (Array2(a) != 2) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array2.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array2.csproj new file mode 100644 index 0000000..b55ba38 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array2.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {4689170F-4BC1-4592-9753-CD4209D950D7} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array3.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array3.cs new file mode 100644 index 0000000..a6bab21 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array3.cs @@ -0,0 +1,27 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int Array3() + { + int[] a = {1, 2, 3, 4}; + a[1] = 5; + return a[1]; + } + + static int Main() + { + if (Array3() != 5) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array3.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array3.csproj new file mode 100644 index 0000000..3e3f3bd --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array3.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {B4FE2E03-298E-41B8-A32C-8FD0F1BF7E8C} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array4.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array4.cs new file mode 100644 index 0000000..938ab97 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array4.cs @@ -0,0 +1,25 @@ + // 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int Array4(int i) { + int[] a = {1, 2, 3, 4}; + return a[i]; + } + + static int Main() + { + if (Array4(1) != 2) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array4.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array4.csproj new file mode 100644 index 0000000..b09f15f --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/Array4.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {11F01248-05A0-4FA0-9345-75273E7276C9} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayExc.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayExc.cs new file mode 100644 index 0000000..7822467 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayExc.cs @@ -0,0 +1,34 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayExc() + { + int[] a = {1, 2, 3, 4}; + return a[5]; + } + + static int Main() + { + try + { + ArrayExc(); + return Fail; + } + catch (System.IndexOutOfRangeException) + { + // OK + } + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayExc.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayExc.csproj new file mode 100644 index 0000000..4ab19af --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayExc.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {DBC775DF-5D8A-42A5-87A5-CC51AAAABE3C} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.cs new file mode 100644 index 0000000..1f0ec01 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.cs @@ -0,0 +1,28 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayJagged(int i) + { + int[][] a = new int[2][]; + a[0] = new int[2] {0, 1}; + a[1] = new int[2] {2, 3}; + return a[1][i]; + } + + static int Main() + { + if (ArrayJagged(1) != 3) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.csproj new file mode 100644 index 0000000..bd20e7b --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {0E6C1DC4-EFF7-45CC-8A27-37BA07AC30EE} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.cs new file mode 100644 index 0000000..642cd98 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.cs @@ -0,0 +1,26 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayMD1() + { + int[,] a = {{1, 2}, {3, 4}}; + return a[0, 1]; + } + + static int Main() + { + if (ArrayMD1() != 2) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.csproj new file mode 100644 index 0000000..23d0343 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {30A8AD2E-3B3B-4813-88E1-9EF2E75BB685} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.cs new file mode 100644 index 0000000..dba9dcc --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.cs @@ -0,0 +1,27 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayMD2(int x, int y) + { + int[,] a = new int[2, 3]; + a[x, y] = 42; + return a[x, y]; + } + + static int Main() + { + if (ArrayMD2(1, 1) != 42) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.csproj new file mode 100644 index 0000000..fcdd61f --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {C46B2CCD-C66B-40C8-A031-67FED61AFEDB} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayObj.cs b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayObj.cs new file mode 100644 index 0000000..75426b6 --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayObj.cs @@ -0,0 +1,36 @@ +// 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 BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + class Dummy + { + public int field; + public Dummy(int f) + { + field = f; + } + } + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayObj(int i) + { + Dummy[] a = {new Dummy(0), new Dummy(1), new Dummy(2), new Dummy(3), new Dummy(4), + new Dummy(5), new Dummy(6), new Dummy(7), new Dummy(8), new Dummy(9)}; + return a[i].field; + } + + static int Main() + { + if (ArrayObj(1) != 1) return Fail; + return Pass; + } +} \ No newline at end of file diff --git a/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayObj.csproj b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayObj.csproj new file mode 100644 index 0000000..0d73a2b --- /dev/null +++ b/src/coreclr/tests/src/JIT/CodeGenBringUpTests/ArrayObj.csproj @@ -0,0 +1,37 @@ + + + + + Debug + AnyCPU + 2.0 + {AA342BCA-74DE-41AC-88E9-5608E2DCFFAB} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + 7a9bfb7d + true + + + + + + + + + False + + + + + + + + + + + + \ No newline at end of file