diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-01-02 19:16:49 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-01-03 13:23:29 +0300 |
commit | 5de513945b76d29d9704e167e7ba05f4abfa8c29 (patch) | |
tree | 8084805d6d8da142aa8424090f2e2620283359b4 /mcs/tests | |
parent | e23e916f26abdda2b7ef6f65d4ae844081ee66a1 (diff) |
[mcs] Allow calling by-ref types virtual methods which can be devirtualized.
Diffstat (limited to 'mcs/tests')
-rw-r--r-- | mcs/tests/test-ref-10.cs | 24 | ||||
-rw-r--r-- | mcs/tests/ver-il-net_4_x.xml | 15 |
2 files changed, 39 insertions, 0 deletions
diff --git a/mcs/tests/test-ref-10.cs b/mcs/tests/test-ref-10.cs new file mode 100644 index 00000000000..88e201d3174 --- /dev/null +++ b/mcs/tests/test-ref-10.cs @@ -0,0 +1,24 @@ +// Compiler options: -langversion:latest + +using System; + +ref struct ValueStringBuilder +{ + public override string ToString () + { + return "aaa"; + } +} + + +class X +{ + public static int Main () + { + var s = new ValueStringBuilder (); + if (s.ToString () != "aaa") + return 1; + + return 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 0352e5c601d..8f37458a29d 100644 --- a/mcs/tests/ver-il-net_4_x.xml +++ b/mcs/tests/ver-il-net_4_x.xml @@ -73203,6 +73203,21 @@ </method> </type> </test> + <test name="test-ref-10.cs"> + <type name="ValueStringBuilder"> + <method name="System.String ToString()" attrs="198"> + <size>14</size> + </method> + </type> + <type name="X"> + <method name="Int32 Main()" attrs="150"> + <size>47</size> + </method> + <method name="Void .ctor()" attrs="6278"> + <size>7</size> + </method> + </type> + </test> <test name="test-static-using-01.cs"> <type name="A.B.X"> <method name="Int32 Test()" attrs="150"> |