You've already forked linux-packaging-mono
Imported Upstream version 4.3.2.467
Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
@@ -14,12 +14,14 @@ with_mono_path = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARA
|
||||
ilasm = $(topdir)/class/lib/$(PROFILE)/ilasm.exe
|
||||
ILASM = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(ilasm)
|
||||
|
||||
-include $(mcs_topdir)/build/config.make
|
||||
|
||||
USE_MCS_FLAGS :=
|
||||
|
||||
# mention all targets
|
||||
all-local $(STD_TARGETS:=-local):
|
||||
|
||||
VALID_PROFILE := $(filter net_4_5, $(PROFILE))
|
||||
VALID_PROFILE := $(filter $(DEFAULT_PROFILE), $(PROFILE))
|
||||
ifdef VALID_PROFILE
|
||||
# casts
|
||||
bootstrap-cast.exe: gen-cast-test.cs
|
||||
@@ -46,7 +48,7 @@ test-casts: boot-casts.out mcs-casts.out
|
||||
|
||||
TEST_PATTERN = 'v2'
|
||||
|
||||
ifeq (net_4_5, $(PROFILE))
|
||||
ifeq (net_4_x, $(PROFILE))
|
||||
TEST_PATTERN = 'v4'
|
||||
DEFINES = -compiler-options:"-d:NET_4_0;NET_4_5"
|
||||
endif
|
||||
|
||||
18
mcs/tests/dtest-062.cs
Normal file
18
mcs/tests/dtest-062.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
class G<T>
|
||||
{
|
||||
}
|
||||
|
||||
public class Program
|
||||
{
|
||||
static void Test<T> (G<G<T>> g)
|
||||
{
|
||||
}
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
dynamic d = new G<G<int>> ();
|
||||
Test (d);
|
||||
}
|
||||
}
|
||||
15
mcs/tests/dtest-063.cs
Normal file
15
mcs/tests/dtest-063.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
class InvalidILWhenInterpolatingDynamicObjectTest
|
||||
{
|
||||
static int Main ()
|
||||
{
|
||||
dynamic d = 1;
|
||||
var str = $"{d + 3}";
|
||||
if (str != "4")
|
||||
return 1;
|
||||
|
||||
Console.WriteLine (str);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
57
mcs/tests/dtest-null-operator-01.cs
Normal file
57
mcs/tests/dtest-null-operator-01.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
class X
|
||||
{
|
||||
public string Prop;
|
||||
public A A = new A ();
|
||||
}
|
||||
|
||||
class A
|
||||
{
|
||||
public string B;
|
||||
}
|
||||
|
||||
class MainClass
|
||||
{
|
||||
static void NullCheckTest ()
|
||||
{
|
||||
dynamic dyn = null;
|
||||
dynamic res;
|
||||
|
||||
res = dyn?.ToString ();
|
||||
res = dyn?.GetHashCode ();
|
||||
res = dyn?.DD.Length?.GetHashCode ();
|
||||
|
||||
dyn?.ToString ();
|
||||
|
||||
res = dyn?.Prop;
|
||||
res = dyn?.Prop?.Prop2;
|
||||
res = dyn?[0];
|
||||
}
|
||||
|
||||
static void Test_1 ()
|
||||
{
|
||||
dynamic dyn = new X ();
|
||||
dynamic res;
|
||||
|
||||
res = dyn.Prop?.Length;
|
||||
res = dyn.A.B?.C.D?.E.F;
|
||||
}
|
||||
|
||||
static dynamic Test_2 (IEnumerable<dynamic> collection)
|
||||
{
|
||||
return collection?.FirstOrDefault ().Length;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
NullCheckTest ();
|
||||
|
||||
Test_1 ();
|
||||
Test_2 (null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -172,10 +172,8 @@ public static class InterfaceTester
|
||||
ifaces.Add (icollection_type, State.Missing);
|
||||
ifaces.Add (ienumerable_type, State.Missing);
|
||||
ifaces.Add (icloneable_type, State.Missing);
|
||||
#if NET_4_0
|
||||
ifaces.Add (typeof (IStructuralEquatable), State.Missing);
|
||||
ifaces.Add (typeof (IStructuralComparable), State.Missing);
|
||||
#endif
|
||||
Type array_type = t.MakeArrayType ();
|
||||
|
||||
if (Debug) {
|
||||
|
||||
@@ -165,6 +165,11 @@ public class ConditionalParsing
|
||||
var t = (Object)string.Empty;
|
||||
}
|
||||
|
||||
void Test_21 ()
|
||||
{
|
||||
var t = (Int32)sbyte.MaxValue;
|
||||
}
|
||||
|
||||
static void Helper<T> (T arg)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -85,6 +85,19 @@ class C
|
||||
|
||||
if ((true | a) != true)
|
||||
return 65;
|
||||
|
||||
var b4 = true;
|
||||
if ((b4 & null) != null)
|
||||
return 100;
|
||||
|
||||
if ((null & b4) != null)
|
||||
return 101;
|
||||
|
||||
if ((b4 | null) != true)
|
||||
return 102;
|
||||
|
||||
if ((null | b4) != true)
|
||||
return 103;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class C
|
||||
return 18;
|
||||
|
||||
var r2 = E.V & a_n;
|
||||
if (r1 != null)
|
||||
if (r2 != null)
|
||||
return 19;
|
||||
|
||||
Console.WriteLine ("ok");
|
||||
|
||||
18
mcs/tests/gtest-633.cs
Normal file
18
mcs/tests/gtest-633.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
struct BB
|
||||
{}
|
||||
|
||||
public class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
// Reduced expression statements
|
||||
|
||||
new BB? ();
|
||||
new float();
|
||||
|
||||
Action a = () => new float();
|
||||
a ();
|
||||
}
|
||||
}
|
||||
27
mcs/tests/gtest-634.cs
Normal file
27
mcs/tests/gtest-634.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
public abstract class ThingWithOrganizationId
|
||||
{
|
||||
public Guid OrganizationId;
|
||||
}
|
||||
|
||||
public class Thing : ThingWithOrganizationId
|
||||
{
|
||||
}
|
||||
|
||||
public abstract class BaseService<TConstraint>
|
||||
{
|
||||
public abstract void Save<T> (T newThing) where T : TConstraint;
|
||||
}
|
||||
|
||||
public class DerivedService:BaseService<Thing>
|
||||
{
|
||||
public override void Save<TThing>(TThing newThing)
|
||||
{
|
||||
Console.WriteLine (newThing.OrganizationId);
|
||||
}
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
||||
27
mcs/tests/gtest-635.cs
Normal file
27
mcs/tests/gtest-635.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
public interface I<T>
|
||||
{
|
||||
T Clone();
|
||||
T1 Clone<T1>() where T1 : T;
|
||||
}
|
||||
|
||||
public interface I2 : I<I2>
|
||||
{
|
||||
}
|
||||
|
||||
public class TestClass : I2
|
||||
{
|
||||
public I2 Clone ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public T1 Clone<T1> () where T1 : I2
|
||||
{
|
||||
return (T1) Clone();
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
new TestClass ();
|
||||
}
|
||||
}
|
||||
37
mcs/tests/gtest-636.cs
Normal file
37
mcs/tests/gtest-636.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
class MainClass
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
var res = XX () | YY();
|
||||
if (!res.Value)
|
||||
return 1;
|
||||
|
||||
if (xx != 1)
|
||||
return 2;
|
||||
|
||||
if (yy != 1)
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xx;
|
||||
static bool XX ()
|
||||
{
|
||||
++xx;
|
||||
Console.WriteLine ("XX");
|
||||
return true;
|
||||
}
|
||||
|
||||
static int yy;
|
||||
static bool? YY ()
|
||||
{
|
||||
if (xx == 1)
|
||||
++yy;
|
||||
|
||||
Console.WriteLine ("YY");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Compiler options: -nostdlib -noconfig -r:mscorlib.dll -r:System.Core.dll -lib:../class/lib/net_4_5
|
||||
// Compiler options: -nostdlib -noconfig -r:mscorlib.dll -r:System.Core.dll -lib:../class/lib/net_4_x
|
||||
|
||||
public static class T
|
||||
{
|
||||
|
||||
@@ -13,35 +13,35 @@ public class Test
|
||||
if (resourceNames.Length != 3)
|
||||
return 1;
|
||||
if (resourceNames[0] != "test-513.cs")
|
||||
return 1;
|
||||
return 2;
|
||||
if (resourceNames[1] != "test-512.cs")
|
||||
return 1;
|
||||
return 3;
|
||||
if (resourceNames[2] != "test")
|
||||
return 1;
|
||||
return 4;
|
||||
FileStream f = a.GetFile ("test-513.cs");
|
||||
if (f == null)
|
||||
return 1;
|
||||
return 5;
|
||||
f = a.GetFile ("test-512.cs");
|
||||
if (f == null)
|
||||
return 1;
|
||||
return 6;
|
||||
f = a.GetFile ("test-511.cs");
|
||||
if (f == null)
|
||||
return 1;
|
||||
return 7;
|
||||
f = a.GetFile ("test");
|
||||
if (f != null)
|
||||
return 1;
|
||||
return 8;
|
||||
Stream s = a.GetManifestResourceStream ("test-513.cs");
|
||||
if (s == null)
|
||||
return 1;
|
||||
return 9;
|
||||
s = a.GetManifestResourceStream ("test-512.cs");
|
||||
if (s == null)
|
||||
return 1;
|
||||
return 10;
|
||||
s = a.GetManifestResourceStream ("test");
|
||||
if (s == null)
|
||||
return 1;
|
||||
return 11;
|
||||
s = a.GetManifestResourceStream ("test-511.cs");
|
||||
if (s != null)
|
||||
return 1;
|
||||
return 12;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,10 @@ class PointerArithmeticTest
|
||||
} catch (System.OverflowException) {}
|
||||
|
||||
try {
|
||||
return CheckSub((short*)(-1), int.MaxValue);
|
||||
if (IntPtr.Size <= 4)
|
||||
return CheckSub((short*)(-1), int.MaxValue);
|
||||
else
|
||||
return CheckSub((short*)(-1), long.MaxValue);
|
||||
} catch (System.OverflowException) {}
|
||||
|
||||
CheckSub2((short*)(-1), int.MaxValue);
|
||||
@@ -44,6 +47,14 @@ class PointerArithmeticTest
|
||||
return 102;
|
||||
}
|
||||
|
||||
unsafe static int CheckSub(short* ptr, long offset)
|
||||
{
|
||||
if (checked(ptr - offset < ptr))
|
||||
return 2;
|
||||
|
||||
return 102;
|
||||
}
|
||||
|
||||
unsafe static int CheckSub2(short* ptr, int offset)
|
||||
{
|
||||
short* b = ptr + offset;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Compiler options: -r:../class/lib/net_4_5/Mono.Cecil.dll
|
||||
// Compiler options: -r:../class/lib/net_4_x/Mono.Cecil.dll
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Compiler options: -r:../class/lib/net_4_5/Mono.Cecil.dll
|
||||
// Compiler options: -r:../class/lib/net_4_x/Mono.Cecil.dll
|
||||
|
||||
using System;
|
||||
using Mono.Cecil;
|
||||
|
||||
29
mcs/tests/test-928.cs
Normal file
29
mcs/tests/test-928.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
// Compiler options: -unsafe
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
|
||||
unsafe class Program
|
||||
{
|
||||
public static void Test ()
|
||||
{
|
||||
string s = "";
|
||||
unsafe {
|
||||
fixed (char *chars = s) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int Main ()
|
||||
{
|
||||
Test ();
|
||||
|
||||
var m = typeof (Program).GetMethod ("Test");
|
||||
var lv = m.GetMethodBody ().LocalVariables.Where (l => l.LocalType == typeof (char*)).Single ();
|
||||
if (lv.IsPinned)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
17
mcs/tests/test-929.cs
Normal file
17
mcs/tests/test-929.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
public class Wibble
|
||||
{
|
||||
public static void Main () {
|
||||
Wibble w = new Wibble();
|
||||
if (w == (null)) {
|
||||
}
|
||||
|
||||
if (w != (null)) {
|
||||
}
|
||||
|
||||
if ((null) == w) {
|
||||
}
|
||||
|
||||
if ((null) != w) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user