diff options
Diffstat (limited to 'tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs')
-rw-r--r-- | tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs | 40 |
1 files changed, 40 insertions, 0 deletions
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 0000000000..a4dcc454ed --- /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. + +// <Area> Nullable - Box-Unbox </Area> +// <Title> Nullable type with unbox box expr </Title> +// <Description> +// checking type of IntE 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((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; + } +} + + |