From: Pat Gavlin Date: Fri, 4 Dec 2015 22:22:14 +0000 (-0800) Subject: Import jit/jit64/valuetype/nullable tests. X-Git-Tag: accepted/tizen/base/20180629.140029~6056^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d999a0aa9df21107e213f1c491b8961838e47a2e;p=platform%2Fupstream%2Fcoreclr.git Import jit/jit64/valuetype/nullable tests. This includes box/unbox and cast tests. There is also a small change to jit/config/minimal/project.json to include the System.Runtime.InteropServices package. --- diff --git a/tests/src/JIT/config/minimal/project.json b/tests/src/JIT/config/minimal/project.json index 7fad5ff..e242aad 100644 --- a/tests/src/JIT/config/minimal/project.json +++ b/tests/src/JIT/config/minimal/project.json @@ -2,9 +2,10 @@ "dependencies": { "System.Console": "4.0.0-beta-*", "System.Runtime": "4.0.20-beta-*", - "System.Runtime.Extensions": "4.0.10-beta-*" + "System.Runtime.Extensions": "4.0.10-beta-*", + "System.Runtime.InteropServices": "4.0.10-beta-*" }, "frameworks": { "dnxcore50": {} } -} \ No newline at end of file +} diff --git a/tests/src/JIT/config/minimal/project.lock.json b/tests/src/JIT/config/minimal/project.lock.json index 80e7678..f0a6c4a 100644 --- a/tests/src/JIT/config/minimal/project.lock.json +++ b/tests/src/JIT/config/minimal/project.lock.json @@ -33,6 +33,29 @@ "lib/DNXCore50/System.Private.Uri.dll": {} } }, + "System.Reflection/4.0.0-beta-23127": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0-beta-23127", + "System.Reflection.Primitives": "4.0.0-beta-23127", + "System.Runtime": "4.0.0-beta-23127" + }, + "compile": { + "ref/dotnet/System.Reflection.dll": {} + } + }, + "System.Reflection.Primitives/4.0.0-beta-23127": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0-beta-23127" + }, + "compile": { + "ref/dotnet/System.Reflection.Primitives.dll": {} + }, + "runtime": { + "lib/DNXCore50/System.Reflection.Primitives.dll": {} + } + }, "System.Runtime/4.0.20-beta-23127": { "type": "package", "dependencies": { @@ -57,6 +80,17 @@ "lib/DNXCore50/System.Runtime.Extensions.dll": {} } }, + "System.Runtime.InteropServices/4.0.10-beta-23127": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0-beta-23127", + "System.Reflection.Primitives": "4.0.0-beta-23127", + "System.Runtime": "4.0.0-beta-23127" + }, + "compile": { + "ref/dotnet/System.Runtime.InteropServices.dll": {} + } + }, "System.Text.Encoding/4.0.0": { "type": "package", "dependencies": { @@ -209,31 +243,15 @@ "lib/DNXCore50/System.Runtime.Extensions.dll": {} } }, - "System.Runtime.Handles/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Runtime.Handles.dll": {} - }, - "runtime": { - "lib/DNXCore50/System.Runtime.Handles.dll": {} - } - }, - "System.Runtime.InteropServices/4.0.20": { + "System.Runtime.InteropServices/4.0.10-beta-23127": { "type": "package", "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0", - "System.Runtime.Handles": "4.0.0" + "System.Reflection": "4.0.0-beta-23127", + "System.Reflection.Primitives": "4.0.0-beta-23127", + "System.Runtime": "4.0.0-beta-23127" }, "compile": { "ref/dotnet/System.Runtime.InteropServices.dll": {} - }, - "runtime": { - "lib/DNXCore50/System.Runtime.InteropServices.dll": {} } }, "System.Text.Encoding/4.0.10": { @@ -420,31 +438,15 @@ "lib/DNXCore50/System.Runtime.Extensions.dll": {} } }, - "System.Runtime.Handles/4.0.0": { + "System.Runtime.InteropServices/4.0.10-beta-23127": { "type": "package", "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Runtime.Handles.dll": {} - }, - "runtime": { - "lib/DNXCore50/System.Runtime.Handles.dll": {} - } - }, - "System.Runtime.InteropServices/4.0.20": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0", - "System.Runtime.Handles": "4.0.0" + "System.Reflection": "4.0.0-beta-23127", + "System.Reflection.Primitives": "4.0.0-beta-23127", + "System.Runtime": "4.0.0-beta-23127" }, "compile": { "ref/dotnet/System.Runtime.InteropServices.dll": {} - }, - "runtime": { - "lib/DNXCore50/System.Runtime.InteropServices.dll": {} } }, "System.Text.Encoding/4.0.10": { @@ -688,6 +690,54 @@ "System.Private.Uri.nuspec" ] }, + "System.Reflection/4.0.0-beta-23127": { + "type": "package", + "sha512": "C2H07xfQjIbtyFuD5T/g0QYc8sE0rhq3lNpL/LUmlQ7jS8xTm2hxTOvYqyPbmf4pYtBRQ3fS7/8mwRexPdN1wA==", + "files": [ + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net45/_._", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "License.rtf", + "ref/dotnet/de/System.Reflection.xml", + "ref/dotnet/es/System.Reflection.xml", + "ref/dotnet/fr/System.Reflection.xml", + "ref/dotnet/it/System.Reflection.xml", + "ref/dotnet/ja/System.Reflection.xml", + "ref/dotnet/ko/System.Reflection.xml", + "ref/dotnet/ru/System.Reflection.xml", + "ref/dotnet/System.Reflection.dll", + "ref/dotnet/System.Reflection.xml", + "ref/dotnet/zh-hans/System.Reflection.xml", + "ref/dotnet/zh-hant/System.Reflection.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/_._", + "ref/netcore50/de/System.Reflection.xml", + "ref/netcore50/es/System.Reflection.xml", + "ref/netcore50/fr/System.Reflection.xml", + "ref/netcore50/it/System.Reflection.xml", + "ref/netcore50/ja/System.Reflection.xml", + "ref/netcore50/ko/System.Reflection.xml", + "ref/netcore50/ru/System.Reflection.xml", + "ref/netcore50/System.Reflection.dll", + "ref/netcore50/System.Reflection.xml", + "ref/netcore50/zh-hans/System.Reflection.xml", + "ref/netcore50/zh-hant/System.Reflection.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Reflection.4.0.0-beta-23127.nupkg", + "System.Reflection.4.0.0-beta-23127.nupkg.sha512", + "System.Reflection.nuspec" + ] + }, "System.Reflection/4.0.0": { "type": "package", "sha512": "g96Rn8XuG7y4VfxPj/jnXroRJdQ8L3iN3k3zqsuzk4k3Nq4KMXARYiIO4BLW4GwX06uQpuYwRMcAC/aF117knQ==", @@ -736,6 +786,40 @@ "System.Reflection.nuspec" ] }, + "System.Reflection.Primitives/4.0.0-beta-23127": { + "type": "package", + "serviceable": true, + "sha512": "qUjIaT8GBhxh5pyY1xhQd3/Rn5CJMu023GGNWXObr6/I/lX9LWpJD+UJAsPcLMEXOFq3QaKk6+giNjaqIdcf7Q==", + "files": [ + "lib/DNXCore50/System.Reflection.Primitives.dll", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Primitives.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Reflection.Primitives.xml", + "ref/dotnet/es/System.Reflection.Primitives.xml", + "ref/dotnet/fr/System.Reflection.Primitives.xml", + "ref/dotnet/it/System.Reflection.Primitives.xml", + "ref/dotnet/ja/System.Reflection.Primitives.xml", + "ref/dotnet/ko/System.Reflection.Primitives.xml", + "ref/dotnet/ru/System.Reflection.Primitives.xml", + "ref/dotnet/System.Reflection.Primitives.dll", + "ref/dotnet/System.Reflection.Primitives.xml", + "ref/dotnet/zh-hans/System.Reflection.Primitives.xml", + "ref/dotnet/zh-hant/System.Reflection.Primitives.xml", + "ref/net45/_._", + "ref/netcore50/System.Reflection.Primitives.dll", + "ref/netcore50/System.Reflection.Primitives.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "runtimes/win8-aot/lib/netcore50/System.Reflection.Primitives.dll", + "System.Reflection.Primitives.4.0.0-beta-23127.nupkg", + "System.Reflection.Primitives.4.0.0-beta-23127.nupkg.sha512", + "System.Reflection.Primitives.nuspec" + ] + }, "System.Reflection.Primitives/4.0.0": { "type": "package", "serviceable": true, @@ -872,52 +956,18 @@ "System.Runtime.Extensions.nuspec" ] }, - "System.Runtime.Handles/4.0.0": { - "type": "package", - "serviceable": true, - "sha512": "638VhpRq63tVcQ6HDb3um3R/J2BtR1Sa96toHo6PcJGPXEPEsleCuqhBgX2gFCz0y0qkutANwW6VPPY5wQu1XQ==", - "files": [ - "lib/DNXCore50/System.Runtime.Handles.dll", - "lib/MonoAndroid10/_._", - "lib/MonoTouch10/_._", - "lib/net46/_._", - "lib/netcore50/System.Runtime.Handles.dll", - "lib/xamarinios10/_._", - "lib/xamarinmac20/_._", - "ref/dotnet/de/System.Runtime.Handles.xml", - "ref/dotnet/es/System.Runtime.Handles.xml", - "ref/dotnet/fr/System.Runtime.Handles.xml", - "ref/dotnet/it/System.Runtime.Handles.xml", - "ref/dotnet/ja/System.Runtime.Handles.xml", - "ref/dotnet/ko/System.Runtime.Handles.xml", - "ref/dotnet/ru/System.Runtime.Handles.xml", - "ref/dotnet/System.Runtime.Handles.dll", - "ref/dotnet/System.Runtime.Handles.xml", - "ref/dotnet/zh-hans/System.Runtime.Handles.xml", - "ref/dotnet/zh-hant/System.Runtime.Handles.xml", - "ref/MonoAndroid10/_._", - "ref/MonoTouch10/_._", - "ref/net46/_._", - "ref/xamarinios10/_._", - "ref/xamarinmac20/_._", - "runtimes/win8-aot/lib/netcore50/System.Runtime.Handles.dll", - "System.Runtime.Handles.4.0.0.nupkg", - "System.Runtime.Handles.4.0.0.nupkg.sha512", - "System.Runtime.Handles.nuspec" - ] - }, - "System.Runtime.InteropServices/4.0.20": { + "System.Runtime.InteropServices/4.0.10-beta-23127": { "type": "package", - "serviceable": true, - "sha512": "ZgDyBYfEnjWoz/viS6VOswA6XOkDSH2DzgbpczbW50RywhnCgTl+w3JEvtAiOGyIh8cyx1NJq80jsNBSUr8Pig==", + "sha512": "zacN2B2QO20ziz3VvTBcAmcfnVtcO5Wu0tPcKA+5Gok+ZoKD9Ii8oRHSQ2Ou8L2yo5sL5ULh3J+PV4b7JZc4Gg==", "files": [ - "lib/DNXCore50/System.Runtime.InteropServices.dll", "lib/MonoAndroid10/_._", "lib/MonoTouch10/_._", - "lib/net46/_._", - "lib/netcore50/System.Runtime.InteropServices.dll", + "lib/net451/_._", + "lib/win81/_._", + "lib/wpa81/_._", "lib/xamarinios10/_._", "lib/xamarinmac20/_._", + "License.rtf", "ref/dotnet/de/System.Runtime.InteropServices.xml", "ref/dotnet/es/System.Runtime.InteropServices.xml", "ref/dotnet/fr/System.Runtime.InteropServices.xml", @@ -931,12 +981,24 @@ "ref/dotnet/zh-hant/System.Runtime.InteropServices.xml", "ref/MonoAndroid10/_._", "ref/MonoTouch10/_._", - "ref/net46/_._", + "ref/net451/_._", + "ref/netcore50/de/System.Runtime.InteropServices.xml", + "ref/netcore50/es/System.Runtime.InteropServices.xml", + "ref/netcore50/fr/System.Runtime.InteropServices.xml", + "ref/netcore50/it/System.Runtime.InteropServices.xml", + "ref/netcore50/ja/System.Runtime.InteropServices.xml", + "ref/netcore50/ko/System.Runtime.InteropServices.xml", + "ref/netcore50/ru/System.Runtime.InteropServices.xml", + "ref/netcore50/System.Runtime.InteropServices.dll", + "ref/netcore50/System.Runtime.InteropServices.xml", + "ref/netcore50/zh-hans/System.Runtime.InteropServices.xml", + "ref/netcore50/zh-hant/System.Runtime.InteropServices.xml", + "ref/win81/_._", + "ref/wpa81/_._", "ref/xamarinios10/_._", "ref/xamarinmac20/_._", - "runtimes/win8-aot/lib/netcore50/System.Runtime.InteropServices.dll", - "System.Runtime.InteropServices.4.0.20.nupkg", - "System.Runtime.InteropServices.4.0.20.nupkg.sha512", + "System.Runtime.InteropServices.4.0.10-beta-23127.nupkg", + "System.Runtime.InteropServices.4.0.10-beta-23127.nupkg.sha512", "System.Runtime.InteropServices.nuspec" ] }, @@ -1175,8 +1237,9 @@ "": [ "System.Console >= 4.0.0-beta-*", "System.Runtime >= 4.0.20-beta-*", - "System.Runtime.Extensions >= 4.0.10-beta-*" + "System.Runtime.Extensions >= 4.0.10-beta-*", + "System.Runtime.InteropServices >= 4.0.10-beta-*" ], "DNXCore,Version=v5.0": [] } -} \ No newline at end of file +} diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.cs new file mode 100644 index 0000000..055705e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((char)o, Helper.Create(default(char))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((char?)o, Helper.Create(default(char))); + } + + private static int Main() + { + char? s = Helper.Create(default(char)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.csproj new file mode 100644 index 0000000..e66bc7e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.cs new file mode 100644 index 0000000..a32522e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of bool using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((bool)o, Helper.Create(default(bool))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((bool?)o, Helper.Create(default(bool))); + } + + private static int Main() + { + bool? s = Helper.Create(default(bool)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.csproj new file mode 100644 index 0000000..0c13b89 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.cs new file mode 100644 index 0000000..11590f7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((byte)o, Helper.Create(default(byte))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((byte?)o, Helper.Create(default(byte))); + } + + private static int Main() + { + byte? s = Helper.Create(default(byte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.csproj new file mode 100644 index 0000000..51c1291 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.cs new file mode 100644 index 0000000..1154810 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of sbyte using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((sbyte)o, Helper.Create(default(sbyte))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((sbyte?)o, Helper.Create(default(sbyte))); + } + + private static int Main() + { + sbyte? s = Helper.Create(default(sbyte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.csproj new file mode 100644 index 0000000..fbded76 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.cs new file mode 100644 index 0000000..09b7739 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((short)o, Helper.Create(default(short))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((short?)o, Helper.Create(default(short))); + } + + private static int Main() + { + short? s = Helper.Create(default(short)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.csproj new file mode 100644 index 0000000..f197b5e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.cs new file mode 100644 index 0000000..1da64c5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ushort using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ushort)o, Helper.Create(default(ushort))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ushort?)o, Helper.Create(default(ushort))); + } + + private static int Main() + { + ushort? s = Helper.Create(default(ushort)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.csproj new file mode 100644 index 0000000..895c6ae --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.cs new file mode 100644 index 0000000..80fc537 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((int)o, Helper.Create(default(int))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((int?)o, Helper.Create(default(int))); + } + + private static int Main() + { + int? s = Helper.Create(default(int)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.csproj new file mode 100644 index 0000000..7dac143 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.cs new file mode 100644 index 0000000..e82794f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of uint using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((uint)o, Helper.Create(default(uint))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((uint?)o, Helper.Create(default(uint))); + } + + private static int Main() + { + uint? s = Helper.Create(default(uint)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.csproj new file mode 100644 index 0000000..d59906b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.cs new file mode 100644 index 0000000..e1b80e5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((long)o, Helper.Create(default(long))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((long?)o, Helper.Create(default(long))); + } + + private static int Main() + { + long? s = Helper.Create(default(long)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.csproj new file mode 100644 index 0000000..24a5a70 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.cs new file mode 100644 index 0000000..5b39240 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ulong using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ulong)o, Helper.Create(default(ulong))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ulong?)o, Helper.Create(default(ulong))); + } + + private static int Main() + { + ulong? s = Helper.Create(default(ulong)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.csproj new file mode 100644 index 0000000..39ac6a2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.cs new file mode 100644 index 0000000..2df4d0b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((float)o, Helper.Create(default(float))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((float?)o, Helper.Create(default(float))); + } + + private static int Main() + { + float? s = Helper.Create(default(float)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.csproj new file mode 100644 index 0000000..bec7e50 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.cs new file mode 100644 index 0000000..a4c916f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of double using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((double)o, Helper.Create(default(double))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((double?)o, Helper.Create(default(double))); + } + + private static int Main() + { + double? s = Helper.Create(default(double)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.csproj new file mode 100644 index 0000000..c639f9c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.cs new file mode 100644 index 0000000..9f796a7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((decimal)o, Helper.Create(default(decimal))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((decimal?)o, Helper.Create(default(decimal))); + } + + private static int Main() + { + decimal? s = Helper.Create(default(decimal)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.csproj new file mode 100644 index 0000000..b0ff6da --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.cs new file mode 100644 index 0000000..5e3fa61 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of IntPtr using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((IntPtr)o, Helper.Create(default(IntPtr))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((IntPtr?)o, Helper.Create(default(IntPtr))); + } + + private static int Main() + { + IntPtr? s = Helper.Create(default(IntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.csproj new file mode 100644 index 0000000..bfb2637 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.cs new file mode 100644 index 0000000..db4bd57 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((UIntPtr)o, Helper.Create(default(UIntPtr))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((UIntPtr?)o, Helper.Create(default(UIntPtr))); + } + + private static int Main() + { + UIntPtr? s = Helper.Create(default(UIntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.csproj new file mode 100644 index 0000000..987c0d7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.cs new file mode 100644 index 0000000..c390bb2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of Guid using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((Guid)o, Helper.Create(default(Guid))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((Guid?)o, Helper.Create(default(Guid))); + } + + private static int Main() + { + Guid? s = Helper.Create(default(Guid)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.csproj new file mode 100644 index 0000000..d4ec66f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.cs new file mode 100644 index 0000000..e7f17e0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((GCHandle)o, Helper.Create(default(GCHandle))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((GCHandle?)o, Helper.Create(default(GCHandle))); + } + + private static int Main() + { + GCHandle? s = Helper.Create(default(GCHandle)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.csproj new file mode 100644 index 0000000..e742ab2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.cs new file mode 100644 index 0000000..8864362 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ByteE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ByteE)o, Helper.Create(default(ByteE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ByteE?)o, Helper.Create(default(ByteE))); + } + + private static int Main() + { + ByteE? s = Helper.Create(default(ByteE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.csproj new file mode 100644 index 0000000..e7aebbd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.cs new file mode 100644 index 0000000..cbbf89d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((IntE)o, Helper.Create(default(IntE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((IntE?)o, Helper.Create(default(IntE))); + } + + private static int Main() + { + IntE? s = Helper.Create(default(IntE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.csproj new file mode 100644 index 0000000..57f5aac --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.cs new file mode 100644 index 0000000..37f29ef --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of LongE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((LongE)o, Helper.Create(default(LongE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((LongE?)o, Helper.Create(default(LongE))); + } + + private static int Main() + { + LongE? s = Helper.Create(default(LongE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.csproj new file mode 100644 index 0000000..547b661 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.cs new file mode 100644 index 0000000..9e16e6e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((EmptyStruct)o, Helper.Create(default(EmptyStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((EmptyStruct?)o, Helper.Create(default(EmptyStruct))); + } + + private static int Main() + { + EmptyStruct? s = Helper.Create(default(EmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.csproj new file mode 100644 index 0000000..e6e986f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.cs new file mode 100644 index 0000000..4d3398b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStruct)o, Helper.Create(default(NotEmptyStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStruct?)o, Helper.Create(default(NotEmptyStruct))); + } + + private static int Main() + { + NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.csproj new file mode 100644 index 0000000..5751686 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.cs new file mode 100644 index 0000000..27f1b38 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructQ)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructQ?)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static int Main() + { + NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.csproj new file mode 100644 index 0000000..d0c7523 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.cs new file mode 100644 index 0000000..830295f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructA)o, Helper.Create(default(NotEmptyStructA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructA?)o, Helper.Create(default(NotEmptyStructA))); + } + + private static int Main() + { + NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.csproj new file mode 100644 index 0000000..4ec7403 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.cs new file mode 100644 index 0000000..85aa2a2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructQA)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructQA?)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static int Main() + { + NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.csproj new file mode 100644 index 0000000..821bda5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.cs new file mode 100644 index 0000000..23e9f84 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of EmptyStructGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((EmptyStructGen)o, Helper.Create(default(EmptyStructGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((EmptyStructGen?)o, Helper.Create(default(EmptyStructGen))); + } + + private static int Main() + { + EmptyStructGen? s = Helper.Create(default(EmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.csproj new file mode 100644 index 0000000..19e4584 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.cs new file mode 100644 index 0000000..0b079fe --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructGen)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructGen?)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static int Main() + { + NotEmptyStructGen? s = Helper.Create(default(NotEmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.csproj new file mode 100644 index 0000000..f1db4b7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.cs new file mode 100644 index 0000000..4dfb786 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGen)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGen?)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static int Main() + { + NotEmptyStructConstrainedGen? s = Helper.Create(default(NotEmptyStructConstrainedGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.csproj new file mode 100644 index 0000000..19ee778 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.cs new file mode 100644 index 0000000..18da1ef --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA?)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenA? s = Helper.Create(default(NotEmptyStructConstrainedGenA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.csproj new file mode 100644 index 0000000..e0a761a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.cs new file mode 100644 index 0000000..7ac1ec1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGenQ using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ?)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQ? s = Helper.Create(default(NotEmptyStructConstrainedGenQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.csproj new file mode 100644 index 0000000..5332b8f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.cs new file mode 100644 index 0000000..03b00fc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA?)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQA? s = Helper.Create(default(NotEmptyStructConstrainedGenQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.csproj new file mode 100644 index 0000000..6c15fe3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.cs new file mode 100644 index 0000000..e09d68e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NestedStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NestedStruct)o, Helper.Create(default(NestedStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NestedStruct?)o, Helper.Create(default(NestedStruct))); + } + + private static int Main() + { + NestedStruct? s = Helper.Create(default(NestedStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.csproj new file mode 100644 index 0000000..a62be05 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.cs new file mode 100644 index 0000000..ec46775 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NestedStructGen)o, Helper.Create(default(NestedStructGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NestedStructGen?)o, Helper.Create(default(NestedStructGen))); + } + + private static int Main() + { + NestedStructGen? s = Helper.Create(default(NestedStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.csproj new file mode 100644 index 0000000..519edd3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.cs new file mode 100644 index 0000000..53a3c2c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ExplicitFieldOffsetStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ExplicitFieldOffsetStruct)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ExplicitFieldOffsetStruct?)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static int Main() + { + ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.csproj new file mode 100644 index 0000000..4318dd4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.cs new file mode 100644 index 0000000..c55582e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((MarshalAsStruct)o, Helper.Create(default(MarshalAsStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((MarshalAsStruct?)o, Helper.Create(default(MarshalAsStruct))); + } + + private static int Main() + { + MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.csproj new file mode 100644 index 0000000..bd6fe46 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.cs new file mode 100644 index 0000000..7297206 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementOneInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementOneInterface)o, Helper.Create(default(ImplementOneInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementOneInterface?)o, Helper.Create(default(ImplementOneInterface))); + } + + private static int Main() + { + ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.csproj new file mode 100644 index 0000000..2b85284 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.cs new file mode 100644 index 0000000..6f409f7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementTwoInterface)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementTwoInterface?)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static int Main() + { + ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.csproj new file mode 100644 index 0000000..f2c72e2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.cs new file mode 100644 index 0000000..58984d1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementOneInterfaceGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementOneInterfaceGen)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementOneInterfaceGen?)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static int Main() + { + ImplementOneInterfaceGen? s = Helper.Create(default(ImplementOneInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.csproj new file mode 100644 index 0000000..23ccd4c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.cs new file mode 100644 index 0000000..aaa93d1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementTwoInterfaceGen)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementTwoInterfaceGen?)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = Helper.Create(default(ImplementTwoInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.csproj new file mode 100644 index 0000000..881db12 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.cs new file mode 100644 index 0000000..dab1a0a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementAllInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementAllInterface)o, Helper.Create(default(ImplementAllInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementAllInterface?)o, Helper.Create(default(ImplementAllInterface))); + } + + private static int Main() + { + ImplementAllInterface? s = Helper.Create(default(ImplementAllInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.csproj new file mode 100644 index 0000000..f7dd626 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.cs new file mode 100644 index 0000000..3e02d8a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((WithMultipleGCHandleStruct)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((WithMultipleGCHandleStruct?)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static int Main() + { + WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.csproj new file mode 100644 index 0000000..e326f20 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.cs new file mode 100644 index 0000000..d1d8067 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of WithOnlyFXTypeStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((WithOnlyFXTypeStruct)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((WithOnlyFXTypeStruct?)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static int Main() + { + WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.csproj new file mode 100644 index 0000000..3a7928e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.cs new file mode 100644 index 0000000..b1a403a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((MixedAllStruct)o, Helper.Create(default(MixedAllStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((MixedAllStruct?)o, Helper.Create(default(MixedAllStruct))); + } + + private static int Main() + { + MixedAllStruct? s = Helper.Create(default(MixedAllStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.csproj new file mode 100644 index 0000000..de5533e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.cs new file mode 100644 index 0000000..30fa5b6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of IntE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(Enum o) + { + return Helper.Compare((IntE)o, Helper.Create(default(IntE))); + } + + private static bool BoxUnboxToQ(Enum o) + { + return Helper.Compare((IntE?)o, Helper.Create(default(IntE))); + } + + private static int Main() + { + IntE? s = Helper.Create(default(IntE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.csproj new file mode 100644 index 0000000..da35c58 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.cs new file mode 100644 index 0000000..f089934 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(Enum o) + { + return Helper.Compare((ByteE)o, Helper.Create(default(ByteE))); + } + + private static bool BoxUnboxToQ(Enum o) + { + return Helper.Compare((ByteE?)o, Helper.Create(default(ByteE))); + } + + private static int Main() + { + ByteE? s = Helper.Create(default(ByteE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.csproj new file mode 100644 index 0000000..2158e0d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.cs new file mode 100644 index 0000000..bd5748e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of LongE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(Enum o) + { + return Helper.Compare((LongE)o, Helper.Create(default(LongE))); + } + + private static bool BoxUnboxToQ(Enum o) + { + return Helper.Compare((LongE?)o, Helper.Create(default(LongE))); + } + + private static int Main() + { + LongE? s = Helper.Create(default(LongE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.csproj new file mode 100644 index 0000000..22fccce --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.cs new file mode 100644 index 0000000..ab353a5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((char)(object)o, Helper.Create(default(char))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((char?)(object)o, Helper.Create(default(char))); + } + + private static int Main() + { + char? s = Helper.Create(default(char)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.csproj new file mode 100644 index 0000000..c9bc47b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.cs new file mode 100644 index 0000000..4f7a5fc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of bool using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((bool)(object)o, Helper.Create(default(bool))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((bool?)(object)o, Helper.Create(default(bool))); + } + + private static int Main() + { + bool? s = Helper.Create(default(bool)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.csproj new file mode 100644 index 0000000..8df3dd5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.cs new file mode 100644 index 0000000..f7f3792 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((byte)(object)o, Helper.Create(default(byte))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((byte?)(object)o, Helper.Create(default(byte))); + } + + private static int Main() + { + byte? s = Helper.Create(default(byte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.csproj new file mode 100644 index 0000000..f68e841 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.cs new file mode 100644 index 0000000..4cd6963 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of sbyte using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((sbyte)(object)o, Helper.Create(default(sbyte))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((sbyte?)(object)o, Helper.Create(default(sbyte))); + } + + private static int Main() + { + sbyte? s = Helper.Create(default(sbyte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.csproj new file mode 100644 index 0000000..159a1d0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.cs new file mode 100644 index 0000000..d287dd2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((short)(object)o, Helper.Create(default(short))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((short?)(object)o, Helper.Create(default(short))); + } + + private static int Main() + { + short? s = Helper.Create(default(short)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.csproj new file mode 100644 index 0000000..14ab9bd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.cs new file mode 100644 index 0000000..c01ad7a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ushort using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ushort)(object)o, Helper.Create(default(ushort))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ushort?)(object)o, Helper.Create(default(ushort))); + } + + private static int Main() + { + ushort? s = Helper.Create(default(ushort)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.csproj new file mode 100644 index 0000000..364517b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.cs new file mode 100644 index 0000000..0bd8434 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((int)(object)o, Helper.Create(default(int))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((int?)(object)o, Helper.Create(default(int))); + } + + private static int Main() + { + int? s = Helper.Create(default(int)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.csproj new file mode 100644 index 0000000..8ae3fc1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.cs new file mode 100644 index 0000000..677de33 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of uint using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((uint)(object)o, Helper.Create(default(uint))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((uint?)(object)o, Helper.Create(default(uint))); + } + + private static int Main() + { + uint? s = Helper.Create(default(uint)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.csproj new file mode 100644 index 0000000..f7e2878 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.cs new file mode 100644 index 0000000..f0a0926 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((long)(object)o, Helper.Create(default(long))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((long?)(object)o, Helper.Create(default(long))); + } + + private static int Main() + { + long? s = Helper.Create(default(long)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.csproj new file mode 100644 index 0000000..ed00f69 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.cs new file mode 100644 index 0000000..f959d29 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ulong using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ulong)(object)o, Helper.Create(default(ulong))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ulong?)(object)o, Helper.Create(default(ulong))); + } + + private static int Main() + { + ulong? s = Helper.Create(default(ulong)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.csproj new file mode 100644 index 0000000..42b8eb5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.cs new file mode 100644 index 0000000..cbf4660 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((float)(object)o, Helper.Create(default(float))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((float?)(object)o, Helper.Create(default(float))); + } + + private static int Main() + { + float? s = Helper.Create(default(float)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.csproj new file mode 100644 index 0000000..e334cc6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.cs new file mode 100644 index 0000000..4416220 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of double using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((double)(object)o, Helper.Create(default(double))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((double?)(object)o, Helper.Create(default(double))); + } + + private static int Main() + { + double? s = Helper.Create(default(double)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.csproj new file mode 100644 index 0000000..23218f6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.cs new file mode 100644 index 0000000..1e6449e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((decimal)(object)o, Helper.Create(default(decimal))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((decimal?)(object)o, Helper.Create(default(decimal))); + } + + private static int Main() + { + decimal? s = Helper.Create(default(decimal)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.csproj new file mode 100644 index 0000000..41b944a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.cs new file mode 100644 index 0000000..b74e74d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of IntPtr using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((IntPtr)(object)o, Helper.Create(default(IntPtr))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((IntPtr?)(object)o, Helper.Create(default(IntPtr))); + } + + private static int Main() + { + IntPtr? s = Helper.Create(default(IntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.csproj new file mode 100644 index 0000000..6d2e397 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.cs new file mode 100644 index 0000000..fc0d793 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((UIntPtr)(object)o, Helper.Create(default(UIntPtr))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((UIntPtr?)(object)o, Helper.Create(default(UIntPtr))); + } + + private static int Main() + { + UIntPtr? s = Helper.Create(default(UIntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.csproj new file mode 100644 index 0000000..29be0ad --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.cs new file mode 100644 index 0000000..10e0c03 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of Guid using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((Guid)(object)o, Helper.Create(default(Guid))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((Guid?)(object)o, Helper.Create(default(Guid))); + } + + private static int Main() + { + Guid? s = Helper.Create(default(Guid)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.csproj new file mode 100644 index 0000000..d2c5931 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.cs new file mode 100644 index 0000000..85cabc5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((GCHandle)(object)o, Helper.Create(default(GCHandle))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((GCHandle?)(object)o, Helper.Create(default(GCHandle))); + } + + private static int Main() + { + GCHandle? s = Helper.Create(default(GCHandle)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.csproj new file mode 100644 index 0000000..abc935c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.cs new file mode 100644 index 0000000..bef3b25 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ByteE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ByteE)(object)o, Helper.Create(default(ByteE))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ByteE?)(object)o, Helper.Create(default(ByteE))); + } + + private static int Main() + { + ByteE? s = Helper.Create(default(ByteE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.csproj new file mode 100644 index 0000000..41aa64b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.cs new file mode 100644 index 0000000..c0b21de --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((IntE)(object)o, Helper.Create(default(IntE))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((IntE?)(object)o, Helper.Create(default(IntE))); + } + + private static int Main() + { + IntE? s = Helper.Create(default(IntE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.csproj new file mode 100644 index 0000000..8a173b6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.cs new file mode 100644 index 0000000..86bad94 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of LongE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((LongE)(object)o, Helper.Create(default(LongE))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((LongE?)(object)o, Helper.Create(default(LongE))); + } + + private static int Main() + { + LongE? s = Helper.Create(default(LongE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.csproj new file mode 100644 index 0000000..246482a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.cs new file mode 100644 index 0000000..08693ed --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((EmptyStruct)(object)o, Helper.Create(default(EmptyStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((EmptyStruct?)(object)o, Helper.Create(default(EmptyStruct))); + } + + private static int Main() + { + EmptyStruct? s = Helper.Create(default(EmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.csproj new file mode 100644 index 0000000..d7bcc4e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.cs new file mode 100644 index 0000000..c8619cd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStruct)(object)o, Helper.Create(default(NotEmptyStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStruct?)(object)o, Helper.Create(default(NotEmptyStruct))); + } + + private static int Main() + { + NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.csproj new file mode 100644 index 0000000..888a86e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.cs new file mode 100644 index 0000000..958783f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructQ)(object)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructQ?)(object)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static int Main() + { + NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.csproj new file mode 100644 index 0000000..af1a4e0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.cs new file mode 100644 index 0000000..4cb2bce --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructA)(object)o, Helper.Create(default(NotEmptyStructA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructA?)(object)o, Helper.Create(default(NotEmptyStructA))); + } + + private static int Main() + { + NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.csproj new file mode 100644 index 0000000..7dd245c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.cs new file mode 100644 index 0000000..122a594 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructQA)(object)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructQA?)(object)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static int Main() + { + NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.csproj new file mode 100644 index 0000000..30b8826 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.cs new file mode 100644 index 0000000..b456f9c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of EmptyStructGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((EmptyStructGen)(object)o, Helper.Create(default(EmptyStructGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((EmptyStructGen?)(object)o, Helper.Create(default(EmptyStructGen))); + } + + private static int Main() + { + EmptyStructGen? s = Helper.Create(default(EmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.csproj new file mode 100644 index 0000000..3d5b4c2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.cs new file mode 100644 index 0000000..422b064 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructGen)(object)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructGen?)(object)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static int Main() + { + NotEmptyStructGen? s = Helper.Create(default(NotEmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.csproj new file mode 100644 index 0000000..e439a37 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.cs new file mode 100644 index 0000000..e85f1a3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGen)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGen?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static int Main() + { + NotEmptyStructConstrainedGen? s = Helper.Create(default(NotEmptyStructConstrainedGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.csproj new file mode 100644 index 0000000..36a3876 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.cs new file mode 100644 index 0000000..9daba67 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenA? s = Helper.Create(default(NotEmptyStructConstrainedGenA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.csproj new file mode 100644 index 0000000..0c50406 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.cs new file mode 100644 index 0000000..c904e82 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGenQ using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQ? s = Helper.Create(default(NotEmptyStructConstrainedGenQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.csproj new file mode 100644 index 0000000..35cd6a9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.cs new file mode 100644 index 0000000..5863835 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQA? s = Helper.Create(default(NotEmptyStructConstrainedGenQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.csproj new file mode 100644 index 0000000..45af06d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.cs new file mode 100644 index 0000000..da43073 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NestedStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NestedStruct)(object)o, Helper.Create(default(NestedStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NestedStruct?)(object)o, Helper.Create(default(NestedStruct))); + } + + private static int Main() + { + NestedStruct? s = Helper.Create(default(NestedStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.csproj new file mode 100644 index 0000000..398f8be --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.cs new file mode 100644 index 0000000..5eb0c41 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NestedStructGen)(object)o, Helper.Create(default(NestedStructGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NestedStructGen?)(object)o, Helper.Create(default(NestedStructGen))); + } + + private static int Main() + { + NestedStructGen? s = Helper.Create(default(NestedStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.csproj new file mode 100644 index 0000000..bb8b1a2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.cs new file mode 100644 index 0000000..0609d96 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ExplicitFieldOffsetStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ExplicitFieldOffsetStruct)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ExplicitFieldOffsetStruct?)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static int Main() + { + ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.csproj new file mode 100644 index 0000000..6bb3f61 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.cs new file mode 100644 index 0000000..31e96cc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((MarshalAsStruct)(object)o, Helper.Create(default(MarshalAsStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((MarshalAsStruct?)(object)o, Helper.Create(default(MarshalAsStruct))); + } + + private static int Main() + { + MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.csproj new file mode 100644 index 0000000..83f4784 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.cs new file mode 100644 index 0000000..c032132 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementOneInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementOneInterface)(object)o, Helper.Create(default(ImplementOneInterface))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementOneInterface?)(object)o, Helper.Create(default(ImplementOneInterface))); + } + + private static int Main() + { + ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.csproj new file mode 100644 index 0000000..0d46f5f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.cs new file mode 100644 index 0000000..a05b110 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementTwoInterface)(object)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementTwoInterface?)(object)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static int Main() + { + ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.csproj new file mode 100644 index 0000000..eb80698 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.cs new file mode 100644 index 0000000..7c2fcfc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementOneInterfaceGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementOneInterfaceGen)(object)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementOneInterfaceGen?)(object)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static int Main() + { + ImplementOneInterfaceGen? s = Helper.Create(default(ImplementOneInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.csproj new file mode 100644 index 0000000..bd85395 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.cs new file mode 100644 index 0000000..535a0bd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementTwoInterfaceGen)(object)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementTwoInterfaceGen?)(object)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = Helper.Create(default(ImplementTwoInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.csproj new file mode 100644 index 0000000..11128cd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.cs new file mode 100644 index 0000000..b19d98d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementAllInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementAllInterface)(object)o, Helper.Create(default(ImplementAllInterface))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementAllInterface?)(object)o, Helper.Create(default(ImplementAllInterface))); + } + + private static int Main() + { + ImplementAllInterface? s = Helper.Create(default(ImplementAllInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.csproj new file mode 100644 index 0000000..89673fb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.cs new file mode 100644 index 0000000..8f34549 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((WithMultipleGCHandleStruct)(object)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((WithMultipleGCHandleStruct?)(object)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static int Main() + { + WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.csproj new file mode 100644 index 0000000..82144e6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.cs new file mode 100644 index 0000000..9fa84b4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of WithOnlyFXTypeStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((WithOnlyFXTypeStruct)(object)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((WithOnlyFXTypeStruct?)(object)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static int Main() + { + WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.csproj new file mode 100644 index 0000000..57d44d9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.cs new file mode 100644 index 0000000..ef35b7e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((MixedAllStruct)(object)o, Helper.Create(default(MixedAllStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((MixedAllStruct?)(object)o, Helper.Create(default(MixedAllStruct))); + } + + private static int Main() + { + MixedAllStruct? s = Helper.Create(default(MixedAllStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.csproj new file mode 100644 index 0000000..9db3f9a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.cs new file mode 100644 index 0000000..3bdeaf2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementOneInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IEmpty o) + { + return Helper.Compare((ImplementOneInterface)o, Helper.Create(default(ImplementOneInterface))); + } + + private static bool BoxUnboxToQ(IEmpty o) + { + return Helper.Compare((ImplementOneInterface?)o, Helper.Create(default(ImplementOneInterface))); + } + + private static int Main() + { + ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.csproj new file mode 100644 index 0000000..aeb1b77 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.cs new file mode 100644 index 0000000..4e77831 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IEmpty o) + { + return Helper.Compare((ImplementTwoInterface)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static bool BoxUnboxToQ(IEmpty o) + { + return Helper.Compare((ImplementTwoInterface?)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static int Main() + { + ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.csproj new file mode 100644 index 0000000..2fcd0f1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.cs new file mode 100644 index 0000000..dcad64d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementOneInterfaceGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IEmptyGen o) + { + return Helper.Compare((ImplementOneInterfaceGen)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static bool BoxUnboxToQ(IEmptyGen o) + { + return Helper.Compare((ImplementOneInterfaceGen?)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static int Main() + { + ImplementOneInterfaceGen? s = Helper.Create(default(ImplementOneInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.csproj new file mode 100644 index 0000000..90f1587 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.cs new file mode 100644 index 0000000..46bec2b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IEmptyGen o) + { + return Helper.Compare((ImplementTwoInterfaceGen)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static bool BoxUnboxToQ(IEmptyGen o) + { + return Helper.Compare((ImplementTwoInterfaceGen?)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = Helper.Create(default(ImplementTwoInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.csproj new file mode 100644 index 0000000..c3c2b1b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.cs new file mode 100644 index 0000000..27d813b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementAllInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IEmpty o) + { + return Helper.Compare((ImplementAllInterface)o, Helper.Create(default(ImplementAllInterface))); + } + + private static bool BoxUnboxToQ(IEmpty o) + { + return Helper.Compare((ImplementAllInterface?)o, Helper.Create(default(ImplementAllInterface))); + } + + private static int Main() + { + ImplementAllInterface? s = Helper.Create(default(ImplementAllInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.csproj new file mode 100644 index 0000000..99cb715 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.cs new file mode 100644 index 0000000..e542b8f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((char)o, Helper.Create(default(char))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((char?)o, Helper.Create(default(char))); + } + + private static int Main() + { + char? s = Helper.Create(default(char)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.csproj new file mode 100644 index 0000000..89d39a4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.cs new file mode 100644 index 0000000..f962e53 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of bool using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((bool)o, Helper.Create(default(bool))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((bool?)o, Helper.Create(default(bool))); + } + + private static int Main() + { + bool? s = Helper.Create(default(bool)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.csproj new file mode 100644 index 0000000..d7d5b8a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.cs new file mode 100644 index 0000000..8973986 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((byte)o, Helper.Create(default(byte))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((byte?)o, Helper.Create(default(byte))); + } + + private static int Main() + { + byte? s = Helper.Create(default(byte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.csproj new file mode 100644 index 0000000..0602110 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.cs new file mode 100644 index 0000000..dcfc384 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of sbyte using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((sbyte)o, Helper.Create(default(sbyte))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((sbyte?)o, Helper.Create(default(sbyte))); + } + + private static int Main() + { + sbyte? s = Helper.Create(default(sbyte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.csproj new file mode 100644 index 0000000..e6e697f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs new file mode 100644 index 0000000..1ec8e9f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((short)o, Helper.Create(default(short))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((short?)o, Helper.Create(default(short))); + } + + private static int Main() + { + short? s = Helper.Create(default(short)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.csproj new file mode 100644 index 0000000..fd6d193 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.cs new file mode 100644 index 0000000..e06543c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ushort using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((ushort)o, Helper.Create(default(ushort))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((ushort?)o, Helper.Create(default(ushort))); + } + + private static int Main() + { + ushort? s = Helper.Create(default(ushort)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.csproj new file mode 100644 index 0000000..4ecd201 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.cs new file mode 100644 index 0000000..58bdc7a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((int)o, Helper.Create(default(int))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((int?)o, Helper.Create(default(int))); + } + + private static int Main() + { + int? s = Helper.Create(default(int)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.csproj new file mode 100644 index 0000000..dc86bc3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.cs new file mode 100644 index 0000000..e39229d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of uint using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((uint)o, Helper.Create(default(uint))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((uint?)o, Helper.Create(default(uint))); + } + + private static int Main() + { + uint? s = Helper.Create(default(uint)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.csproj new file mode 100644 index 0000000..a44fac8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.cs new file mode 100644 index 0000000..2221517 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((long)o, Helper.Create(default(long))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((long?)o, Helper.Create(default(long))); + } + + private static int Main() + { + long? s = Helper.Create(default(long)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.csproj new file mode 100644 index 0000000..6568ac8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.cs new file mode 100644 index 0000000..d799174 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ulong using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((ulong)o, Helper.Create(default(ulong))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((ulong?)o, Helper.Create(default(ulong))); + } + + private static int Main() + { + ulong? s = Helper.Create(default(ulong)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.csproj new file mode 100644 index 0000000..b94ba5f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.cs new file mode 100644 index 0000000..f417010 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((float)o, Helper.Create(default(float))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((float?)o, Helper.Create(default(float))); + } + + private static int Main() + { + float? s = Helper.Create(default(float)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.csproj new file mode 100644 index 0000000..23198be --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.cs new file mode 100644 index 0000000..ccc826b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of double using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((double)o, Helper.Create(default(double))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((double?)o, Helper.Create(default(double))); + } + + private static int Main() + { + double? s = Helper.Create(default(double)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.csproj new file mode 100644 index 0000000..1cd2e37 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.cs new file mode 100644 index 0000000..2152a41 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(IComparable o) + { + return Helper.Compare((decimal)o, Helper.Create(default(decimal))); + } + + private static bool BoxUnboxToQ(IComparable o) + { + return Helper.Compare((decimal?)o, Helper.Create(default(decimal))); + } + + private static int Main() + { + decimal? s = Helper.Create(default(decimal)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.csproj new file mode 100644 index 0000000..0fbff9b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.cs new file mode 100644 index 0000000..7b5640a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of char using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((char?)o) == null; + } + + private static int Main() + { + char? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.csproj new file mode 100644 index 0000000..08b70a8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.cs new file mode 100644 index 0000000..25b3b71 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((bool?)o) == null; + } + + private static int Main() + { + bool? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.csproj new file mode 100644 index 0000000..7015f89 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.cs new file mode 100644 index 0000000..c01bcfb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of byte using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((byte?)o) == null; + } + + private static int Main() + { + byte? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.csproj new file mode 100644 index 0000000..01b7975 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.cs new file mode 100644 index 0000000..20d618f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((sbyte?)o) == null; + } + + private static int Main() + { + sbyte? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.csproj new file mode 100644 index 0000000..51a247f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.cs new file mode 100644 index 0000000..a23538e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of short using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((short?)o) == null; + } + + private static int Main() + { + short? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.csproj new file mode 100644 index 0000000..34e9ff1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.cs new file mode 100644 index 0000000..c48103d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ushort?)o) == null; + } + + private static int Main() + { + ushort? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.csproj new file mode 100644 index 0000000..4d60875 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.cs new file mode 100644 index 0000000..2935d91 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of int using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((int?)o) == null; + } + + private static int Main() + { + int? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.csproj new file mode 100644 index 0000000..28c7d56 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.cs new file mode 100644 index 0000000..1980350 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((uint?)o) == null; + } + + private static int Main() + { + uint? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.csproj new file mode 100644 index 0000000..c0aa858 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.cs new file mode 100644 index 0000000..966f0b1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of long using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((long?)o) == null; + } + + private static int Main() + { + long? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.csproj new file mode 100644 index 0000000..5c5269d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.cs new file mode 100644 index 0000000..8be0349 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ulong?)o) == null; + } + + private static int Main() + { + ulong? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.csproj new file mode 100644 index 0000000..f9da5c7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.cs new file mode 100644 index 0000000..64fdd76 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of float using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((float?)o) == null; + } + + private static int Main() + { + float? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.csproj new file mode 100644 index 0000000..edcca66 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.cs new file mode 100644 index 0000000..8de79d9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((double?)o) == null; + } + + private static int Main() + { + double? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.csproj new file mode 100644 index 0000000..9cb9c2a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.cs new file mode 100644 index 0000000..21fe428 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of decimal using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((decimal?)o) == null; + } + + private static int Main() + { + decimal? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.csproj new file mode 100644 index 0000000..0b998f4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.cs new file mode 100644 index 0000000..b3fffdf --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((IntPtr?)o) == null; + } + + private static int Main() + { + IntPtr? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.csproj new file mode 100644 index 0000000..1b25624 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.cs new file mode 100644 index 0000000..9aa6923 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of UIntPtr using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((UIntPtr?)o) == null; + } + + private static int Main() + { + UIntPtr? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.csproj new file mode 100644 index 0000000..c471a87 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.cs new file mode 100644 index 0000000..b57e355 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((Guid?)o) == null; + } + + private static int Main() + { + Guid? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.csproj new file mode 100644 index 0000000..3084c44 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.cs new file mode 100644 index 0000000..7158b97 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of GCHandle using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((GCHandle?)o) == null; + } + + private static int Main() + { + GCHandle? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.csproj new file mode 100644 index 0000000..2b93489 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.cs new file mode 100644 index 0000000..e246757 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ByteE?)o) == null; + } + + private static int Main() + { + ByteE? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.csproj new file mode 100644 index 0000000..f0c01fb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.cs new file mode 100644 index 0000000..f8a60b8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of IntE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((IntE?)o) == null; + } + + private static int Main() + { + IntE? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.csproj new file mode 100644 index 0000000..eb69488 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.cs new file mode 100644 index 0000000..19f623d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((LongE?)o) == null; + } + + private static int Main() + { + LongE? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.csproj new file mode 100644 index 0000000..9c64824 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.cs new file mode 100644 index 0000000..4e7f496 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of EmptyStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((EmptyStruct?)o) == null; + } + + private static int Main() + { + EmptyStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.csproj new file mode 100644 index 0000000..2ca4c5f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.cs new file mode 100644 index 0000000..4da034e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStruct?)o) == null; + } + + private static int Main() + { + NotEmptyStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.csproj new file mode 100644 index 0000000..6fa2290 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.cs new file mode 100644 index 0000000..da3f017 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructQ using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructQ?)o) == null; + } + + private static int Main() + { + NotEmptyStructQ? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.csproj new file mode 100644 index 0000000..6ab6af0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.cs new file mode 100644 index 0000000..78a9736 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructA?)o) == null; + } + + private static int Main() + { + NotEmptyStructA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.csproj new file mode 100644 index 0000000..d85b324 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.cs new file mode 100644 index 0000000..413fcd7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructQA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructQA?)o) == null; + } + + private static int Main() + { + NotEmptyStructQA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.csproj new file mode 100644 index 0000000..3775e95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.cs new file mode 100644 index 0000000..ee90cdb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((EmptyStructGen?)o) == null; + } + + private static int Main() + { + EmptyStructGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.csproj new file mode 100644 index 0000000..af27a49 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.cs new file mode 100644 index 0000000..5af5df4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructGen?)o) == null; + } + + private static int Main() + { + NotEmptyStructGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.csproj new file mode 100644 index 0000000..faa3c60 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.cs new file mode 100644 index 0000000..1680934 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGen?)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.csproj new file mode 100644 index 0000000..3edd828 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.cs new file mode 100644 index 0000000..dcea3c1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGenA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGenA?)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGenA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.csproj new file mode 100644 index 0000000..56a479e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.cs new file mode 100644 index 0000000..c477ca4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGenQ?)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGenQ? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.csproj new file mode 100644 index 0000000..dbdedae --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.cs new file mode 100644 index 0000000..690109c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGenQA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGenQA?)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGenQA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.csproj new file mode 100644 index 0000000..0fbc1b0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.cs new file mode 100644 index 0000000..64063eb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NestedStruct?)o) == null; + } + + private static int Main() + { + NestedStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.csproj new file mode 100644 index 0000000..1877580 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.cs new file mode 100644 index 0000000..2702116 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NestedStructGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NestedStructGen?)o) == null; + } + + private static int Main() + { + NestedStructGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.csproj new file mode 100644 index 0000000..eec9f7c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.cs new file mode 100644 index 0000000..3d9a420 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ExplicitFieldOffsetStruct?)o) == null; + } + + private static int Main() + { + ExplicitFieldOffsetStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.csproj new file mode 100644 index 0000000..c089efa --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.cs new file mode 100644 index 0000000..b9a74df --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of MarshalAsStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((MarshalAsStruct?)o) == null; + } + + private static int Main() + { + MarshalAsStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.csproj new file mode 100644 index 0000000..464c981 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.cs new file mode 100644 index 0000000..19d8d7e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementOneInterface?)o) == null; + } + + private static int Main() + { + ImplementOneInterface? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.csproj new file mode 100644 index 0000000..249e81d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.cs new file mode 100644 index 0000000..7d8857f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementTwoInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementTwoInterface?)o) == null; + } + + private static int Main() + { + ImplementTwoInterface? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.csproj new file mode 100644 index 0000000..fc04dfb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.cs new file mode 100644 index 0000000..7ce67b5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementOneInterfaceGen?)o) == null; + } + + private static int Main() + { + ImplementOneInterfaceGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.csproj new file mode 100644 index 0000000..33537bf --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.cs new file mode 100644 index 0000000..1b26d30 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementTwoInterfaceGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementTwoInterfaceGen?)o) == null; + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.csproj new file mode 100644 index 0000000..6076f62 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.cs new file mode 100644 index 0000000..cd9663c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementAllInterface?)o) == null; + } + + private static int Main() + { + ImplementAllInterface? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.csproj new file mode 100644 index 0000000..58d3f1e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.cs new file mode 100644 index 0000000..f87daba --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of WithMultipleGCHandleStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((WithMultipleGCHandleStruct?)o) == null; + } + + private static int Main() + { + WithMultipleGCHandleStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.csproj new file mode 100644 index 0000000..bb4905c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.cs new file mode 100644 index 0000000..f7580d9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((WithOnlyFXTypeStruct?)o) == null; + } + + private static int Main() + { + WithOnlyFXTypeStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.csproj new file mode 100644 index 0000000..9d42784 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.cs new file mode 100644 index 0000000..a28dd4e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of MixedAllStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return o == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((MixedAllStruct?)o) == null; + } + + private static int Main() + { + MixedAllStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.csproj new file mode 100644 index 0000000..ab3f99b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/structdef.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/structdef.cs new file mode 100644 index 0000000..50eb1ce --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/structdef.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#pragma warning disable 0183 // The given expression is always of the provided ('X') type + +using System.Runtime.InteropServices; +using System; +//using Microsoft; +using System.ComponentModel; +// primitives / CLR Types + +// interfaces +public interface IEmpty { } +public interface INotEmpty +{ + void DoNothing(); +} + +// generic interfaces +public interface IEmptyGen { } +public interface INotEmptyGen +{ + void DoNothing(); +} + +// struct +public struct EmptyStruct { } +public struct NotEmptyStruct +{ + public int Field; +} + +public struct NotEmptyStructQ +{ + public int? Field; +} + +public struct NotEmptyStructA +{ + public int[] Field; +} + +public struct NotEmptyStructQA +{ + public int?[] Field; +} + +// generic structs +public struct EmptyStructGen { } +public struct NotEmptyStructGen +{ + public T Field; +} + +public struct NotEmptyStructConstrainedGen where T : struct +{ + public T Field; +} + +public struct NotEmptyStructConstrainedGenA where T : struct +{ + public T[] Field; +} + +public struct NotEmptyStructConstrainedGenQ where T : struct +{ + public T? Field; +} + +public struct NotEmptyStructConstrainedGenQA where T : struct +{ + public T?[] Field; +} + +// nested struct +public struct NestedStruct +{ + public struct Nested { } +} + +public struct NestedStructGen +{ + public struct Nested { } +} + + +// struct with Field Offset +[StructLayout(LayoutKind.Explicit)] +public struct ExplicitFieldOffsetStruct +{ + [FieldOffset(0)] + public int Field00; + [FieldOffset(0x0f)] + public int Field15; +} + +// struct with Attributes +internal struct MarshalAsStruct +{ + [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] + public string StringField; +} + +// struct implement interfaces +internal struct ImplementOneInterface : IEmpty { } + +internal struct ImplementTwoInterface : IEmpty, INotEmpty +{ + public void DoNothing() { } +} + +internal struct ImplementOneInterfaceGen : IEmptyGen { } + +internal struct ImplementTwoInterfaceGen : IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } +} + +internal struct ImplementAllInterface : IEmpty, INotEmpty, IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } + void INotEmptyGen.DoNothing() { } +} + +// enums +public enum IntE { start = 1, } +public enum ByteE : byte { start = 1, } +public enum LongE : long { start = 1, } + + +// other intersting structs +public struct WithMultipleGCHandleStruct +{ + public GCHandle H1; + public GCHandle H2; + public GCHandle H3; + public GCHandle H4; + public GCHandle H5; +} + +public struct WithOnlyFXTypeStruct +{ + public Guid GUID; + public decimal DECIMAL; +} + + +public struct MixedAllStruct +{ + public int INT; + public int? IntQ; + public int?[] IntQA; + public string STRING; + public IntE INTE; + public EmptyClass EMPTYCLASS; + public IEmpty IEMPTY; + public EmptyStruct EMPTYSTRUCT; + public IEmptyGen IEMPTYGEN; + public EmptyStructGen EMPTYSTRUCTGEN; + public WithOnlyFXTypeStruct WITHONLYFXTYPESTRUCT; + public GCHandle GCHANDLE; +} + + +// other types +public struct EmptyClass { } +public struct NotEmptyClass +{ + public int Field; +} + +public struct EmptyClassGen { } +public struct NotEmptyClassGen +{ + public T Field; +} + +public struct NotEmptyClassConstrainedGen where T : class +{ + public T Field; +} +public struct NestedClass +{ + public struct Nested { } +} + +public struct NestedClassGen +{ + public struct Nested { } +} + +internal class ImplementOneInterfaceC : IEmpty { } + +internal class ImplementTwoInterfaceC : IEmpty, INotEmpty +{ + public void DoNothing() { } +} + +internal class ImplementOneInterfaceGenC : IEmptyGen { } + +internal class ImplementTwoInterfaceGenC : IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } +} + +internal class ImplementAllInterfaceC : IEmpty, INotEmpty, IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } + void INotEmptyGen.DoNothing() { } +} + +public sealed class SealedClass { } + +public delegate void SimpleDelegate(); +public delegate void GenericDelegate(); + + +// ExitCode +public static class ExitCode +{ + public static int Failed = 101; + public static int Passed = 100; +} + + +// Create Value Instance +internal static class Helper +{ + public static GCHandle GCHANDLE; + static Helper() + { + GCHANDLE = GCHandle.Alloc(System.Console.Out); + } + + public static char Create(char val) { return 'c'; } + public static bool Create(bool val) { return true; } + public static byte Create(byte val) { return 0x08; } + public static sbyte Create(sbyte val) { return -0x0e; } + public static short Create(short val) { return -0x0f; } + public static ushort Create(ushort val) { return 0xff; } + public static int Create(int val) { return 100; } + public static uint Create(uint val) { return 200; } + public static long Create(long val) { return int.MaxValue; } + public static ulong Create(ulong val) { return 300; } + public static float Create(float val) { return 1.15f; } + public static double Create(double val) { return 0.05; } + public static decimal Create(decimal val) { return 1.0M; } + + public static IntPtr Create(IntPtr val) { return (IntPtr)1000; } + public static UIntPtr Create(UIntPtr val) { return (UIntPtr)2000; } + public static Guid Create(Guid val) { return new Guid("00020810-0001-0000-C000-000000000046"); } + public static GCHandle Create(GCHandle val) { return GCHANDLE; } + public static ByteE Create(ByteE val) { return (ByteE)9; } + public static IntE Create(IntE val) { return (IntE)55; } + public static LongE Create(LongE val) { return (LongE)34; } + public static EmptyStruct Create(EmptyStruct val) { return new EmptyStruct(); } + public static NotEmptyStruct Create(NotEmptyStruct val) { NotEmptyStruct ne = new NotEmptyStruct(); ne.Field = 100; return ne; } + public static NotEmptyStructQ Create(NotEmptyStructQ val) { NotEmptyStructQ neq = new NotEmptyStructQ(); neq.Field = 101; return neq; } + public static NotEmptyStructA Create(NotEmptyStructA val) { NotEmptyStructA nea = new NotEmptyStructA(); nea.Field = new int[] { 10 }; return nea; } + public static NotEmptyStructQA Create(NotEmptyStructQA val) { NotEmptyStructQA neq = new NotEmptyStructQA(); neq.Field = new int?[] { 10 }; return neq; } + public static EmptyStructGen Create(EmptyStructGen val) { return new EmptyStructGen(); } + public static NotEmptyStructGen Create(NotEmptyStructGen val) { NotEmptyStructGen ne = new NotEmptyStructGen(); ne.Field = 88; return ne; } + public static NotEmptyStructConstrainedGen Create(NotEmptyStructConstrainedGen val) { NotEmptyStructConstrainedGen ne = new NotEmptyStructConstrainedGen(); ne.Field = 1010; return ne; } + public static NotEmptyStructConstrainedGenA Create(NotEmptyStructConstrainedGenA val) { NotEmptyStructConstrainedGenA neq = new NotEmptyStructConstrainedGenA(); neq.Field = new int[] { 11 }; return neq; } + public static NotEmptyStructConstrainedGenQ Create(NotEmptyStructConstrainedGenQ val) { NotEmptyStructConstrainedGenQ neq = new NotEmptyStructConstrainedGenQ(); neq.Field = 12; return neq; } + public static NotEmptyStructConstrainedGenQA Create(NotEmptyStructConstrainedGenQA val) { NotEmptyStructConstrainedGenQA neq = new NotEmptyStructConstrainedGenQA(); neq.Field = new int?[] { 17 }; return neq; } + public static NestedStruct Create(NestedStruct val) { NestedStruct ns = new NestedStruct(); return ns; } + public static NestedStructGen Create(NestedStructGen val) { NestedStructGen nsg = new NestedStructGen(); return nsg; } + public static ExplicitFieldOffsetStruct Create(ExplicitFieldOffsetStruct val) { ExplicitFieldOffsetStruct epl = new ExplicitFieldOffsetStruct(); epl.Field00 = 40; epl.Field15 = 15; return epl; } + public static MarshalAsStruct Create(MarshalAsStruct val) { MarshalAsStruct ma = new MarshalAsStruct(); ma.StringField = "Nullable"; return ma; } + public static ImplementOneInterface Create(ImplementOneInterface val) { ImplementOneInterface imp = new ImplementOneInterface(); return imp; } + public static ImplementTwoInterface Create(ImplementTwoInterface val) { ImplementTwoInterface imp = new ImplementTwoInterface(); return imp; } + public static ImplementOneInterfaceGen Create(ImplementOneInterfaceGen val) { ImplementOneInterfaceGen imp = new ImplementOneInterfaceGen(); return imp; } + public static ImplementTwoInterfaceGen Create(ImplementTwoInterfaceGen val) { ImplementTwoInterfaceGen imp = new ImplementTwoInterfaceGen(); return imp; } + public static ImplementAllInterface Create(ImplementAllInterface val) { ImplementAllInterface imp = new ImplementAllInterface(); return imp; } + public static WithMultipleGCHandleStruct Create(WithMultipleGCHandleStruct val) + { WithMultipleGCHandleStruct mgch = new WithMultipleGCHandleStruct(); mgch.H1 = GCHANDLE; mgch.H2 = GCHANDLE; mgch.H3 = GCHANDLE; mgch.H4 = GCHANDLE; mgch.H5 = GCHANDLE; return mgch; } + public static WithOnlyFXTypeStruct Create(WithOnlyFXTypeStruct val) { WithOnlyFXTypeStruct wofx = new WithOnlyFXTypeStruct(); wofx.DECIMAL = 50.0m; wofx.GUID = Create(default(Guid)); return wofx; } + public static MixedAllStruct Create(MixedAllStruct val) + { + MixedAllStruct mas; + mas.INT = 10; + mas.IntQ = null; + mas.IntQA = new int?[] { 10 }; + mas.STRING = "Nullable"; + mas.INTE = Create(default(IntE)); + mas.EMPTYCLASS = new EmptyClass(); + mas.IEMPTY = Create(default(ImplementOneInterface)); + mas.EMPTYSTRUCT = Create(default(EmptyStruct)); + mas.IEMPTYGEN = Create(default(ImplementOneInterfaceGen)); + mas.EMPTYSTRUCTGEN = Create(default(EmptyStructGen)); + mas.WITHONLYFXTYPESTRUCT = Create(default(WithOnlyFXTypeStruct)); + mas.GCHANDLE = Create(default(GCHandle)); + + return mas; + } + + public static bool Compare(char val, char val1) { return val == val1; } + public static bool Compare(bool val, bool val1) { return val == val1; } + public static bool Compare(byte val, byte val1) { return val == val1; } + public static bool Compare(sbyte val, sbyte val1) { return val == val1; } + public static bool Compare(short val, short val1) { return val == val1; } + public static bool Compare(ushort val, ushort val1) { return val == val1; } + public static bool Compare(int val, int val1) { return val == val1; } + public static bool Compare(uint val, uint val1) { return val == val1; } + public static bool Compare(long val, long val1) { return val == val1; } + public static bool Compare(ulong val, ulong val1) { return val == val1; } + public static bool Compare(float val, float val1) { return val == val1; } + public static bool Compare(double val, double val1) { return val == val1; } + public static bool Compare(decimal val, decimal val1) { return val == val1; } + + public static bool Compare(IntPtr val, IntPtr val1) { return val == val1; } + public static bool Compare(UIntPtr val, UIntPtr val1) { return val == val1; } + public static bool Compare(Guid val, Guid val1) { return val == val1; } + public static bool Compare(GCHandle val, GCHandle val1) { return val == val1; } + public static bool Compare(ByteE val, ByteE val1) { return val == val1; } + public static bool Compare(IntE val, IntE val1) { return val == val1; } + public static bool Compare(LongE val, LongE val1) { return val == val1; } + public static bool Compare(EmptyStruct val, EmptyStruct val1) { return val.Equals(val1); } + public static bool Compare(NotEmptyStruct val, NotEmptyStruct val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructQ val, NotEmptyStructQ val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructA val, NotEmptyStructA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(NotEmptyStructQA val, NotEmptyStructQA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(EmptyStructGen val, EmptyStructGen val1) { return val.Equals(val1); } + public static bool Compare(NotEmptyStructGen val, NotEmptyStructGen val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructConstrainedGen val, NotEmptyStructConstrainedGen val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructConstrainedGenA val, NotEmptyStructConstrainedGenA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(NotEmptyStructConstrainedGenQ val, NotEmptyStructConstrainedGenQ val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructConstrainedGenQA val, NotEmptyStructConstrainedGenQA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(NestedStruct val, NestedStruct val1) { return val.Equals(val1); } + public static bool Compare(NestedStructGen val, NestedStructGen val1) { return val.Equals(val1); } + public static bool Compare(ExplicitFieldOffsetStruct val, ExplicitFieldOffsetStruct val1) { return (val.Field00 == val1.Field00) && (val.Field15 == val1.Field15); } + public static bool Compare(MarshalAsStruct val, MarshalAsStruct val1) { return val.Equals(val1); } + public static bool Compare(ImplementOneInterface val, ImplementOneInterface val1) { return (val is IEmpty) && val.Equals(val1); } + public static bool Compare(ImplementTwoInterface val, ImplementTwoInterface val1) { return (val is IEmpty) && val is INotEmpty && val.Equals(val1); } + public static bool Compare(ImplementOneInterfaceGen val, ImplementOneInterfaceGen val1) { return val is IEmptyGen && val.Equals(val1); } + public static bool Compare(ImplementTwoInterfaceGen val, ImplementTwoInterfaceGen val1) { return val is IEmptyGen && val is INotEmptyGen && val.Equals(val1); } + public static bool Compare(ImplementAllInterface val, ImplementAllInterface val1) { return val is IEmpty && val is INotEmpty && val is IEmptyGen && val is INotEmptyGen && val.Equals(val1); } + public static bool Compare(WithMultipleGCHandleStruct val, WithMultipleGCHandleStruct val1) + { return val.H1 == val1.H1 && val.H2 == val1.H2 && val.H3 == val1.H3 && val.H4 == val1.H4 && val.H5 == val1.H5; } + public static bool Compare(WithOnlyFXTypeStruct val, WithOnlyFXTypeStruct val1) { return val.GUID == val1.GUID && val.DECIMAL == val1.DECIMAL; } + public static bool Compare(MixedAllStruct val, MixedAllStruct val1) + { + return val.INT == val1.INT && + val.IntQ == val1.IntQ && + val.IntQA[0] == val1.IntQA[0] && + val.STRING == val1.STRING && + val.INTE == val1.INTE && + val.EMPTYCLASS.Equals(val1.EMPTYCLASS) && + val.IEMPTY.Equals(val1.IEMPTY) && + Compare(val.EMPTYSTRUCT, val1.EMPTYSTRUCT) && + val.IEMPTYGEN.Equals(val1.IEMPTYGEN) && + Compare(val.EMPTYSTRUCTGEN, val1.EMPTYSTRUCTGEN) && + Compare(val.WITHONLYFXTYPESTRUCT, val1.WITHONLYFXTYPESTRUCT) && + Compare(val.GCHANDLE, val1.GCHANDLE); + } + + public static bool Compare(char? val, char val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(bool? val, bool val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(byte? val, byte val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(sbyte? val, sbyte val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(short? val, short val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ushort? val, ushort val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(int? val, int val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(uint? val, uint val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(long? val, long val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ulong? val, ulong val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(float? val, float val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(double? val, double val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(decimal? val, decimal val1) { return val == null ? false : Compare(val.Value, val1); } + + public static bool Compare(IntPtr? val, IntPtr val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(UIntPtr? val, UIntPtr val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(Guid? val, Guid val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(GCHandle? val, GCHandle val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ByteE? val, ByteE val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(IntE? val, IntE val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(LongE? val, LongE val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(EmptyStruct? val, EmptyStruct val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStruct? val, NotEmptyStruct val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructQ? val, NotEmptyStructQ val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructA? val, NotEmptyStructA val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructQA? val, NotEmptyStructQA val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(EmptyStructGen? val, EmptyStructGen val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructGen? val, NotEmptyStructGen val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGen? val, NotEmptyStructConstrainedGen val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGenA? val, NotEmptyStructConstrainedGenA val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGenQ? val, NotEmptyStructConstrainedGenQ val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGenQA? val, NotEmptyStructConstrainedGenQA val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NestedStruct? val, NestedStruct val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(NestedStructGen? val, NestedStructGen val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ExplicitFieldOffsetStruct? val, ExplicitFieldOffsetStruct val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(MarshalAsStruct? val, MarshalAsStruct val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ImplementOneInterface? val, ImplementOneInterface val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ImplementTwoInterface? val, ImplementTwoInterface val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ImplementOneInterfaceGen? val, ImplementOneInterfaceGen val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ImplementTwoInterfaceGen? val, ImplementTwoInterfaceGen val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(ImplementAllInterface? val, ImplementAllInterface val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(WithMultipleGCHandleStruct? val, WithMultipleGCHandleStruct val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(WithOnlyFXTypeStruct? val, WithOnlyFXTypeStruct val1) { return val == null ? false : Compare(val.Value, val1); } + public static bool Compare(MixedAllStruct? val, MixedAllStruct val1) { return val == null ? false : Compare(val.Value, val1); } +} diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.cs new file mode 100644 index 0000000..d439428 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of char using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((char)o, Helper.Create(default(char))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((char?)o, Helper.Create(default(char))); + } + + private static int Main() + { + char? s = Helper.Create(default(char)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.csproj new file mode 100644 index 0000000..d977170 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.cs new file mode 100644 index 0000000..94c402e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((bool)o, Helper.Create(default(bool))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((bool?)o, Helper.Create(default(bool))); + } + + private static int Main() + { + bool? s = Helper.Create(default(bool)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.csproj new file mode 100644 index 0000000..8b4e7f3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.cs new file mode 100644 index 0000000..54bb9cc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of byte using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((byte)o, Helper.Create(default(byte))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((byte?)o, Helper.Create(default(byte))); + } + + private static int Main() + { + byte? s = Helper.Create(default(byte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.csproj new file mode 100644 index 0000000..d4cd7da --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.cs new file mode 100644 index 0000000..ba80a63 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((sbyte)o, Helper.Create(default(sbyte))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((sbyte?)o, Helper.Create(default(sbyte))); + } + + private static int Main() + { + sbyte? s = Helper.Create(default(sbyte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.csproj new file mode 100644 index 0000000..061dd18 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.cs new file mode 100644 index 0000000..b571ca6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of short using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((short)o, Helper.Create(default(short))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((short?)o, Helper.Create(default(short))); + } + + private static int Main() + { + short? s = Helper.Create(default(short)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.csproj new file mode 100644 index 0000000..6d67860 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.cs new file mode 100644 index 0000000..153f311 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ushort)o, Helper.Create(default(ushort))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ushort?)o, Helper.Create(default(ushort))); + } + + private static int Main() + { + ushort? s = Helper.Create(default(ushort)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.csproj new file mode 100644 index 0000000..a775ea3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs new file mode 100644 index 0000000..d57b7b3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of int using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((int)o, Helper.Create(default(int))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((int?)o, Helper.Create(default(int))); + } + + private static int Main() + { + int? s = Helper.Create(default(int)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.csproj new file mode 100644 index 0000000..99e41e9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.cs new file mode 100644 index 0000000..14aab70 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((uint)o, Helper.Create(default(uint))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((uint?)o, Helper.Create(default(uint))); + } + + private static int Main() + { + uint? s = Helper.Create(default(uint)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.csproj new file mode 100644 index 0000000..6cbb6c4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.cs new file mode 100644 index 0000000..e96ebff --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of long using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((long)o, Helper.Create(default(long))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((long?)o, Helper.Create(default(long))); + } + + private static int Main() + { + long? s = Helper.Create(default(long)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.csproj new file mode 100644 index 0000000..15bebb3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.cs new file mode 100644 index 0000000..11d1a86 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ulong)o, Helper.Create(default(ulong))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ulong?)o, Helper.Create(default(ulong))); + } + + private static int Main() + { + ulong? s = Helper.Create(default(ulong)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.csproj new file mode 100644 index 0000000..c1b9759 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs new file mode 100644 index 0000000..4bf7b50 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of float using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((float)o, Helper.Create(default(float))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((float?)o, Helper.Create(default(float))); + } + + private static int Main() + { + float? s = Helper.Create(default(float)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.csproj new file mode 100644 index 0000000..78414c7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.cs new file mode 100644 index 0000000..801d0c3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((double)o, Helper.Create(default(double))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((double?)o, Helper.Create(default(double))); + } + + private static int Main() + { + double? s = Helper.Create(default(double)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.csproj new file mode 100644 index 0000000..b4ed69a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.cs new file mode 100644 index 0000000..215bcf5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of decimal using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((decimal)o, Helper.Create(default(decimal))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((decimal?)o, Helper.Create(default(decimal))); + } + + private static int Main() + { + decimal? s = Helper.Create(default(decimal)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.csproj new file mode 100644 index 0000000..0d84d08 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.cs new file mode 100644 index 0000000..98d3936 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((IntPtr)o, Helper.Create(default(IntPtr))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((IntPtr?)o, Helper.Create(default(IntPtr))); + } + + private static int Main() + { + IntPtr? s = Helper.Create(default(IntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.csproj new file mode 100644 index 0000000..6724b72 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.cs new file mode 100644 index 0000000..c440f08 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of UIntPtr using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((UIntPtr)o, Helper.Create(default(UIntPtr))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((UIntPtr?)o, Helper.Create(default(UIntPtr))); + } + + private static int Main() + { + UIntPtr? s = Helper.Create(default(UIntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.csproj new file mode 100644 index 0000000..5c6427e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.cs new file mode 100644 index 0000000..73d8804 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((Guid)o, Helper.Create(default(Guid))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((Guid?)o, Helper.Create(default(Guid))); + } + + private static int Main() + { + Guid? s = Helper.Create(default(Guid)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.csproj new file mode 100644 index 0000000..ae93a50 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.cs new file mode 100644 index 0000000..a4c9898 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of GCHandle using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((GCHandle)o, Helper.Create(default(GCHandle))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((GCHandle?)o, Helper.Create(default(GCHandle))); + } + + private static int Main() + { + GCHandle? s = Helper.Create(default(GCHandle)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.csproj new file mode 100644 index 0000000..e1b34d0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.cs new file mode 100644 index 0000000..37eb5a0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ByteE)o, Helper.Create(default(ByteE))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ByteE?)o, Helper.Create(default(ByteE))); + } + + private static int Main() + { + ByteE? s = Helper.Create(default(ByteE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.csproj new file mode 100644 index 0000000..e1d7e6e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs new file mode 100644 index 0000000..a4dcc45 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of IntE using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((IntE)o, Helper.Create(default(IntE))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((IntE?)o, Helper.Create(default(IntE))); + } + + private static int Main() + { + IntE? s = Helper.Create(default(IntE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.csproj new file mode 100644 index 0000000..50e698c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.cs new file mode 100644 index 0000000..c6f95c7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((LongE)o, Helper.Create(default(LongE))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((LongE?)o, Helper.Create(default(LongE))); + } + + private static int Main() + { + LongE? s = Helper.Create(default(LongE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.csproj new file mode 100644 index 0000000..70efada --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.cs new file mode 100644 index 0000000..750bc0f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of EmptyStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((EmptyStruct)o, Helper.Create(default(EmptyStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((EmptyStruct?)o, Helper.Create(default(EmptyStruct))); + } + + private static int Main() + { + EmptyStruct? s = Helper.Create(default(EmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.csproj new file mode 100644 index 0000000..eefd3c5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.cs new file mode 100644 index 0000000..ef940a3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStruct)o, Helper.Create(default(NotEmptyStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStruct?)o, Helper.Create(default(NotEmptyStruct))); + } + + private static int Main() + { + NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.csproj new file mode 100644 index 0000000..d8b17cc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.cs new file mode 100644 index 0000000..6ae51b4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructQ using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructQ)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructQ?)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static int Main() + { + NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.csproj new file mode 100644 index 0000000..392ad1e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.cs new file mode 100644 index 0000000..6023a2a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructA)o, Helper.Create(default(NotEmptyStructA))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructA?)o, Helper.Create(default(NotEmptyStructA))); + } + + private static int Main() + { + NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.csproj new file mode 100644 index 0000000..b9c49cf --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.cs new file mode 100644 index 0000000..f2de588 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructQA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructQA)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructQA?)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static int Main() + { + NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.csproj new file mode 100644 index 0000000..6946188 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.cs new file mode 100644 index 0000000..b10570e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((EmptyStructGen)o, Helper.Create(default(EmptyStructGen))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((EmptyStructGen?)o, Helper.Create(default(EmptyStructGen))); + } + + private static int Main() + { + EmptyStructGen? s = Helper.Create(default(EmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.csproj new file mode 100644 index 0000000..11fd07c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.cs new file mode 100644 index 0000000..7536471 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructGen)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructGen?)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static int Main() + { + NotEmptyStructGen? s = Helper.Create(default(NotEmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.csproj new file mode 100644 index 0000000..a94ac3b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.cs new file mode 100644 index 0000000..cb290c7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGen)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGen?)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static int Main() + { + NotEmptyStructConstrainedGen? s = Helper.Create(default(NotEmptyStructConstrainedGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.csproj new file mode 100644 index 0000000..2d6afa3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.cs new file mode 100644 index 0000000..bcfcc00 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGenA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA?)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenA? s = Helper.Create(default(NotEmptyStructConstrainedGenA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.csproj new file mode 100644 index 0000000..15f30df --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.cs new file mode 100644 index 0000000..dd864ad --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ?)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQ? s = Helper.Create(default(NotEmptyStructConstrainedGenQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.csproj new file mode 100644 index 0000000..448c751 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.cs new file mode 100644 index 0000000..222745c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NotEmptyStructConstrainedGenQA using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA?)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQA? s = Helper.Create(default(NotEmptyStructConstrainedGenQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.csproj new file mode 100644 index 0000000..ccbae7d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.cs new file mode 100644 index 0000000..a17ae71 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NestedStruct)o, Helper.Create(default(NestedStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NestedStruct?)o, Helper.Create(default(NestedStruct))); + } + + private static int Main() + { + NestedStruct? s = Helper.Create(default(NestedStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.csproj new file mode 100644 index 0000000..1cb35d3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.cs new file mode 100644 index 0000000..e49168f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of NestedStructGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((NestedStructGen)o, Helper.Create(default(NestedStructGen))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((NestedStructGen?)o, Helper.Create(default(NestedStructGen))); + } + + private static int Main() + { + NestedStructGen? s = Helper.Create(default(NestedStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.csproj new file mode 100644 index 0000000..14ec5d7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.cs new file mode 100644 index 0000000..3f67990 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ExplicitFieldOffsetStruct)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ExplicitFieldOffsetStruct?)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static int Main() + { + ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.csproj new file mode 100644 index 0000000..cba13d1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.cs new file mode 100644 index 0000000..59254c6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of MarshalAsStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((MarshalAsStruct)o, Helper.Create(default(MarshalAsStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((MarshalAsStruct?)o, Helper.Create(default(MarshalAsStruct))); + } + + private static int Main() + { + MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.csproj new file mode 100644 index 0000000..0f53d77 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.cs new file mode 100644 index 0000000..6f157d8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ImplementOneInterface)o, Helper.Create(default(ImplementOneInterface))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ImplementOneInterface?)o, Helper.Create(default(ImplementOneInterface))); + } + + private static int Main() + { + ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.csproj new file mode 100644 index 0000000..c430d1e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.cs new file mode 100644 index 0000000..cec5c0f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementTwoInterface using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ImplementTwoInterface)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ImplementTwoInterface?)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static int Main() + { + ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.csproj new file mode 100644 index 0000000..da46f74 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.cs new file mode 100644 index 0000000..c027001 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ImplementOneInterfaceGen)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ImplementOneInterfaceGen?)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static int Main() + { + ImplementOneInterfaceGen? s = Helper.Create(default(ImplementOneInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.csproj new file mode 100644 index 0000000..ca62a0b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.cs new file mode 100644 index 0000000..ffc3ad3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of ImplementTwoInterfaceGen using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ImplementTwoInterfaceGen)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ImplementTwoInterfaceGen?)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = Helper.Create(default(ImplementTwoInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.csproj new file mode 100644 index 0000000..c3fa4e1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.cs new file mode 100644 index 0000000..387bcdd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((ImplementAllInterface)o, Helper.Create(default(ImplementAllInterface))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((ImplementAllInterface?)o, Helper.Create(default(ImplementAllInterface))); + } + + private static int Main() + { + ImplementAllInterface? s = Helper.Create(default(ImplementAllInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.csproj new file mode 100644 index 0000000..33ac731 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.cs new file mode 100644 index 0000000..1808491 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of WithMultipleGCHandleStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((WithMultipleGCHandleStruct)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((WithMultipleGCHandleStruct?)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static int Main() + { + WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.csproj new file mode 100644 index 0000000..91c79d5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.cs new file mode 100644 index 0000000..a79f299 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((WithOnlyFXTypeStruct)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((WithOnlyFXTypeStruct?)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static int Main() + { + WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.csproj new file mode 100644 index 0000000..8761d9c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.cs new file mode 100644 index 0000000..351036d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - Box-Unbox +// Nullable type with unbox box expr +// +// checking type of MixedAllStruct using is operator +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(ValueType o) + { + return Helper.Compare((MixedAllStruct)o, Helper.Create(default(MixedAllStruct))); + } + + private static bool BoxUnboxToQ(ValueType o) + { + return Helper.Compare((MixedAllStruct?)o, Helper.Create(default(MixedAllStruct))); + } + + private static int Main() + { + MixedAllStruct? s = Helper.Create(default(MixedAllStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.csproj new file mode 100644 index 0000000..8549fd4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.cs new file mode 100644 index 0000000..7c19469 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((char)(ValueType)o, Helper.Create(default(char))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((char?)(ValueType)o, Helper.Create(default(char))); + } + + private static int Main() + { + char? s = Helper.Create(default(char)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.csproj new file mode 100644 index 0000000..e16f318 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.cs new file mode 100644 index 0000000..5376c8d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of bool using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((bool)(ValueType)o, Helper.Create(default(bool))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((bool?)(ValueType)o, Helper.Create(default(bool))); + } + + private static int Main() + { + bool? s = Helper.Create(default(bool)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.csproj new file mode 100644 index 0000000..7c6b66c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.cs new file mode 100644 index 0000000..8c4e7a7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((byte)(ValueType)o, Helper.Create(default(byte))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((byte?)(ValueType)o, Helper.Create(default(byte))); + } + + private static int Main() + { + byte? s = Helper.Create(default(byte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.csproj new file mode 100644 index 0000000..6f7ee3a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.cs new file mode 100644 index 0000000..ba604a9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of sbyte using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((sbyte)(ValueType)o, Helper.Create(default(sbyte))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((sbyte?)(ValueType)o, Helper.Create(default(sbyte))); + } + + private static int Main() + { + sbyte? s = Helper.Create(default(sbyte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.csproj new file mode 100644 index 0000000..aa8dde2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.cs new file mode 100644 index 0000000..6fa7126 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((short)(ValueType)o, Helper.Create(default(short))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((short?)(ValueType)o, Helper.Create(default(short))); + } + + private static int Main() + { + short? s = Helper.Create(default(short)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.csproj new file mode 100644 index 0000000..1de1ced --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.cs new file mode 100644 index 0000000..3927d3b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ushort using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ushort)(ValueType)o, Helper.Create(default(ushort))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ushort?)(ValueType)o, Helper.Create(default(ushort))); + } + + private static int Main() + { + ushort? s = Helper.Create(default(ushort)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.csproj new file mode 100644 index 0000000..2131dad --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.cs new file mode 100644 index 0000000..e5b729b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((int)(ValueType)o, Helper.Create(default(int))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((int?)(ValueType)o, Helper.Create(default(int))); + } + + private static int Main() + { + int? s = Helper.Create(default(int)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.csproj new file mode 100644 index 0000000..07a1031 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.cs new file mode 100644 index 0000000..72fa78e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of uint using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((uint)(ValueType)o, Helper.Create(default(uint))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((uint?)(ValueType)o, Helper.Create(default(uint))); + } + + private static int Main() + { + uint? s = Helper.Create(default(uint)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.csproj new file mode 100644 index 0000000..037ad72 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.cs new file mode 100644 index 0000000..1d6c11b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((long)(ValueType)o, Helper.Create(default(long))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((long?)(ValueType)o, Helper.Create(default(long))); + } + + private static int Main() + { + long? s = Helper.Create(default(long)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.csproj new file mode 100644 index 0000000..5cffcc9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.cs new file mode 100644 index 0000000..be3b723 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ulong using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ulong)(ValueType)o, Helper.Create(default(ulong))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ulong?)(ValueType)o, Helper.Create(default(ulong))); + } + + private static int Main() + { + ulong? s = Helper.Create(default(ulong)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.csproj new file mode 100644 index 0000000..39c6dd9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.cs new file mode 100644 index 0000000..be161bf --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((float)(ValueType)o, Helper.Create(default(float))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((float?)(ValueType)o, Helper.Create(default(float))); + } + + private static int Main() + { + float? s = Helper.Create(default(float)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.csproj new file mode 100644 index 0000000..a909471 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.cs new file mode 100644 index 0000000..1065065 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of double using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((double)(ValueType)o, Helper.Create(default(double))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((double?)(ValueType)o, Helper.Create(default(double))); + } + + private static int Main() + { + double? s = Helper.Create(default(double)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.csproj new file mode 100644 index 0000000..929e106 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.cs new file mode 100644 index 0000000..596cf5d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((decimal)(ValueType)o, Helper.Create(default(decimal))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((decimal?)(ValueType)o, Helper.Create(default(decimal))); + } + + private static int Main() + { + decimal? s = Helper.Create(default(decimal)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.csproj new file mode 100644 index 0000000..d86be46 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.cs new file mode 100644 index 0000000..983d7eb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of IntPtr using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((IntPtr)(ValueType)o, Helper.Create(default(IntPtr))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((IntPtr?)(ValueType)o, Helper.Create(default(IntPtr))); + } + + private static int Main() + { + IntPtr? s = Helper.Create(default(IntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.csproj new file mode 100644 index 0000000..205653c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.cs new file mode 100644 index 0000000..7fd4f12 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((UIntPtr)(ValueType)o, Helper.Create(default(UIntPtr))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((UIntPtr?)(ValueType)o, Helper.Create(default(UIntPtr))); + } + + private static int Main() + { + UIntPtr? s = Helper.Create(default(UIntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.csproj new file mode 100644 index 0000000..90ec914 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.cs new file mode 100644 index 0000000..a169b77 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of Guid using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((Guid)(ValueType)o, Helper.Create(default(Guid))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((Guid?)(ValueType)o, Helper.Create(default(Guid))); + } + + private static int Main() + { + Guid? s = Helper.Create(default(Guid)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.csproj new file mode 100644 index 0000000..09a4d8e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.cs new file mode 100644 index 0000000..bb46da0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((GCHandle)(ValueType)o, Helper.Create(default(GCHandle))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((GCHandle?)(ValueType)o, Helper.Create(default(GCHandle))); + } + + private static int Main() + { + GCHandle? s = Helper.Create(default(GCHandle)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.csproj new file mode 100644 index 0000000..55915ee --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.cs new file mode 100644 index 0000000..da31f2d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ByteE using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ByteE)(ValueType)o, Helper.Create(default(ByteE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ByteE?)(ValueType)o, Helper.Create(default(ByteE))); + } + + private static int Main() + { + ByteE? s = Helper.Create(default(ByteE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.csproj new file mode 100644 index 0000000..27f3990 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.cs new file mode 100644 index 0000000..65adb59 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((IntE)(ValueType)o, Helper.Create(default(IntE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((IntE?)(ValueType)o, Helper.Create(default(IntE))); + } + + private static int Main() + { + IntE? s = Helper.Create(default(IntE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.csproj new file mode 100644 index 0000000..2a5c7a8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.cs new file mode 100644 index 0000000..463601f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of LongE using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((LongE)(ValueType)o, Helper.Create(default(LongE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((LongE?)(ValueType)o, Helper.Create(default(LongE))); + } + + private static int Main() + { + LongE? s = Helper.Create(default(LongE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.csproj new file mode 100644 index 0000000..8597c06 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.cs new file mode 100644 index 0000000..1be6c8f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((EmptyStruct)(ValueType)o, Helper.Create(default(EmptyStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((EmptyStruct?)(ValueType)o, Helper.Create(default(EmptyStruct))); + } + + private static int Main() + { + EmptyStruct? s = Helper.Create(default(EmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.csproj new file mode 100644 index 0000000..27617cb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.cs new file mode 100644 index 0000000..d80afe7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStruct)(ValueType)o, Helper.Create(default(NotEmptyStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStruct?)(ValueType)o, Helper.Create(default(NotEmptyStruct))); + } + + private static int Main() + { + NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.csproj new file mode 100644 index 0000000..d697f7f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.cs new file mode 100644 index 0000000..56e2431 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructQ)(ValueType)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructQ?)(ValueType)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static int Main() + { + NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.csproj new file mode 100644 index 0000000..8fb8147 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.cs new file mode 100644 index 0000000..165e485 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructA using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructA)(ValueType)o, Helper.Create(default(NotEmptyStructA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructA?)(ValueType)o, Helper.Create(default(NotEmptyStructA))); + } + + private static int Main() + { + NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.csproj new file mode 100644 index 0000000..9457d08 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs new file mode 100644 index 0000000..4632d2e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructQA)(ValueType)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructQA?)(ValueType)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static int Main() + { + NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.csproj new file mode 100644 index 0000000..11b47b5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.cs new file mode 100644 index 0000000..bd41b65 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of EmptyStructGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((EmptyStructGen)(ValueType)o, Helper.Create(default(EmptyStructGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((EmptyStructGen?)(ValueType)o, Helper.Create(default(EmptyStructGen))); + } + + private static int Main() + { + EmptyStructGen? s = Helper.Create(default(EmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.csproj new file mode 100644 index 0000000..7a7c549 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.cs new file mode 100644 index 0000000..1606a2d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructGen)(ValueType)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructGen?)(ValueType)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static int Main() + { + NotEmptyStructGen? s = Helper.Create(default(NotEmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.csproj new file mode 100644 index 0000000..e41e0db --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.cs new file mode 100644 index 0000000..d4685b2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructConstrainedGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGen)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGen?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static int Main() + { + NotEmptyStructConstrainedGen? s = Helper.Create(default(NotEmptyStructConstrainedGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.csproj new file mode 100644 index 0000000..0763c91 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.cs new file mode 100644 index 0000000..fd2f6b1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenA? s = Helper.Create(default(NotEmptyStructConstrainedGenA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.csproj new file mode 100644 index 0000000..667b7a6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.cs new file mode 100644 index 0000000..0af11e3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructConstrainedGenQ using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQ? s = Helper.Create(default(NotEmptyStructConstrainedGenQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.csproj new file mode 100644 index 0000000..e1aa48c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.cs new file mode 100644 index 0000000..2f40dc0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQA? s = Helper.Create(default(NotEmptyStructConstrainedGenQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.csproj new file mode 100644 index 0000000..1cb7967 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.cs new file mode 100644 index 0000000..a2c6bbc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NestedStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NestedStruct)(ValueType)o, Helper.Create(default(NestedStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NestedStruct?)(ValueType)o, Helper.Create(default(NestedStruct))); + } + + private static int Main() + { + NestedStruct? s = Helper.Create(default(NestedStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.csproj new file mode 100644 index 0000000..849c3d7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.cs new file mode 100644 index 0000000..0e0fa44 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((NestedStructGen)(ValueType)o, Helper.Create(default(NestedStructGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((NestedStructGen?)(ValueType)o, Helper.Create(default(NestedStructGen))); + } + + private static int Main() + { + NestedStructGen? s = Helper.Create(default(NestedStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.csproj new file mode 100644 index 0000000..3e0505f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.cs new file mode 100644 index 0000000..9ef4bad --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ExplicitFieldOffsetStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ExplicitFieldOffsetStruct)(ValueType)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ExplicitFieldOffsetStruct?)(ValueType)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static int Main() + { + ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.csproj new file mode 100644 index 0000000..ab52623 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.cs new file mode 100644 index 0000000..1b141aa --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((MarshalAsStruct)(ValueType)o, Helper.Create(default(MarshalAsStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((MarshalAsStruct?)(ValueType)o, Helper.Create(default(MarshalAsStruct))); + } + + private static int Main() + { + MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.csproj new file mode 100644 index 0000000..bac25e8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.cs new file mode 100644 index 0000000..03800c4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementOneInterface using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementOneInterface)(ValueType)o, Helper.Create(default(ImplementOneInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementOneInterface?)(ValueType)o, Helper.Create(default(ImplementOneInterface))); + } + + private static int Main() + { + ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.csproj new file mode 100644 index 0000000..1af24d1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.cs new file mode 100644 index 0000000..63bcf95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementTwoInterface)(ValueType)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementTwoInterface?)(ValueType)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static int Main() + { + ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.csproj new file mode 100644 index 0000000..7fe1ade --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.cs new file mode 100644 index 0000000..479b77c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementOneInterfaceGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementOneInterfaceGen)(ValueType)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementOneInterfaceGen?)(ValueType)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static int Main() + { + ImplementOneInterfaceGen? s = Helper.Create(default(ImplementOneInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.csproj new file mode 100644 index 0000000..e98fd4b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.cs new file mode 100644 index 0000000..32ac5ba --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementTwoInterfaceGen)(ValueType)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementTwoInterfaceGen?)(ValueType)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = Helper.Create(default(ImplementTwoInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.csproj new file mode 100644 index 0000000..bc6d453 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.cs new file mode 100644 index 0000000..b896d0f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementAllInterface using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementAllInterface)(ValueType)o, Helper.Create(default(ImplementAllInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementAllInterface?)(ValueType)o, Helper.Create(default(ImplementAllInterface))); + } + + private static int Main() + { + ImplementAllInterface? s = Helper.Create(default(ImplementAllInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.csproj new file mode 100644 index 0000000..522e358 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.cs new file mode 100644 index 0000000..d1d4e12 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((WithMultipleGCHandleStruct)(ValueType)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((WithMultipleGCHandleStruct?)(ValueType)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static int Main() + { + WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.csproj new file mode 100644 index 0000000..5c5f9f8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.cs new file mode 100644 index 0000000..5bb6529 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of WithOnlyFXTypeStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((WithOnlyFXTypeStruct)(ValueType)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((WithOnlyFXTypeStruct?)(ValueType)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static int Main() + { + WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.csproj new file mode 100644 index 0000000..ed7af75 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.cs new file mode 100644 index 0000000..a77e81d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((MixedAllStruct)(ValueType)o, Helper.Create(default(MixedAllStruct))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((MixedAllStruct?)(ValueType)o, Helper.Create(default(MixedAllStruct))); + } + + private static int Main() + { + MixedAllStruct? s = Helper.Create(default(MixedAllStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.csproj new file mode 100644 index 0000000..3530d11 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.cs new file mode 100644 index 0000000..443faaf --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of IntE using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((IntE)(Enum)o, Helper.Create(default(IntE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((IntE?)(Enum)o, Helper.Create(default(IntE))); + } + + private static int Main() + { + IntE? s = Helper.Create(default(IntE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.csproj new file mode 100644 index 0000000..727b8e5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.cs new file mode 100644 index 0000000..2b174c5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ByteE)(Enum)o, Helper.Create(default(ByteE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ByteE?)(Enum)o, Helper.Create(default(ByteE))); + } + + private static int Main() + { + ByteE? s = Helper.Create(default(ByteE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.csproj new file mode 100644 index 0000000..2d340f4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.cs new file mode 100644 index 0000000..5f67e97 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of LongE using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((LongE)(Enum)o, Helper.Create(default(LongE))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((LongE?)(Enum)o, Helper.Create(default(LongE))); + } + + private static int Main() + { + LongE? s = Helper.Create(default(LongE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.csproj new file mode 100644 index 0000000..1af0be4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.cs new file mode 100644 index 0000000..7c2445c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((char)(ValueType)(object)o, Helper.Create(default(char))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((char?)(ValueType)(object)o, Helper.Create(default(char))); + } + + private static int Main() + { + char? s = Helper.Create(default(char)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.csproj new file mode 100644 index 0000000..7b55bc0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.cs new file mode 100644 index 0000000..2385791 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of bool using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((bool)(ValueType)(object)o, Helper.Create(default(bool))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((bool?)(ValueType)(object)o, Helper.Create(default(bool))); + } + + private static int Main() + { + bool? s = Helper.Create(default(bool)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.csproj new file mode 100644 index 0000000..97a6ffa --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.cs new file mode 100644 index 0000000..778c36c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((byte)(ValueType)(object)o, Helper.Create(default(byte))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((byte?)(ValueType)(object)o, Helper.Create(default(byte))); + } + + private static int Main() + { + byte? s = Helper.Create(default(byte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.csproj new file mode 100644 index 0000000..e817abe --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.cs new file mode 100644 index 0000000..d2cd3c4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of sbyte using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((sbyte)(ValueType)(object)o, Helper.Create(default(sbyte))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((sbyte?)(ValueType)(object)o, Helper.Create(default(sbyte))); + } + + private static int Main() + { + sbyte? s = Helper.Create(default(sbyte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.csproj new file mode 100644 index 0000000..7d08eec --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.cs new file mode 100644 index 0000000..8dfbc8d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((short)(ValueType)(object)o, Helper.Create(default(short))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((short?)(ValueType)(object)o, Helper.Create(default(short))); + } + + private static int Main() + { + short? s = Helper.Create(default(short)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.csproj new file mode 100644 index 0000000..b0437b2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.cs new file mode 100644 index 0000000..9026cd4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ushort using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ushort)(ValueType)(object)o, Helper.Create(default(ushort))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ushort?)(ValueType)(object)o, Helper.Create(default(ushort))); + } + + private static int Main() + { + ushort? s = Helper.Create(default(ushort)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.csproj new file mode 100644 index 0000000..c40dac6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.cs new file mode 100644 index 0000000..c9a2613 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((int)(ValueType)(object)o, Helper.Create(default(int))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((int?)(ValueType)(object)o, Helper.Create(default(int))); + } + + private static int Main() + { + int? s = Helper.Create(default(int)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.csproj new file mode 100644 index 0000000..0a00ac2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.cs new file mode 100644 index 0000000..61f7645 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of uint using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((uint)(ValueType)(object)o, Helper.Create(default(uint))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((uint?)(ValueType)(object)o, Helper.Create(default(uint))); + } + + private static int Main() + { + uint? s = Helper.Create(default(uint)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.csproj new file mode 100644 index 0000000..dbfd83b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.cs new file mode 100644 index 0000000..bf88dd0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((long)(ValueType)(object)o, Helper.Create(default(long))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((long?)(ValueType)(object)o, Helper.Create(default(long))); + } + + private static int Main() + { + long? s = Helper.Create(default(long)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.csproj new file mode 100644 index 0000000..69fd626 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.cs new file mode 100644 index 0000000..342768b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ulong using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ulong)(ValueType)(object)o, Helper.Create(default(ulong))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ulong?)(ValueType)(object)o, Helper.Create(default(ulong))); + } + + private static int Main() + { + ulong? s = Helper.Create(default(ulong)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.csproj new file mode 100644 index 0000000..20c104e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.cs new file mode 100644 index 0000000..543ab23 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((float)(ValueType)(object)o, Helper.Create(default(float))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((float?)(ValueType)(object)o, Helper.Create(default(float))); + } + + private static int Main() + { + float? s = Helper.Create(default(float)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.csproj new file mode 100644 index 0000000..cf81cca4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.cs new file mode 100644 index 0000000..a0744e1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of double using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((double)(ValueType)(object)o, Helper.Create(default(double))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((double?)(ValueType)(object)o, Helper.Create(default(double))); + } + + private static int Main() + { + double? s = Helper.Create(default(double)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.csproj new file mode 100644 index 0000000..fb86ed6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.cs new file mode 100644 index 0000000..10b4d87 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((decimal)(ValueType)(object)o, Helper.Create(default(decimal))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((decimal?)(ValueType)(object)o, Helper.Create(default(decimal))); + } + + private static int Main() + { + decimal? s = Helper.Create(default(decimal)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.csproj new file mode 100644 index 0000000..ad2145f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.cs new file mode 100644 index 0000000..bbb52b8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of IntPtr using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((IntPtr)(ValueType)(object)o, Helper.Create(default(IntPtr))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((IntPtr?)(ValueType)(object)o, Helper.Create(default(IntPtr))); + } + + private static int Main() + { + IntPtr? s = Helper.Create(default(IntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.csproj new file mode 100644 index 0000000..16ffd7f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.cs new file mode 100644 index 0000000..6000242 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((UIntPtr)(ValueType)(object)o, Helper.Create(default(UIntPtr))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((UIntPtr?)(ValueType)(object)o, Helper.Create(default(UIntPtr))); + } + + private static int Main() + { + UIntPtr? s = Helper.Create(default(UIntPtr)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.csproj new file mode 100644 index 0000000..d74191f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.cs new file mode 100644 index 0000000..345196e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of Guid using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((Guid)(ValueType)(object)o, Helper.Create(default(Guid))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((Guid?)(ValueType)(object)o, Helper.Create(default(Guid))); + } + + private static int Main() + { + Guid? s = Helper.Create(default(Guid)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.csproj new file mode 100644 index 0000000..092f9f5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.cs new file mode 100644 index 0000000..ba7c792 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((GCHandle)(ValueType)(object)o, Helper.Create(default(GCHandle))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((GCHandle?)(ValueType)(object)o, Helper.Create(default(GCHandle))); + } + + private static int Main() + { + GCHandle? s = Helper.Create(default(GCHandle)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.csproj new file mode 100644 index 0000000..85d5005 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.cs new file mode 100644 index 0000000..67d58b2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ByteE using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ByteE)(ValueType)(object)o, Helper.Create(default(ByteE))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ByteE?)(ValueType)(object)o, Helper.Create(default(ByteE))); + } + + private static int Main() + { + ByteE? s = Helper.Create(default(ByteE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.csproj new file mode 100644 index 0000000..18cf10b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.cs new file mode 100644 index 0000000..db51a77 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((IntE)(ValueType)(object)o, Helper.Create(default(IntE))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((IntE?)(ValueType)(object)o, Helper.Create(default(IntE))); + } + + private static int Main() + { + IntE? s = Helper.Create(default(IntE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.csproj new file mode 100644 index 0000000..0a7c9c6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.cs new file mode 100644 index 0000000..875da6e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of LongE using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((LongE)(ValueType)(object)o, Helper.Create(default(LongE))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((LongE?)(ValueType)(object)o, Helper.Create(default(LongE))); + } + + private static int Main() + { + LongE? s = Helper.Create(default(LongE)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.csproj new file mode 100644 index 0000000..01e0537 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.cs new file mode 100644 index 0000000..1c28bd0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((EmptyStruct)(ValueType)(object)o, Helper.Create(default(EmptyStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((EmptyStruct?)(ValueType)(object)o, Helper.Create(default(EmptyStruct))); + } + + private static int Main() + { + EmptyStruct? s = Helper.Create(default(EmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.csproj new file mode 100644 index 0000000..a5d25b4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.cs new file mode 100644 index 0000000..b25bcab --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStruct)(ValueType)(object)o, Helper.Create(default(NotEmptyStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStruct?)(ValueType)(object)o, Helper.Create(default(NotEmptyStruct))); + } + + private static int Main() + { + NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.csproj new file mode 100644 index 0000000..a0aaed7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.cs new file mode 100644 index 0000000..cb8b056 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructQ)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructQ?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQ))); + } + + private static int Main() + { + NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.csproj new file mode 100644 index 0000000..b46e1f3 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.cs new file mode 100644 index 0000000..7d5b4ad --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructA using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructA)(ValueType)(object)o, Helper.Create(default(NotEmptyStructA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructA?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructA))); + } + + private static int Main() + { + NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.csproj new file mode 100644 index 0000000..8c9fd7c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.cs new file mode 100644 index 0000000..294ffc7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructQA)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructQA?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQA))); + } + + private static int Main() + { + NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.csproj new file mode 100644 index 0000000..812f1bb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.cs new file mode 100644 index 0000000..31083b1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of EmptyStructGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((EmptyStructGen)(ValueType)(object)o, Helper.Create(default(EmptyStructGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((EmptyStructGen?)(ValueType)(object)o, Helper.Create(default(EmptyStructGen))); + } + + private static int Main() + { + EmptyStructGen? s = Helper.Create(default(EmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.csproj new file mode 100644 index 0000000..df8fbc0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.cs new file mode 100644 index 0000000..e19e374 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructGen)(ValueType)(object)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructGen?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructGen))); + } + + private static int Main() + { + NotEmptyStructGen? s = Helper.Create(default(NotEmptyStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.csproj new file mode 100644 index 0000000..298056f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.cs new file mode 100644 index 0000000..2f8e341 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructConstrainedGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGen)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGen?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen))); + } + + private static int Main() + { + NotEmptyStructConstrainedGen? s = Helper.Create(default(NotEmptyStructConstrainedGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.csproj new file mode 100644 index 0000000..29e35c2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.cs new file mode 100644 index 0000000..af0f834 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenA?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenA? s = Helper.Create(default(NotEmptyStructConstrainedGenA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.csproj new file mode 100644 index 0000000..f99f3d2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.cs new file mode 100644 index 0000000..88f0b98 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructConstrainedGenQ using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQ?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQ? s = Helper.Create(default(NotEmptyStructConstrainedGenQ)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.csproj new file mode 100644 index 0000000..2f1336d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.cs new file mode 100644 index 0000000..5f06e92 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NotEmptyStructConstrainedGenQA?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA))); + } + + private static int Main() + { + NotEmptyStructConstrainedGenQA? s = Helper.Create(default(NotEmptyStructConstrainedGenQA)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.csproj new file mode 100644 index 0000000..a7e5490 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.cs new file mode 100644 index 0000000..7c3f573 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NestedStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NestedStruct)(ValueType)(object)o, Helper.Create(default(NestedStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NestedStruct?)(ValueType)(object)o, Helper.Create(default(NestedStruct))); + } + + private static int Main() + { + NestedStruct? s = Helper.Create(default(NestedStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.csproj new file mode 100644 index 0000000..ba307c6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.cs new file mode 100644 index 0000000..35e2be4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((NestedStructGen)(ValueType)(object)o, Helper.Create(default(NestedStructGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((NestedStructGen?)(ValueType)(object)o, Helper.Create(default(NestedStructGen))); + } + + private static int Main() + { + NestedStructGen? s = Helper.Create(default(NestedStructGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.csproj new file mode 100644 index 0000000..15c9a22 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.cs new file mode 100644 index 0000000..e8321b0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ExplicitFieldOffsetStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ExplicitFieldOffsetStruct)(ValueType)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ExplicitFieldOffsetStruct?)(ValueType)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct))); + } + + private static int Main() + { + ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.csproj new file mode 100644 index 0000000..c8554ca --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.cs new file mode 100644 index 0000000..9c42246 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((MarshalAsStruct)(ValueType)(object)o, Helper.Create(default(MarshalAsStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((MarshalAsStruct?)(ValueType)(object)o, Helper.Create(default(MarshalAsStruct))); + } + + private static int Main() + { + MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.csproj new file mode 100644 index 0000000..c86f773 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.cs new file mode 100644 index 0000000..d00ccb5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementOneInterface using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementOneInterface)(ValueType)(object)o, Helper.Create(default(ImplementOneInterface))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementOneInterface?)(ValueType)(object)o, Helper.Create(default(ImplementOneInterface))); + } + + private static int Main() + { + ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.csproj new file mode 100644 index 0000000..65bbece --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.cs new file mode 100644 index 0000000..3557c3b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementTwoInterface)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementTwoInterface?)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static int Main() + { + ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.csproj new file mode 100644 index 0000000..c7cbe7a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.cs new file mode 100644 index 0000000..0674c8f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementOneInterfaceGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementOneInterfaceGen)(ValueType)(object)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementOneInterfaceGen?)(ValueType)(object)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static int Main() + { + ImplementOneInterfaceGen? s = Helper.Create(default(ImplementOneInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.csproj new file mode 100644 index 0000000..098a8f4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.cs new file mode 100644 index 0000000..2891e57 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementTwoInterfaceGen)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementTwoInterfaceGen?)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = Helper.Create(default(ImplementTwoInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.csproj new file mode 100644 index 0000000..569df4f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.cs new file mode 100644 index 0000000..d8f49b6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementAllInterface using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((ImplementAllInterface)(ValueType)(object)o, Helper.Create(default(ImplementAllInterface))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((ImplementAllInterface?)(ValueType)(object)o, Helper.Create(default(ImplementAllInterface))); + } + + private static int Main() + { + ImplementAllInterface? s = Helper.Create(default(ImplementAllInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.csproj new file mode 100644 index 0000000..f061c90 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.cs new file mode 100644 index 0000000..6ab22ce --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((WithMultipleGCHandleStruct)(ValueType)(object)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((WithMultipleGCHandleStruct?)(ValueType)(object)o, Helper.Create(default(WithMultipleGCHandleStruct))); + } + + private static int Main() + { + WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.csproj new file mode 100644 index 0000000..60d207a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.cs new file mode 100644 index 0000000..728fcfc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of WithOnlyFXTypeStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((WithOnlyFXTypeStruct)(ValueType)(object)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((WithOnlyFXTypeStruct?)(ValueType)(object)o, Helper.Create(default(WithOnlyFXTypeStruct))); + } + + private static int Main() + { + WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.csproj new file mode 100644 index 0000000..45e81eb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.cs new file mode 100644 index 0000000..005f026 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(T o) + { + return Helper.Compare((MixedAllStruct)(ValueType)(object)o, Helper.Create(default(MixedAllStruct))); + } + + private static bool BoxUnboxToQ(T o) + { + return Helper.Compare((MixedAllStruct?)(ValueType)(object)o, Helper.Create(default(MixedAllStruct))); + } + + private static int Main() + { + MixedAllStruct? s = Helper.Create(default(MixedAllStruct)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.csproj new file mode 100644 index 0000000..9fb87fe --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.cs new file mode 100644 index 0000000..5223de0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementOneInterface using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementOneInterface)(IEmpty)o, Helper.Create(default(ImplementOneInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementOneInterface?)(IEmpty)o, Helper.Create(default(ImplementOneInterface))); + } + + private static int Main() + { + ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.csproj new file mode 100644 index 0000000..4555942 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.cs new file mode 100644 index 0000000..3589afd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementTwoInterface)(IEmpty)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementTwoInterface?)(IEmpty)o, Helper.Create(default(ImplementTwoInterface))); + } + + private static int Main() + { + ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.csproj new file mode 100644 index 0000000..f37222d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.cs new file mode 100644 index 0000000..0bc962b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementOneInterfaceGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementOneInterfaceGen)(IEmptyGen)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementOneInterfaceGen?)(IEmptyGen)o, Helper.Create(default(ImplementOneInterfaceGen))); + } + + private static int Main() + { + ImplementOneInterfaceGen? s = Helper.Create(default(ImplementOneInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.csproj new file mode 100644 index 0000000..25e5801 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.cs new file mode 100644 index 0000000..371d01f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementTwoInterfaceGen)(IEmptyGen)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementTwoInterfaceGen?)(IEmptyGen)o, Helper.Create(default(ImplementTwoInterfaceGen))); + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = Helper.Create(default(ImplementTwoInterfaceGen)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.csproj new file mode 100644 index 0000000..6e20e49 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.cs new file mode 100644 index 0000000..13995a1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementAllInterface using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ImplementAllInterface)(IEmpty)o, Helper.Create(default(ImplementAllInterface))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ImplementAllInterface?)(IEmpty)o, Helper.Create(default(ImplementAllInterface))); + } + + private static int Main() + { + ImplementAllInterface? s = Helper.Create(default(ImplementAllInterface)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.csproj new file mode 100644 index 0000000..4b2b10d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.cs new file mode 100644 index 0000000..977eed0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((char)(IComparable)o, Helper.Create(default(char))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((char?)(IComparable)o, Helper.Create(default(char))); + } + + private static int Main() + { + char? s = Helper.Create(default(char)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.csproj new file mode 100644 index 0000000..45dde42 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.cs new file mode 100644 index 0000000..6070897 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of bool using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((bool)(IComparable)o, Helper.Create(default(bool))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((bool?)(IComparable)o, Helper.Create(default(bool))); + } + + private static int Main() + { + bool? s = Helper.Create(default(bool)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.csproj new file mode 100644 index 0000000..aedf184 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.cs new file mode 100644 index 0000000..d2ea648 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((byte)(IComparable)o, Helper.Create(default(byte))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((byte?)(IComparable)o, Helper.Create(default(byte))); + } + + private static int Main() + { + byte? s = Helper.Create(default(byte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.csproj new file mode 100644 index 0000000..3de3eb7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.cs new file mode 100644 index 0000000..f101f20 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of sbyte using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((sbyte)(IComparable)o, Helper.Create(default(sbyte))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((sbyte?)(IComparable)o, Helper.Create(default(sbyte))); + } + + private static int Main() + { + sbyte? s = Helper.Create(default(sbyte)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.csproj new file mode 100644 index 0000000..5462126 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.cs new file mode 100644 index 0000000..d6e47ec --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((short)(IComparable)o, Helper.Create(default(short))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((short?)(IComparable)o, Helper.Create(default(short))); + } + + private static int Main() + { + short? s = Helper.Create(default(short)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.csproj new file mode 100644 index 0000000..f3b9c52 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.cs new file mode 100644 index 0000000..35248d9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ushort using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ushort)(IComparable)o, Helper.Create(default(ushort))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ushort?)(IComparable)o, Helper.Create(default(ushort))); + } + + private static int Main() + { + ushort? s = Helper.Create(default(ushort)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.csproj new file mode 100644 index 0000000..87e51a1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.cs new file mode 100644 index 0000000..8ee21fa --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((int)(IComparable)o, Helper.Create(default(int))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((int?)(IComparable)o, Helper.Create(default(int))); + } + + private static int Main() + { + int? s = Helper.Create(default(int)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.csproj new file mode 100644 index 0000000..2364ec2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.cs new file mode 100644 index 0000000..44bb10d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of uint using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((uint)(IComparable)o, Helper.Create(default(uint))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((uint?)(IComparable)o, Helper.Create(default(uint))); + } + + private static int Main() + { + uint? s = Helper.Create(default(uint)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.csproj new file mode 100644 index 0000000..243d984 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.cs new file mode 100644 index 0000000..c6a9f32 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((long)(IComparable)o, Helper.Create(default(long))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((long?)(IComparable)o, Helper.Create(default(long))); + } + + private static int Main() + { + long? s = Helper.Create(default(long)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.csproj new file mode 100644 index 0000000..22070da --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.cs new file mode 100644 index 0000000..13cb443 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ulong using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((ulong)(IComparable)o, Helper.Create(default(ulong))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((ulong?)(IComparable)o, Helper.Create(default(ulong))); + } + + private static int Main() + { + ulong? s = Helper.Create(default(ulong)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.csproj new file mode 100644 index 0000000..1a0f7fb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.cs new file mode 100644 index 0000000..a3fc4c4 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((float)(IComparable)o, Helper.Create(default(float))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((float?)(IComparable)o, Helper.Create(default(float))); + } + + private static int Main() + { + float? s = Helper.Create(default(float)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.csproj new file mode 100644 index 0000000..8646695 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.cs new file mode 100644 index 0000000..b3de02f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of double using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((double)(IComparable)o, Helper.Create(default(double))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((double?)(IComparable)o, Helper.Create(default(double))); + } + + private static int Main() + { + double? s = Helper.Create(default(double)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.csproj new file mode 100644 index 0000000..3477173 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.cs new file mode 100644 index 0000000..9cea560 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQ(object o) + { + return Helper.Compare((decimal)(IComparable)o, Helper.Create(default(decimal))); + } + + private static bool BoxUnboxToQ(object o) + { + return Helper.Compare((decimal?)(IComparable)o, Helper.Create(default(decimal))); + } + + private static int Main() + { + decimal? s = Helper.Create(default(decimal)); + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.csproj new file mode 100644 index 0000000..43b21a5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/app.config new file mode 100644 index 0000000..8077c95 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.cs new file mode 100644 index 0000000..894005c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of char using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((char?)(ValueType)o) == null; + } + + private static int Main() + { + char? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.csproj new file mode 100644 index 0000000..9351f1c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.cs new file mode 100644 index 0000000..58396af --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((bool?)(ValueType)o) == null; + } + + private static int Main() + { + bool? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.csproj new file mode 100644 index 0000000..13c695e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.cs new file mode 100644 index 0000000..2d114e1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of byte using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((byte?)(ValueType)o) == null; + } + + private static int Main() + { + byte? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.csproj new file mode 100644 index 0000000..a67114c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.cs new file mode 100644 index 0000000..3012b72 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((sbyte?)(ValueType)o) == null; + } + + private static int Main() + { + sbyte? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.csproj new file mode 100644 index 0000000..e61fc61 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.cs new file mode 100644 index 0000000..70cf926 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of short using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((short?)(ValueType)o) == null; + } + + private static int Main() + { + short? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.csproj new file mode 100644 index 0000000..02dde3e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.cs new file mode 100644 index 0000000..c788691 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ushort?)(ValueType)o) == null; + } + + private static int Main() + { + ushort? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.csproj new file mode 100644 index 0000000..e4a4a04 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.cs new file mode 100644 index 0000000..ba8d11d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of int using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((int?)(ValueType)o) == null; + } + + private static int Main() + { + int? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.csproj new file mode 100644 index 0000000..ed8ac48 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.cs new file mode 100644 index 0000000..83f625c --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((uint?)(ValueType)o) == null; + } + + private static int Main() + { + uint? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.csproj new file mode 100644 index 0000000..a2e4ac7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.cs new file mode 100644 index 0000000..3a57b19 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of long using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((long?)(ValueType)o) == null; + } + + private static int Main() + { + long? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.csproj new file mode 100644 index 0000000..9b80335 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.cs new file mode 100644 index 0000000..0c08a82 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ulong?)(ValueType)o) == null; + } + + private static int Main() + { + ulong? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.csproj new file mode 100644 index 0000000..1979ef7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.cs new file mode 100644 index 0000000..f248d68 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of float using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((float?)(ValueType)o) == null; + } + + private static int Main() + { + float? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.csproj new file mode 100644 index 0000000..c91db41 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.cs new file mode 100644 index 0000000..270b1b1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((double?)(ValueType)o) == null; + } + + private static int Main() + { + double? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.csproj new file mode 100644 index 0000000..ed29b53 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.cs new file mode 100644 index 0000000..d0575f8 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of decimal using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((decimal?)(ValueType)o) == null; + } + + private static int Main() + { + decimal? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.csproj new file mode 100644 index 0000000..e76cbd5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.cs new file mode 100644 index 0000000..e21d634 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((IntPtr?)(ValueType)o) == null; + } + + private static int Main() + { + IntPtr? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.csproj new file mode 100644 index 0000000..c70633b --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.cs new file mode 100644 index 0000000..8837fb1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of UIntPtr using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((UIntPtr?)(ValueType)o) == null; + } + + private static int Main() + { + UIntPtr? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.csproj new file mode 100644 index 0000000..62dab5f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.cs new file mode 100644 index 0000000..c6eaa5d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((Guid?)(ValueType)o) == null; + } + + private static int Main() + { + Guid? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.csproj new file mode 100644 index 0000000..939ecb6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.cs new file mode 100644 index 0000000..2c00160 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of GCHandle using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((GCHandle?)(ValueType)o) == null; + } + + private static int Main() + { + GCHandle? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.csproj new file mode 100644 index 0000000..8b2dc40 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.cs new file mode 100644 index 0000000..1e38553 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ByteE?)(ValueType)o) == null; + } + + private static int Main() + { + ByteE? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.csproj new file mode 100644 index 0000000..9a29a06 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.cs new file mode 100644 index 0000000..3138756 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of IntE using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((IntE?)(ValueType)o) == null; + } + + private static int Main() + { + IntE? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.csproj new file mode 100644 index 0000000..6d72fc7 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.cs new file mode 100644 index 0000000..cfd735d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((LongE?)(ValueType)o) == null; + } + + private static int Main() + { + LongE? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.csproj new file mode 100644 index 0000000..45ca2a1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.cs new file mode 100644 index 0000000..74d90be --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of EmptyStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((EmptyStruct?)(ValueType)o) == null; + } + + private static int Main() + { + EmptyStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.csproj new file mode 100644 index 0000000..49b8bd2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.cs new file mode 100644 index 0000000..c2bd44e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStruct?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.csproj new file mode 100644 index 0000000..5c0dabc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.cs new file mode 100644 index 0000000..2c92062 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructQ using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructQ?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructQ? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.csproj new file mode 100644 index 0000000..3251ef2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.cs new file mode 100644 index 0000000..dfe7e1e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructA?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.csproj new file mode 100644 index 0000000..4a446c9 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.cs new file mode 100644 index 0000000..841d4ac --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructQA using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructQA?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructQA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.csproj new file mode 100644 index 0000000..9f37d91 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.cs new file mode 100644 index 0000000..651a157 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((EmptyStructGen?)(ValueType)o) == null; + } + + private static int Main() + { + EmptyStructGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.csproj new file mode 100644 index 0000000..bf9983f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.cs new file mode 100644 index 0000000..3b96a9f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructGen?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.csproj new file mode 100644 index 0000000..da5f096 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.cs new file mode 100644 index 0000000..f084169 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGen?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.csproj new file mode 100644 index 0000000..55f0eb5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.cs new file mode 100644 index 0000000..6cfa779 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructConstrainedGenA using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGenA?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGenA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.csproj new file mode 100644 index 0000000..66b6c84 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.cs new file mode 100644 index 0000000..bec7eef --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGenQ?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGenQ? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.csproj new file mode 100644 index 0000000..b150cea --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.cs new file mode 100644 index 0000000..7fe865a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NotEmptyStructConstrainedGenQA using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NotEmptyStructConstrainedGenQA?)(ValueType)o) == null; + } + + private static int Main() + { + NotEmptyStructConstrainedGenQA? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.csproj new file mode 100644 index 0000000..c1d4b5a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.cs new file mode 100644 index 0000000..81481d0 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NestedStruct?)(ValueType)o) == null; + } + + private static int Main() + { + NestedStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.csproj new file mode 100644 index 0000000..a18d818 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.cs new file mode 100644 index 0000000..dba81fc --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of NestedStructGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((NestedStructGen?)(ValueType)o) == null; + } + + private static int Main() + { + NestedStructGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.csproj new file mode 100644 index 0000000..96f27db --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.cs new file mode 100644 index 0000000..ad51d20 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ExplicitFieldOffsetStruct?)(ValueType)o) == null; + } + + private static int Main() + { + ExplicitFieldOffsetStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.csproj new file mode 100644 index 0000000..fbf1861 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.cs new file mode 100644 index 0000000..52c55a1 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of MarshalAsStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((MarshalAsStruct?)(ValueType)o) == null; + } + + private static int Main() + { + MarshalAsStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.csproj new file mode 100644 index 0000000..3e6482e --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.cs new file mode 100644 index 0000000..2d29dd6 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementOneInterface?)(ValueType)o) == null; + } + + private static int Main() + { + ImplementOneInterface? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.csproj new file mode 100644 index 0000000..b86cf7d --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.cs new file mode 100644 index 0000000..c00d9fd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementTwoInterface using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementTwoInterface?)(ValueType)o) == null; + } + + private static int Main() + { + ImplementTwoInterface? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.csproj new file mode 100644 index 0000000..ee1569a --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.cs new file mode 100644 index 0000000..b041a1f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementOneInterfaceGen?)(ValueType)o) == null; + } + + private static int Main() + { + ImplementOneInterfaceGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.csproj new file mode 100644 index 0000000..7a8fed5 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.cs new file mode 100644 index 0000000..96c2c80 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of ImplementTwoInterfaceGen using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementTwoInterfaceGen?)(ValueType)o) == null; + } + + private static int Main() + { + ImplementTwoInterfaceGen? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.csproj new file mode 100644 index 0000000..48007be --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.cs new file mode 100644 index 0000000..b48e925 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((ImplementAllInterface?)(ValueType)o) == null; + } + + private static int Main() + { + ImplementAllInterface? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.csproj new file mode 100644 index 0000000..85e5ddf --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.cs new file mode 100644 index 0000000..7d156eb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of WithMultipleGCHandleStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((WithMultipleGCHandleStruct?)(ValueType)o) == null; + } + + private static int Main() + { + WithMultipleGCHandleStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.csproj new file mode 100644 index 0000000..b2cadbb --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.cs new file mode 100644 index 0000000..32708cd --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((WithOnlyFXTypeStruct?)(ValueType)o) == null; + } + + private static int Main() + { + WithOnlyFXTypeStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.csproj new file mode 100644 index 0000000..0c180db --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.cs new file mode 100644 index 0000000..b9d8fa2 --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Nullable - CastClass +// Nullable type with castclass expr +// +// checking type of MixedAllStruct using cast expr +// +// +// +// + + +using System.Runtime.InteropServices; +using System; + +internal class NullableTest +{ + private static bool BoxUnboxToNQGen(T o) + { + return ((ValueType)(object)o) == null; + } + + private static bool BoxUnboxToQGen(T? o) where T : struct + { + return ((T?)(object)(ValueType)o) == null; + } + + private static bool BoxUnboxToNQ(object o) + { + return ((ValueType)o) == null; + } + + private static bool BoxUnboxToQ(object o) + { + return ((MixedAllStruct?)(ValueType)o) == null; + } + + private static int Main() + { + MixedAllStruct? s = null; + + if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s)) + return ExitCode.Passed; + else + return ExitCode.Failed; + } +} + + diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.csproj new file mode 100644 index 0000000..4fd6d4f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + Properties + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + $(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages + ..\..\ + true + 7a9bfb7d + + + + + + + + + False + + + + + + + + + + + + + + + + + + $(JitPackagesConfigFileDirectory)minimal\project.json + $(JitPackagesConfigFileDirectory)minimal\project.lock.json + + + + + \ No newline at end of file diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/structdef.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/structdef.cs new file mode 100644 index 0000000..1a1105f --- /dev/null +++ b/tests/src/JIT/jit64/valuetypes/nullable/castclass/structdef.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#pragma warning disable 0183 + +using System.Runtime.InteropServices; +using System; +using System.ComponentModel; +// primitives / CLR Types + +// interfaces +public interface IEmpty { } +public interface INotEmpty +{ + void DoNothing(); +} + +// generic interfaces +public interface IEmptyGen { } +public interface INotEmptyGen +{ + void DoNothing(); +} + +// struct +public struct EmptyStruct { } +public struct NotEmptyStruct +{ + public int Field; +} + +public struct NotEmptyStructQ +{ + public int? Field; +} + +public struct NotEmptyStructA +{ + public int[] Field; +} + +public struct NotEmptyStructQA +{ + public int?[] Field; +} + +// generic structs +public struct EmptyStructGen { } +public struct NotEmptyStructGen +{ + public T Field; +} + +public struct NotEmptyStructConstrainedGen where T : struct +{ + public T Field; +} + +public struct NotEmptyStructConstrainedGenA where T : struct +{ + public T[] Field; +} + +public struct NotEmptyStructConstrainedGenQ where T : struct +{ + public T? Field; +} + +public struct NotEmptyStructConstrainedGenQA where T : struct +{ + public T?[] Field; +} + +// nested struct +public struct NestedStruct +{ + public struct Nested { } +} + +public struct NestedStructGen +{ + public struct Nested { } +} + + +// struct with Field Offset +[StructLayout(LayoutKind.Explicit)] +public struct ExplicitFieldOffsetStruct +{ + [FieldOffset(0)] + public int Field00; + [FieldOffset(0x0f)] + public int Field15; +} + +// struct with Attributes +internal struct MarshalAsStruct +{ + [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] + public string StringField; +} + +// struct implement interfaces +internal struct ImplementOneInterface : IEmpty { } + +internal struct ImplementTwoInterface : IEmpty, INotEmpty +{ + public void DoNothing() { } +} + +internal struct ImplementOneInterfaceGen : IEmptyGen { } + +internal struct ImplementTwoInterfaceGen : IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } +} + +internal struct ImplementAllInterface : IEmpty, INotEmpty, IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } + void INotEmptyGen.DoNothing() { } +} + +// enums +public enum IntE { start = 1, } +public enum ByteE : byte { start = 1, } +public enum LongE : long { start = 1, } + + +// other intersting structs +public struct WithMultipleGCHandleStruct +{ + public GCHandle H1; + public GCHandle H2; + public GCHandle H3; + public GCHandle H4; + public GCHandle H5; +} + +public struct WithOnlyFXTypeStruct +{ + public Guid GUID; + public decimal DECIMAL; +} + + +public struct MixedAllStruct +{ + public int INT; + public int? IntQ; + public int?[] IntQA; + public string STRING; + public IntE INTE; + public EmptyClass EMPTYCLASS; + public IEmpty IEMPTY; + public EmptyStruct EMPTYSTRUCT; + public IEmptyGen IEMPTYGEN; + public EmptyStructGen EMPTYSTRUCTGEN; + public WithOnlyFXTypeStruct WITHONLYFXTYPESTRUCT; + public GCHandle GCHANDLE; +} + + +// other types +public struct EmptyClass { } +public struct NotEmptyClass +{ + public int Field; +} + +public struct EmptyClassGen { } +public struct NotEmptyClassGen +{ + public T Field; +} + +public struct NotEmptyClassConstrainedGen where T : class +{ + public T Field; +} +public struct NestedClass +{ + public struct Nested { } +} + +public struct NestedClassGen +{ + public struct Nested { } +} + +internal class ImplementOneInterfaceC : IEmpty { } + +internal class ImplementTwoInterfaceC : IEmpty, INotEmpty +{ + public void DoNothing() { } +} + +internal class ImplementOneInterfaceGenC : IEmptyGen { } + +internal class ImplementTwoInterfaceGenC : IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } +} + +internal class ImplementAllInterfaceC : IEmpty, INotEmpty, IEmptyGen, INotEmptyGen +{ + public void DoNothing() { } + void INotEmptyGen.DoNothing() { } +} + +public sealed class SealedClass { } + +public delegate void SimpleDelegate(); +public delegate void GenericDelegate(); + + +// ExitCode +public static class ExitCode +{ + public static int Failed = 101; + public static int Passed = 100; +} + + +// Create Value Instance +internal static class Helper +{ + public static GCHandle GCHANDLE; + static Helper() + { + GCHANDLE = GCHandle.Alloc(System.Console.Out); + } + + public static char Create(char val) { return 'c'; } + public static bool Create(bool val) { return true; } + public static byte Create(byte val) { return 0x08; } + public static sbyte Create(sbyte val) { return -0x0e; } + public static short Create(short val) { return -0x0f; } + public static ushort Create(ushort val) { return 0xff; } + public static int Create(int val) { return 100; } + public static uint Create(uint val) { return 200; } + public static long Create(long val) { return int.MaxValue; } + public static ulong Create(ulong val) { return 300; } + public static float Create(float val) { return 1.15f; } + public static double Create(double val) { return 0.05; } + public static decimal Create(decimal val) { return 1.0M; } + + public static IntPtr Create(IntPtr val) { return (IntPtr)1000; } + public static UIntPtr Create(UIntPtr val) { return (UIntPtr)2000; } + public static Guid Create(Guid val) { return new Guid("00020810-0001-0000-C000-000000000046"); } + public static GCHandle Create(GCHandle val) { return GCHANDLE; } + public static ByteE Create(ByteE val) { return (ByteE)9; } + public static IntE Create(IntE val) { return (IntE)55; } + public static LongE Create(LongE val) { return (LongE)34; } + public static EmptyStruct Create(EmptyStruct val) { return new EmptyStruct(); } + public static NotEmptyStruct Create(NotEmptyStruct val) { NotEmptyStruct ne = new NotEmptyStruct(); ne.Field = 100; return ne; } + public static NotEmptyStructQ Create(NotEmptyStructQ val) { NotEmptyStructQ neq = new NotEmptyStructQ(); neq.Field = 101; return neq; } + public static NotEmptyStructA Create(NotEmptyStructA val) { NotEmptyStructA nea = new NotEmptyStructA(); nea.Field = new int[] { 10 }; return nea; } + public static NotEmptyStructQA Create(NotEmptyStructQA val) { NotEmptyStructQA neq = new NotEmptyStructQA(); neq.Field = new int?[] { 10 }; return neq; } + public static EmptyStructGen Create(EmptyStructGen val) { return new EmptyStructGen(); } + public static NotEmptyStructGen Create(NotEmptyStructGen val) { NotEmptyStructGen ne = new NotEmptyStructGen(); ne.Field = 88; return ne; } + public static NotEmptyStructConstrainedGen Create(NotEmptyStructConstrainedGen val) { NotEmptyStructConstrainedGen ne = new NotEmptyStructConstrainedGen(); ne.Field = 1010; return ne; } + public static NotEmptyStructConstrainedGenA Create(NotEmptyStructConstrainedGenA val) { NotEmptyStructConstrainedGenA neq = new NotEmptyStructConstrainedGenA(); neq.Field = new int[] { 11 }; return neq; } + public static NotEmptyStructConstrainedGenQ Create(NotEmptyStructConstrainedGenQ val) { NotEmptyStructConstrainedGenQ neq = new NotEmptyStructConstrainedGenQ(); neq.Field = 12; return neq; } + public static NotEmptyStructConstrainedGenQA Create(NotEmptyStructConstrainedGenQA val) { NotEmptyStructConstrainedGenQA neq = new NotEmptyStructConstrainedGenQA(); neq.Field = new int?[] { 17 }; return neq; } + public static NestedStruct Create(NestedStruct val) { NestedStruct ns = new NestedStruct(); return ns; } + public static NestedStructGen Create(NestedStructGen val) { NestedStructGen nsg = new NestedStructGen(); return nsg; } + public static ExplicitFieldOffsetStruct Create(ExplicitFieldOffsetStruct val) { ExplicitFieldOffsetStruct epl = new ExplicitFieldOffsetStruct(); epl.Field00 = 40; epl.Field15 = 15; return epl; } + public static MarshalAsStruct Create(MarshalAsStruct val) { MarshalAsStruct ma = new MarshalAsStruct(); ma.StringField = "Nullable"; return ma; } + public static ImplementOneInterface Create(ImplementOneInterface val) { ImplementOneInterface imp = new ImplementOneInterface(); return imp; } + public static ImplementTwoInterface Create(ImplementTwoInterface val) { ImplementTwoInterface imp = new ImplementTwoInterface(); return imp; } + public static ImplementOneInterfaceGen Create(ImplementOneInterfaceGen val) { ImplementOneInterfaceGen imp = new ImplementOneInterfaceGen(); return imp; } + public static ImplementTwoInterfaceGen Create(ImplementTwoInterfaceGen val) { ImplementTwoInterfaceGen imp = new ImplementTwoInterfaceGen(); return imp; } + public static ImplementAllInterface Create(ImplementAllInterface val) { ImplementAllInterface imp = new ImplementAllInterface(); return imp; } + public static WithMultipleGCHandleStruct Create(WithMultipleGCHandleStruct val) + { WithMultipleGCHandleStruct mgch = new WithMultipleGCHandleStruct(); mgch.H1 = GCHANDLE; mgch.H2 = GCHANDLE; mgch.H3 = GCHANDLE; mgch.H4 = GCHANDLE; mgch.H5 = GCHANDLE; return mgch; } + public static WithOnlyFXTypeStruct Create(WithOnlyFXTypeStruct val) { WithOnlyFXTypeStruct wofx = new WithOnlyFXTypeStruct(); wofx.DECIMAL = 50.0m; wofx.GUID = Create(default(Guid)); return wofx; } + public static MixedAllStruct Create(MixedAllStruct val) + { + MixedAllStruct mas; + mas.INT = 10; + mas.IntQ = null; + mas.IntQA = new int?[] { 10 }; + mas.STRING = "Nullable"; + mas.INTE = Create(default(IntE)); + mas.EMPTYCLASS = new EmptyClass(); + mas.IEMPTY = Create(default(ImplementOneInterface)); + mas.EMPTYSTRUCT = Create(default(EmptyStruct)); + mas.IEMPTYGEN = Create(default(ImplementOneInterfaceGen)); + mas.EMPTYSTRUCTGEN = Create(default(EmptyStructGen)); + mas.WITHONLYFXTYPESTRUCT = Create(default(WithOnlyFXTypeStruct)); + mas.GCHANDLE = Create(default(GCHandle)); + + return mas; + } + + public static bool Compare(char val, char val1) { return val == val1; } + public static bool Compare(bool val, bool val1) { return val == val1; } + public static bool Compare(byte val, byte val1) { return val == val1; } + public static bool Compare(sbyte val, sbyte val1) { return val == val1; } + public static bool Compare(short val, short val1) { return val == val1; } + public static bool Compare(ushort val, ushort val1) { return val == val1; } + public static bool Compare(int val, int val1) { return val == val1; } + public static bool Compare(uint val, uint val1) { return val == val1; } + public static bool Compare(long val, long val1) { return val == val1; } + public static bool Compare(ulong val, ulong val1) { return val == val1; } + public static bool Compare(float val, float val1) { return val == val1; } + public static bool Compare(double val, double val1) { return val == val1; } + public static bool Compare(decimal val, decimal val1) { return val == val1; } + + public static bool Compare(IntPtr val, IntPtr val1) { return val == val1; } + public static bool Compare(UIntPtr val, UIntPtr val1) { return val == val1; } + public static bool Compare(Guid val, Guid val1) { return val == val1; } + public static bool Compare(GCHandle val, GCHandle val1) { return val == val1; } + public static bool Compare(ByteE val, ByteE val1) { return val == val1; } + public static bool Compare(IntE val, IntE val1) { return val == val1; } + public static bool Compare(LongE val, LongE val1) { return val == val1; } + public static bool Compare(EmptyStruct val, EmptyStruct val1) { return val.Equals(val1); } + public static bool Compare(NotEmptyStruct val, NotEmptyStruct val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructQ val, NotEmptyStructQ val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructA val, NotEmptyStructA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(NotEmptyStructQA val, NotEmptyStructQA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(EmptyStructGen val, EmptyStructGen val1) { return val.Equals(val1); } + public static bool Compare(NotEmptyStructGen val, NotEmptyStructGen val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructConstrainedGen val, NotEmptyStructConstrainedGen val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructConstrainedGenA val, NotEmptyStructConstrainedGenA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(NotEmptyStructConstrainedGenQ val, NotEmptyStructConstrainedGenQ val1) { return val.Field == val1.Field; } + public static bool Compare(NotEmptyStructConstrainedGenQA val, NotEmptyStructConstrainedGenQA val1) { return val.Field[0] == val1.Field[0]; } + public static bool Compare(NestedStruct val, NestedStruct val1) { return val.Equals(val1); } + public static bool Compare(NestedStructGen val, NestedStructGen val1) { return val.Equals(val1); } + public static bool Compare(ExplicitFieldOffsetStruct val, ExplicitFieldOffsetStruct val1) { return (val.Field00 == val1.Field00) && (val.Field15 == val1.Field15); } + public static bool Compare(MarshalAsStruct val, MarshalAsStruct val1) { return val.Equals(val1); } + public static bool Compare(ImplementOneInterface val, ImplementOneInterface val1) { return (val is IEmpty) && val.Equals(val1); } + public static bool Compare(ImplementTwoInterface val, ImplementTwoInterface val1) { return (val is IEmpty) && val is INotEmpty && val.Equals(val1); } + public static bool Compare(ImplementOneInterfaceGen val, ImplementOneInterfaceGen val1) { return val is IEmptyGen && val.Equals(val1); } + public static bool Compare(ImplementTwoInterfaceGen val, ImplementTwoInterfaceGen val1) { return val is IEmptyGen && val is INotEmptyGen && val.Equals(val1); } + public static bool Compare(ImplementAllInterface val, ImplementAllInterface val1) { return val is IEmpty && val is INotEmpty && val is IEmptyGen && val is INotEmptyGen && val.Equals(val1); } + public static bool Compare(WithMultipleGCHandleStruct val, WithMultipleGCHandleStruct val1) + { return val.H1 == val1.H1 && val.H2 == val1.H2 && val.H3 == val1.H3 && val.H4 == val1.H4 && val.H5 == val1.H5; } + public static bool Compare(WithOnlyFXTypeStruct val, WithOnlyFXTypeStruct val1) { return val.GUID == val1.GUID && val.DECIMAL == val1.DECIMAL; } + public static bool Compare(MixedAllStruct val, MixedAllStruct val1) + { + return val.INT == val1.INT && + val.IntQ == val1.IntQ && + val.IntQA[0] == val1.IntQA[0] && + val.STRING == val1.STRING && + val.INTE == val1.INTE && + val.EMPTYCLASS.Equals(val1.EMPTYCLASS) && + val.IEMPTY.Equals(val1.IEMPTY) && + Compare(val.EMPTYSTRUCT, val1.EMPTYSTRUCT) && + val.IEMPTYGEN.Equals(val1.IEMPTYGEN) && + Compare(val.EMPTYSTRUCTGEN, val1.EMPTYSTRUCTGEN) && + Compare(val.WITHONLYFXTYPESTRUCT, val1.WITHONLYFXTYPESTRUCT) && + Compare(val.GCHANDLE, val1.GCHANDLE); + } + + public static bool Compare(char? val, char val1) { return Compare(val.Value, val1); } + public static bool Compare(bool? val, bool val1) { return Compare(val.Value, val1); } + public static bool Compare(byte? val, byte val1) { return Compare(val.Value, val1); } + public static bool Compare(sbyte? val, sbyte val1) { return Compare(val.Value, val1); } + public static bool Compare(short? val, short val1) { return Compare(val.Value, val1); } + public static bool Compare(ushort? val, ushort val1) { return Compare(val.Value, val1); } + public static bool Compare(int? val, int val1) { return Compare(val.Value, val1); } + public static bool Compare(uint? val, uint val1) { return Compare(val.Value, val1); } + public static bool Compare(long? val, long val1) { return Compare(val.Value, val1); } + public static bool Compare(ulong? val, ulong val1) { return Compare(val.Value, val1); } + public static bool Compare(float? val, float val1) { return Compare(val.Value, val1); } + public static bool Compare(double? val, double val1) { return Compare(val.Value, val1); } + public static bool Compare(decimal? val, decimal val1) { return Compare(val.Value, val1); } + + public static bool Compare(IntPtr? val, IntPtr val1) { return Compare(val.Value, val1); } + public static bool Compare(UIntPtr? val, UIntPtr val1) { return Compare(val.Value, val1); } + public static bool Compare(Guid? val, Guid val1) { return Compare(val.Value, val1); } + public static bool Compare(GCHandle? val, GCHandle val1) { return Compare(val.Value, val1); } + public static bool Compare(ByteE? val, ByteE val1) { return Compare(val.Value, val1); } + public static bool Compare(IntE? val, IntE val1) { return Compare(val.Value, val1); } + public static bool Compare(LongE? val, LongE val1) { return Compare(val.Value, val1); } + public static bool Compare(EmptyStruct? val, EmptyStruct val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStruct? val, NotEmptyStruct val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructQ? val, NotEmptyStructQ val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructA? val, NotEmptyStructA val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructQA? val, NotEmptyStructQA val1) { return Compare(val.Value, val1); } + public static bool Compare(EmptyStructGen? val, EmptyStructGen val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructGen? val, NotEmptyStructGen val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGen? val, NotEmptyStructConstrainedGen val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGenA? val, NotEmptyStructConstrainedGenA val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGenQ? val, NotEmptyStructConstrainedGenQ val1) { return Compare(val.Value, val1); } + public static bool Compare(NotEmptyStructConstrainedGenQA? val, NotEmptyStructConstrainedGenQA val1) { return Compare(val.Value, val1); } + public static bool Compare(NestedStruct? val, NestedStruct val1) { return Compare(val.Value, val1); } + public static bool Compare(NestedStructGen? val, NestedStructGen val1) { return Compare(val.Value, val1); } + public static bool Compare(ExplicitFieldOffsetStruct? val, ExplicitFieldOffsetStruct val1) { return Compare(val.Value, val1); } + public static bool Compare(MarshalAsStruct? val, MarshalAsStruct val1) { return Compare(val.Value, val1); } + public static bool Compare(ImplementOneInterface? val, ImplementOneInterface val1) { return Compare(val.Value, val1); } + public static bool Compare(ImplementTwoInterface? val, ImplementTwoInterface val1) { return Compare(val.Value, val1); } + public static bool Compare(ImplementOneInterfaceGen? val, ImplementOneInterfaceGen val1) { return Compare(val.Value, val1); } + public static bool Compare(ImplementTwoInterfaceGen? val, ImplementTwoInterfaceGen val1) { return Compare(val.Value, val1); } + public static bool Compare(ImplementAllInterface? val, ImplementAllInterface val1) { return Compare(val.Value, val1); } + public static bool Compare(WithMultipleGCHandleStruct? val, WithMultipleGCHandleStruct val1) { return Compare(val.Value, val1); } + public static bool Compare(WithOnlyFXTypeStruct? val, WithOnlyFXTypeStruct val1) { return Compare(val.Value, val1); } + public static bool Compare(MixedAllStruct? val, MixedAllStruct val1) { return Compare(val.Value, val1); } +}