diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2015-12-04 14:22:14 -0800 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2015-12-04 15:57:25 -0800 |
commit | d999a0aa9df21107e213f1c491b8961838e47a2e (patch) | |
tree | 83878ac83ddac7b33ec7669f0eb122abe1576a76 /tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs | |
parent | 4feb6c40dd4d60783b54d8b58431bf069c143796 (diff) | |
download | coreclr-d999a0aa9df21107e213f1c491b8961838e47a2e.tar.gz coreclr-d999a0aa9df21107e213f1c491b8961838e47a2e.tar.bz2 coreclr-d999a0aa9df21107e213f1c491b8961838e47a2e.zip |
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.
Diffstat (limited to 'tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs')
-rw-r--r-- | tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs | 31 |
1 files changed, 31 insertions, 0 deletions
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 0000000000..4632d2e983 --- /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; + } +} + + |