Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/tests
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2018-04-05 18:15:05 +0300
committerMarek Safar <marek.safar@gmail.com>2018-04-06 09:28:31 +0300
commitd7bb7151a830587f1ad784c5fde2c892c4b91d49 (patch)
tree0ae3730d11d5e7002f75634f0fbad90934379ef0 /mcs/tests
parent774f43c0f99b6f73e4feffcd279bc0cc83400d03 (diff)
[mcs] Implements C# 7.2 stackalloc span conversion in conditional expression
Diffstat (limited to 'mcs/tests')
-rw-r--r--mcs/tests/test-948.cs12
-rw-r--r--mcs/tests/ver-il-net_4_x.xml2
2 files changed, 10 insertions, 4 deletions
diff --git a/mcs/tests/test-948.cs b/mcs/tests/test-948.cs
index 34b3ab9a0c4..563e37dc7d5 100644
--- a/mcs/tests/test-948.cs
+++ b/mcs/tests/test-948.cs
@@ -1,4 +1,4 @@
-// Compiler options: -langversion:7.2 -unsafe
+// Compiler options: -langversion:7.2 /unsafe
using System;
@@ -7,10 +7,16 @@ class X
public static void Main ()
{
Span<int> stackSpan = stackalloc int[100];
+
+ bool b = false;
+
+ var r1 = !b ? stackalloc char[1] : throw null;
+ var r2 = b ? throw null : stackalloc char[1];
+ var r3 = b ? stackalloc char[1] : stackalloc char[2];
}
+ // Disables verifier
unsafe void Foo ()
{
-
}
-} \ No newline at end of file
+}
diff --git a/mcs/tests/ver-il-net_4_x.xml b/mcs/tests/ver-il-net_4_x.xml
index d839d5978e9..20ac5d53baf 100644
--- a/mcs/tests/ver-il-net_4_x.xml
+++ b/mcs/tests/ver-il-net_4_x.xml
@@ -52862,7 +52862,7 @@
<test name="test-948.cs">
<type name="X">
<method name="Void Main()" attrs="150">
- <size>16</size>
+ <size>103</size>
</method>
<method name="Void Foo()" attrs="129">
<size>2</size>