Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -54,7 +54,7 @@ DEFINES = -compiler-options:"-d:NET_4_0;NET_4_5 -debug"
endif
LOCAL_RUNTIME_FLAGS = --verify-all
COMPILER = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
TEST_ILS := $(wildcard *-lib.il)
@@ -95,11 +95,13 @@ csproj-local:
%-lib.dll: %-lib.il
$(ILASM) /dll /out:$@ $<
CSCOMPILE_UTIL = $(CSCOMPILE) -noconfig -nologo -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
setup:
$(CSCOMPILE) -t:library dlls/test-679-2/test-679-lib-2.cs
$(CSCOMPILE) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll
$(CSCOMPILE) -t:library dlls/test-939-common.cs -keyfile:key.snk -publicsign
$(CSCOMPILE) -t:library dlls/test-939-1/test-939-lib.cs -keyfile:key.snk -publicsign
$(CSCOMPILE) -t:library dlls/test-939-1/test-939-ref.cs -r:dlls/test-939-1/test-939-lib.dll -keyfile:key.snk -publicsign
$(CSCOMPILE) -t:library dlls/test-939-2/test-939-lib.cs -r:dlls/test-939-common.dll -keyfile:key.snk -publicsign
$(CSCOMPILE_UTIL) -t:library dlls/test-679-2/test-679-lib-2.cs -out:dlls/test-679-2/test-679-lib-2.dll
$(CSCOMPILE_UTIL) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll -out:dlls/test-679-1/test-679-lib.dll
$(CSCOMPILE_UTIL) -t:library dlls/test-939-common.cs -keyfile:key.snk -publicsign -out:dlls/test-939-common.dll
$(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-lib.cs -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-lib.dll
$(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-ref.cs -r:dlls/test-939-1/test-939-lib.dll -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-ref.dll
$(CSCOMPILE_UTIL) -t:library dlls/test-939-2/test-939-lib.cs -r:dlls/test-939-common.dll -keyfile:key.snk -publicsign -out:dlls/test-939-2/test-939-lib.dll
$(ILASM) -dll dlls/test-883.il

View File

@@ -26,4 +26,10 @@ class X
return 0;
}
const Action cf = null;
void Foo (Action f)
{
var x = f ?? cf;
}
}

39
mcs/tests/gtest-640.cs Normal file
View File

@@ -0,0 +1,39 @@
using System;
public struct Test
{
public static Test op_Addition<T>(Test p1, T p2)
{
throw new ApplicationException ();
}
public static int op_Addition<T>(T p1, int p2)
{
throw new ApplicationException ();
}
public static Test operator +(Test p1, Test p2)
{
throw new ApplicationException ();
}
public static long operator +(Test p1, int p2)
{
return 4;
}
}
public class Program
{
public static int Main ()
{
var t = new Test ();
int p2 = 20;
var res = t + p2;
if (res != 4)
return 1;
return 0;
}
}

51
mcs/tests/gtest-642.cs Normal file
View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
class Program
{
static void Main ()
{
}
public static void Transform<V> (Area<V> area, Func<V, V> transform)
where V : IA<V>
{
Test (GetIB<V> (), t => Transform2 (null, transform));
}
static IB<W> GetIB<W> ()
where W : IA<W>
{
return null;
}
static void Test<T> (T values, Func<T, T> func)
{
}
public static IB<U> Transform2<U> (
IB<U> b,
Func<U, U> transform) where U : IA<U>
{
return null;
}
}
public class Area<TVector>
where TVector : IA<TVector>
{
public IB<TVector> GetSegments ()
{
return null;
}
}
public interface IB<TB>
where TB : IA<TB>
{
}
public interface IA<T>
{
}

