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:
authorBijan Tabatabai <bijan311@yahoo.com>2019-01-11 05:59:41 +0300
committerMarek Safar <marek.safar@gmail.com>2019-06-05 14:08:59 +0300
commita3de0304a190c54124df3486ce9c34b6262787a8 (patch)
treec3cbd02c40e52494a2ddf0c40471763c189882ea /mcs/tests
parent644bfc93d4bec824d38f83850746a2a3132a6200 (diff)
Align mcs's tuple deconstruction behavior with csc
Before the code (a, b) = (b, a); was the equivalent of a = b; b = a; now, it evaluates it to so something like tmp1 = a; tmp2 = b; a = tmp2; b = tmp1; Signed-off-by: Bijan Tabatabai <bijan311@yahoo.com>
Diffstat (limited to 'mcs/tests')
-rw-r--r--mcs/tests/test-tuple-11.cs20
-rw-r--r--mcs/tests/ver-il-net_4_x.xml10
2 files changed, 30 insertions, 0 deletions
diff --git a/mcs/tests/test-tuple-11.cs b/mcs/tests/test-tuple-11.cs
new file mode 100644
index 00000000000..b2aeb24026c
--- /dev/null
+++ b/mcs/tests/test-tuple-11.cs
@@ -0,0 +1,20 @@
+using System;
+
+class Program
+{
+ public static int Main ()
+ {
+ int x = 1;
+ int y = 2;
+
+ (x, y) = (y, x);
+
+ if (x != 2)
+ return 1;
+
+ if (y != 1)
+ return 2;
+
+ return 0;
+ }
+}
diff --git a/mcs/tests/ver-il-net_4_x.xml b/mcs/tests/ver-il-net_4_x.xml
index fa750278297..4ad26da95f7 100644
--- a/mcs/tests/ver-il-net_4_x.xml
+++ b/mcs/tests/ver-il-net_4_x.xml
@@ -74502,6 +74502,16 @@
</method>
</type>
</test>
+ <test name="test-tuple-11.cs">
+ <type name="Program">
+ <method name="Int32 Main()" attrs="150">
+ <size>70</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-var-01.cs">
<type name="Test">
<method name="Int32 Main()" attrs="150">