summaryrefslogtreecommitdiff
path: root/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs')
-rw-r--r--tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs40
1 files changed, 40 insertions, 0 deletions
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 0000000000..4bf7b50a86
--- /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.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr </Title>
+// <Description>
+// checking type of float 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((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;
+ }
+}
+
+