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-06-26 14:14:46 +0300
committerMarek Safar <marek.safar@gmail.com>2018-06-27 14:43:24 +0300
commit439625bba1d374a08263519a813f95ff619fc56d (patch)
treeaf461a47b8ce7be16d89ae6b11f5b2c3ca7522b0 /mcs/tests
parent903e2633157ec158ba31eee9824654caa5ac6ad6 (diff)
[mcs] Implements C# 7.3 extensible fixed statement
Part of #6854
Diffstat (limited to 'mcs/tests')
-rw-r--r--mcs/tests/test-fixed-01.cs20
-rw-r--r--mcs/tests/ver-il-net_4_x.xml15
2 files changed, 35 insertions, 0 deletions
diff --git a/mcs/tests/test-fixed-01.cs b/mcs/tests/test-fixed-01.cs
new file mode 100644
index 00000000000..4684b0c5a06
--- /dev/null
+++ b/mcs/tests/test-fixed-01.cs
@@ -0,0 +1,20 @@
+// Compiler options: -unsafe -langversion:latest
+
+unsafe class C
+{
+ public static void Main ()
+ {
+ fixed (int* p = new Fixable ()) {
+ System.Console.WriteLine (*p);
+ System.Console.WriteLine (p [2]);
+ }
+ }
+
+ struct Fixable
+ {
+ public ref int GetPinnableReference ()
+ {
+ return ref (new int[] { 1, 2, 3 })[0];
+ }
+ }
+} \ 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 8219768a058..a91a290814f 100644
--- a/mcs/tests/ver-il-net_4_x.xml
+++ b/mcs/tests/ver-il-net_4_x.xml
@@ -69314,6 +69314,21 @@
</method>
</type>
</test>
+ <test name="test-fixed-01.cs">
+ <type name="C">
+ <method name="Void Main()" attrs="150">
+ <size>39</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="C+Fixable">
+ <method name="Int32&amp; GetPinnableReference()" attrs="134">
+ <size>32</size>
+ </method>
+ </type>
+ </test>
<test name="test-interpolation-01.cs">
<type name="Test">
<method name="Int32 Main()" attrs="150">