62
mcs/tests/gtest-643.cs Normal file
View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
class Program
{
public static void Main()
{
}
private static IEnumerable<float> FindIntersections<TVector>(
IBezier<TVector> bezier,
Ray<TVector> ray,
float epsilon,
Range<float> t1,
int depth) where TVector : IVector<TVector>
{
var bounds = bezier.GetBounds();
if (Intersect.s(ray, bounds))
{
var intersections1 = new float[] { };
var intersections2 = new float[] { };
foreach (var t in intersections1) { yield return t; }
foreach (var t in intersections2) { yield return t; }
}
}
public static class Intersect
{
public static bool s<TVector>(Ray<TVector> ray, BoundingBoxN<TVector> box) where TVector : IVector<TVector>
{
throw new NotImplementedException();
}
}
public struct Range<T>
{
}
public class Ray<TVector> where TVector : IVector<TVector>
{
}
public interface IBezier<TVector>
where TVector : IVector<TVector>
{
BoundingBoxN<TVector> GetBounds();
}
public interface IVector<T> : IEpsilonEquatable<T, float>
where T : IVector<T>
{
}
public interface IEpsilonEquatable<TType, TEpsilon> // ReSharper enable TypeParameterCanBeVariant
{
}
public struct BoundingBoxN<T>
where T : IVector<T>
{
}
}

View File

@@ -27,13 +27,13 @@ class C
int TestInstance ()
{
Expression<Func<EmptyDelegate>> e = () => M;
if (e.Body.ToString () != "Convert(Void M().CreateDelegate(EmptyDelegate, value(C)))")
if (e.Body.ToString () != "Convert(Void M().CreateDelegate(EmptyDelegate, value(C)), EmptyDelegate)")
return 1;
e.Compile () ();
Expression<Func<C, EmptyDelegate>> e2 = (l) => l.M;
if (e2.Body.ToString () != "Convert(Void M().CreateDelegate(EmptyDelegate, l))")
if (e2.Body.ToString () != "Convert(Void M().CreateDelegate(EmptyDelegate, l), EmptyDelegate)")
return 2;
e2.Compile () (this);
@@ -43,7 +43,7 @@ class C
public static int Main ()
{
Expression<Func<EmptyDelegate>> e = () => new EmptyDelegate (Test);
if (e.Body.ToString () != "Convert(Void Test().CreateDelegate(EmptyDelegate, null))")
if (e.Body.ToString () != "Convert(Void Test().CreateDelegate(EmptyDelegate, null), EmptyDelegate)")
return 1;
var v = e.Compile ();
@@ -53,7 +53,7 @@ class C
return 2;
Expression<Func<EmptyDelegate>> e2 = () => Test;
if (e2.Body.ToString () != "Convert(Void Test().CreateDelegate(EmptyDelegate, null))")
if (e2.Body.ToString () != "Convert(Void Test().CreateDelegate(EmptyDelegate, null), EmptyDelegate)")
return 3;
var v2 = e2.Compile ();
@@ -64,7 +64,7 @@ class C
unsafe {
Expression<Func<UnsafeDelegate>> e3 = () => new UnsafeDelegate (Foo);
if (e3.Body.ToString () != "Convert(Int32* Foo().CreateDelegate(UnsafeDelegate, null))")
if (e3.Body.ToString () != "Convert(Int32* Foo().CreateDelegate(UnsafeDelegate, null), UnsafeDelegate)")
return 5;
var v3 = e3.Compile ();

View File

@@ -0,0 +1,19 @@
using System;
internal class Program
{
public static void Main ()
{
AttributeOrDefault ("firstItem", null);
}
public static string AttributeOrDefault (string attribute, string defaultValue = null)
{
return "";
}
public static string AttributeOrDefault (string attribute, bool? klass, string defaultValue = null)
{
throw new ApplicationException ();
}
}

View File

@@ -0,0 +1,33 @@
.assembly bz16628.typeforwarder2 {}
.assembly extern mscorlib {}
.assembly extern bz16628.typeforwardee2 {}
.class extern public forwarder NSwForwardee2.Foo_SPECIAL{
.assembly extern bz16628.typeforwardee2
}
.class public auto ansi beforefieldinit NSwForwardee2.Bar_SPECIAL
extends [mscorlib]System.Object
{
.field public static int32 A
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method Foo::.ctor
.method private hidebysig specialname rtspecialname static
void .cctor() cil managed
{
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldc.i4.s 320
IL_0002: stsfld int32 NSwForwardee2.Bar_SPECIAL::A
IL_0007: ret
} // end of method Foo::.cctor
}

View File

@@ -1 +1 @@
87b874ce09a0b6bdfc9838d7b448fc99531f03a8
0cec93cb80a1aa8d524cde9a05381e968d548462