diff options
Diffstat (limited to 'tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs')
-rw-r--r-- | tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs | 40 |
1 files changed, 40 insertions, 0 deletions
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 0000000000..d57b7b34e6 --- /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. + +// <Area> Nullable - Box-Unbox </Area> +// <Title> Nullable type with unbox box expr </Title> +// <Description> +// checking type of int using is operator +// </Description> +// <RelatedBugs> </RelatedBugs> +//<Expects Status=success></Expects> +// <Code> + + +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; + } +} + + |