diff options
Diffstat (limited to 'tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs')
-rw-r--r-- | tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs | 31 |
1 files changed, 31 insertions, 0 deletions
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 0000000000..1ec8e9f72e --- /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; + } +} + + |