You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
17
mcs/tests/gtest-638.cs
Normal file
17
mcs/tests/gtest-638.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
class X<T1, T2, U>
|
||||
where T1 : class, T2
|
||||
where T2 : class
|
||||
where U : A, T1
|
||||
{
|
||||
}
|
||||
|
||||
class A
|
||||
{
|
||||
}
|
||||
|
||||
class F
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
47
mcs/tests/gtest-639.cs
Normal file
47
mcs/tests/gtest-639.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
class A<T> where T : CB, IA
|
||||
{
|
||||
void Foo (T t)
|
||||
{
|
||||
t.Prop = 3;
|
||||
long l = t.Prop2;
|
||||
t["1"] = "2";
|
||||
}
|
||||
}
|
||||
|
||||
class A2<T, U>
|
||||
where T : CB, U
|
||||
where U : IA
|
||||
{
|
||||
void Foo (T t)
|
||||
{
|
||||
t.Prop = 3;
|
||||
long l = t.Prop2;
|
||||
t["1"] = "2";
|
||||
}
|
||||
}
|
||||
|
||||
class CB : CA
|
||||
{
|
||||
}
|
||||
|
||||
class CA
|
||||
{
|
||||
public int Prop { get; set; }
|
||||
|
||||
public string this [byte b] { get { return ""; } }
|
||||
}
|
||||
|
||||
interface IA
|
||||
{
|
||||
string Prop { get; set; }
|
||||
long Prop2 { get; }
|
||||
|
||||
string this [string b] { get; set; }
|
||||
}
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: Test]
|
||||
|
||||
@@ -130,7 +131,8 @@ public class ClassMain
|
||||
Assert (ei.GetRemoveMethod ().GetCustomAttributes (true), false, 44);
|
||||
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), false, 45);
|
||||
FieldInfo fi = typeof(Test_3).GetField ("e_1", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
Assert (fi.GetCustomAttributes (true), true, 46);
|
||||
Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 46);
|
||||
Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), true, 47);
|
||||
|
||||
ei = typeof(Test_3).GetEvent ("e_2");
|
||||
Assert (ei.GetCustomAttributes (true), false, 51);
|
||||
@@ -139,7 +141,8 @@ public class ClassMain
|
||||
Assert (ei.GetRemoveMethod ().GetCustomAttributes (true), true, 54);
|
||||
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), false, 55);
|
||||
fi = typeof(Test_3).GetField ("e_2", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
Assert (fi.GetCustomAttributes (true), false, 56);
|
||||
Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 56);
|
||||
Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), false, 57);
|
||||
|
||||
ei = typeof(Test_4).GetEvent ("e_2");
|
||||
Assert (ei.GetCustomAttributes (true), false, 71);
|
||||
@@ -148,7 +151,8 @@ public class ClassMain
|
||||
Assert (ei.GetRemoveMethod ().GetCustomAttributes (true), false, 74);
|
||||
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), true, 75);
|
||||
fi = typeof(Test_3).GetField ("e_2", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
Assert (fi.GetCustomAttributes (true), false, 76);
|
||||
Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 76);
|
||||
Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), false, 77);
|
||||
|
||||
ei = typeof(Test_4).GetEvent ("e_3");
|
||||
Assert (ei.GetCustomAttributes (true), false, 81);
|
||||
@@ -159,7 +163,8 @@ public class ClassMain
|
||||
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), false, 86);
|
||||
Assert (ei.GetRemoveMethod ().GetParameters ()[0].GetCustomAttributes (true), true, 87);
|
||||
fi = typeof(Test_3).GetField ("e_2", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
Assert (fi.GetCustomAttributes (true), false, 88);
|
||||
Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 86);
|
||||
Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), false, 87);
|
||||
|
||||
return failed ? 1 : 0;
|
||||
}
|
||||
|
15
mcs/tests/test-937.cs
Normal file
15
mcs/tests/test-937.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// Compiler options: /noconfig /nostdlib -r:../class/lib/net_4_x/Facades/System.Runtime.dll -r:../class/lib/net_4_x/mscorlib.dll
|
||||
|
||||
using System;
|
||||
|
||||
class TypeForwarderOfSystemObject
|
||||
{
|
||||
void TestAttributeReadDoesNotCrash ()
|
||||
{
|
||||
System.Runtime.InteropServices.Marshal.ReadByte (IntPtr.Zero, 0);
|
||||
}
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
31
mcs/tests/test-940.cs
Normal file
31
mcs/tests/test-940.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
// Compiler options: -unsafe
|
||||
|
||||
using System;
|
||||
|
||||
struct nint
|
||||
{
|
||||
public static nint operator * (nint a, nint b)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
public static implicit operator long (nint v)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
nint width;
|
||||
nint bytesPerRow;
|
||||
|
||||
unsafe {
|
||||
var da = (uint*)0;
|
||||
var dp1 = da + width * bytesPerRow;
|
||||
var dp2 = width * bytesPerRow + da;
|
||||
}
|
||||
}
|
||||
}
|
30
mcs/tests/test-941.cs
Normal file
30
mcs/tests/test-941.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
public class GotoCodeFlowBug
|
||||
{
|
||||
public static void Test (bool cond, out int x)
|
||||
{
|
||||
if (cond)
|
||||
{
|
||||
goto Label;
|
||||
}
|
||||
Label:
|
||||
x = 0;
|
||||
}
|
||||
|
||||
public static void Test2 (bool cond, out int x)
|
||||
{
|
||||
if (cond)
|
||||
{
|
||||
goto Label;
|
||||
}
|
||||
else
|
||||
{
|
||||
goto Label;
|
||||
}
|
||||
Label:
|
||||
x = 0;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
@@ -378,8 +378,7 @@
|
||||
</locals>
|
||||
<scopes>
|
||||
<entry index="0" start="0x1" end="0x1e" />
|
||||
<entry index="1" start="0xb" end="0x11" />
|
||||
<entry index="2" start="0xf" end="0x10" />
|
||||
<entry index="1" start="0xf" end="0x10" />
|
||||
</scopes>
|
||||
</method>
|
||||
<method token="0x6000019">
|
||||
@@ -401,8 +400,7 @@
|
||||
</locals>
|
||||
<scopes>
|
||||
<entry index="0" start="0x1" end="0x37" />
|
||||
<entry index="1" start="0xe" end="0x18" />
|
||||
<entry index="2" start="0x16" end="0x17" />
|
||||
<entry index="1" start="0x16" end="0x17" />
|
||||
</scopes>
|
||||
</method>
|
||||
<method token="0x600001a">
|
||||
@@ -423,8 +421,7 @@
|
||||
</locals>
|
||||
<scopes>
|
||||
<entry index="0" start="0x1" end="0x3c" />
|
||||
<entry index="1" start="0xf" end="0x18" />
|
||||
<entry index="2" start="0x16" end="0x17" />
|
||||
<entry index="1" start="0x16" end="0x17" />
|
||||
</scopes>
|
||||
</method>
|
||||
<method token="0x600001b">
|
||||
@@ -446,8 +443,7 @@
|
||||
</locals>
|
||||
<scopes>
|
||||
<entry index="0" start="0x1" end="0x4d" />
|
||||
<entry index="1" start="0x24" end="0x31" />
|
||||
<entry index="2" start="0x2f" end="0x30" />
|
||||
<entry index="1" start="0x2f" end="0x30" />
|
||||
</scopes>
|
||||
</method>
|
||||
</methods>
|
||||
|
@@ -83,7 +83,8 @@
|
||||
</sequencepoints>
|
||||
<locals />
|
||||
<scopes>
|
||||
<entry index="0" start="0x0" end="0xb" />
|
||||
<entry index="0" start="0x0" end="0x0" />
|
||||
<entry index="1" start="0x0" end="0xb" />
|
||||
</scopes>
|
||||
</method>
|
||||
</methods>
|
||||
|
@@ -28,9 +28,7 @@
|
||||
</locals>
|
||||
<scopes>
|
||||
<entry index="0" start="0x1" end="0x1c" />
|
||||
<entry index="1" start="0xb" end="0xf" />
|
||||
<entry index="2" start="0x1c" end="0x3f" />
|
||||
<entry index="3" start="0x28" end="0x2e" />
|
||||
<entry index="1" start="0x1c" end="0x3f" />
|
||||
</scopes>
|
||||
</method>
|
||||
<method token="0x6000003">
|
||||
|
58
mcs/tests/test-debug-31-ref.xml
Normal file
58
mcs/tests/test-debug-31-ref.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<symbols>
|
||||
<files>
|
||||
<file id="1" name="test-debug-31.cs" checksum="e1579371d047d82b8d90c0dc26393808" />
|
||||
</files>
|
||||
<methods>
|
||||
<method token="0x6000001">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000002">
|
||||
<sequencepoints>
|
||||
<entry il="0x0" row="8" col="3" file_ref="1" hidden="false" />
|
||||
<entry il="0x1" row="9" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x20" row="11" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x21" row="11" col="25" file_ref="1" hidden="false" />
|
||||
<entry il="0x2a" row="11" col="13" file_ref="1" hidden="false" />
|
||||
<entry il="0x2e" row="12" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x2f" row="13" col="5" file_ref="1" hidden="false" />
|
||||
<entry il="0x30" row="13" col="13" file_ref="1" hidden="false" />
|
||||
<entry il="0x35" row="14" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x36" row="11" col="25" file_ref="1" hidden="false" />
|
||||
<entry il="0x43" row="16" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x44" row="16" col="26" file_ref="1" hidden="false" />
|
||||
<entry il="0x4f" row="16" col="13" file_ref="1" hidden="false" />
|
||||
<entry il="0x56" row="16" col="33" file_ref="1" hidden="false" />
|
||||
<entry il="0x57" row="17" col="5" file_ref="1" hidden="false" />
|
||||
<entry il="0x59" row="17" col="13" file_ref="1" hidden="false" />
|
||||
<entry il="0x5e" row="18" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x5f" row="16" col="26" file_ref="1" hidden="false" />
|
||||
<entry il="0x70" row="20" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x71" row="20" col="26" file_ref="1" hidden="false" />
|
||||
<entry il="0x7c" row="20" col="13" file_ref="1" hidden="false" />
|
||||
<entry il="0x83" row="20" col="33" file_ref="1" hidden="false" />
|
||||
<entry il="0x84" row="21" col="5" file_ref="1" hidden="false" />
|
||||
<entry il="0x86" row="21" col="13" file_ref="1" hidden="false" />
|
||||
<entry il="0x8b" row="22" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x8c" row="20" col="26" file_ref="1" hidden="false" />
|
||||
<entry il="0x9d" row="23" col="3" file_ref="1" hidden="false" />
|
||||
</sequencepoints>
|
||||
<locals>
|
||||
<entry name="array" il_index="0" scope_ref="0" />
|
||||
<entry name="item" il_index="1" scope_ref="1" />
|
||||
<entry name="item1" il_index="4" scope_ref="3" />
|
||||
<entry name="item2" il_index="7" scope_ref="5" />
|
||||
</locals>
|
||||
<scopes>
|
||||
<entry index="0" start="0x20" end="0x43" />
|
||||
<entry index="1" start="0x2e" end="0x35" />
|
||||
<entry index="2" start="0x43" end="0x70" />
|
||||
<entry index="3" start="0x56" end="0x5e" />
|
||||
<entry index="4" start="0x70" end="0x9d" />
|
||||
<entry index="5" start="0x83" end="0x8b" />
|
||||
</scopes>
|
||||
</method>
|
||||
</methods>
|
||||
</symbols>
|
25
mcs/tests/test-debug-31.cs
Normal file
25
mcs/tests/test-debug-31.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace cp534534
|
||||
{
|
||||
class MainClass
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
var array = new string[] { "a", "b", "c" };
|
||||
|
||||
foreach (var item in array)
|
||||
{
|
||||
Console.WriteLine (item);
|
||||
}
|
||||
|
||||
foreach (var item1 in array) {
|
||||
Console.WriteLine (item1);
|
||||
}
|
||||
|
||||
foreach (var item2 in array) {
|
||||
Console.WriteLine (item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
92
mcs/tests/test-debug-32-ref.xml
Normal file
92
mcs/tests/test-debug-32-ref.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<symbols>
|
||||
<files>
|
||||
<file id="1" name="test-debug-32.cs" checksum="71a5517624c6bd01871fcb9ae65242b7" />
|
||||
</files>
|
||||
<methods>
|
||||
<method token="0x6000001">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000002">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000003">
|
||||
<sequencepoints>
|
||||
<entry il="0x0" row="19" col="2" file_ref="1" hidden="false" />
|
||||
<entry il="0x1" row="20" col="2" file_ref="1" hidden="false" />
|
||||
</sequencepoints>
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000004">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000005">
|
||||
<sequencepoints>
|
||||
<entry il="0x27" row="6" col="2" file_ref="1" hidden="false" />
|
||||
<entry il="0x28" row="7" col="3" file_ref="1" hidden="false" />
|
||||
<entry il="0x43" row="9" col="3" file_ref="1" hidden="false" />
|
||||
<entry il="0x4a" row="10" col="3" file_ref="1" hidden="false" />
|
||||
<entry il="0x59" row="10" col="7" file_ref="1" hidden="false" />
|
||||
<entry il="0x5a" row="11" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0x7c" row="12" col="3" file_ref="1" hidden="false" />
|
||||
<entry il="0x8d" row="16" col="2" file_ref="1" hidden="false" />
|
||||
</sequencepoints>
|
||||
<locals />
|
||||
<scopes>
|
||||
<entry index="0" start="0x59" end="0x7c" />
|
||||
</scopes>
|
||||
</method>
|
||||
<method token="0x6000006">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000007">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000008">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x6000009">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x600000a">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x600000b">
|
||||
<sequencepoints />
|
||||
<locals />
|
||||
<scopes />
|
||||
</method>
|
||||
<method token="0x600000c">
|
||||
<sequencepoints>
|
||||
<entry il="0x0" row="12" col="13" file_ref="1" hidden="false" />
|
||||
<entry il="0x1" row="13" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0xd" row="13" col="16" file_ref="1" hidden="false" />
|
||||
<entry il="0xe" row="14" col="4" file_ref="1" hidden="false" />
|
||||
<entry il="0xf" row="15" col="3" file_ref="1" hidden="false" />
|
||||
</sequencepoints>
|
||||
<locals />
|
||||
<scopes>
|
||||
<entry index="0" start="0x0" end="0x0" />
|
||||
<entry index="1" start="0x0" end="0xf" />
|
||||
<entry index="2" start="0xd" end="0xe" />
|
||||
</scopes>
|
||||
</method>
|
||||
</methods>
|
||||
</symbols>
|
21
mcs/tests/test-debug-32.cs
Normal file
21
mcs/tests/test-debug-32.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
class X
|
||||
{
|
||||
internal static IEnumerable<int> EnumerateKind ()
|
||||
{
|
||||
yield return 1;
|
||||
|
||||
int h = 3;
|
||||
try {
|
||||
yield return h;
|
||||
} finally {
|
||||
if (h != 1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
@@ -13,6 +13,13 @@ public class ParserTest
|
||||
Console.WriteLine($"This should work but the compiler explodes if the string is too long!");
|
||||
}
|
||||
|
||||
void Test3 ()
|
||||
{
|
||||
string field = "";
|
||||
var l1 = $"\"{field.Replace("\"", "gg")}\"";
|
||||
var l2 = $@"""{field.Replace("\"", "gg")}""";
|
||||
}
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ using System.Threading;
|
||||
class X
|
||||
{
|
||||
static ManualResetEvent dispose = new ManualResetEvent (false);
|
||||
static ManualResetEvent wait = new ManualResetEvent (false);
|
||||
|
||||
static IEnumerable GetIt2 ()
|
||||
{
|
||||
@@ -15,7 +16,7 @@ class X
|
||||
static int Delay ()
|
||||
{
|
||||
dispose.Set ();
|
||||
Thread.Sleep (10);
|
||||
wait.WaitOne ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -25,6 +26,7 @@ class X
|
||||
ThreadPool.QueueUserWorkItem (l => {
|
||||
dispose.WaitOne ();
|
||||
((IDisposable) e).Dispose ();
|
||||
wait.Set ();
|
||||
});
|
||||
|
||||
if (!e.MoveNext ())
|
||||
|
18
mcs/tests/test-named-10.cs
Normal file
18
mcs/tests/test-named-10.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Method (1, 2, paramNamed: 3);
|
||||
}
|
||||
|
||||
static void Method (int p1, int paramNamed, int p2)
|
||||
{
|
||||
throw new ApplicationException ();
|
||||
}
|
||||
|
||||
static void Method (int p1, int p2, object paramNamed)
|
||||
{
|
||||
}
|
||||
}
|
19
mcs/tests/test-partial-35.cs
Normal file
19
mcs/tests/test-partial-35.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
partial class A
|
||||
{
|
||||
}
|
||||
|
||||
partial class A
|
||||
{
|
||||
enum E
|
||||
{
|
||||
None = 0,
|
||||
All = 1
|
||||
}
|
||||
}
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
@@ -1 +1 @@
|
||||
216a310da0866d4efac81f4c8a3bcdc849ad8891
|
||||
f9c8f8b2465c7c00ddc1831c311422c9785ad594
|
Reference in New Issue
Block a user