You've already forked linux-packaging-mono
Imported Upstream version 5.10.0.47
Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
parent
88ff76fe28
commit
e46a49ecf1
@ -55,7 +55,7 @@ endif
|
||||
|
||||
LOCAL_RUNTIME_FLAGS = --verify-all
|
||||
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
|
||||
TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
|
||||
|
||||
TEST_ILS := $(wildcard *-lib.il)
|
||||
|
||||
@ -64,16 +64,27 @@ build-compiler-lib:
|
||||
|
||||
qcheck: build-compiler-lib qcheck2
|
||||
|
||||
ifdef TEST_WITH_INTERPRETER
|
||||
KNOWN_ISSUES = known-issues-interp-$(PROFILE)
|
||||
else
|
||||
KNOWN_ISSUES = known-issues-$(PROFILE)
|
||||
endif
|
||||
|
||||
qcheck2:
|
||||
$(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(PROFILE) -log:$(PROFILE).log -il:ver-il-$(PROFILE).xml $(DEFINES) $(TOPTIONS)
|
||||
$(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:$(KNOWN_ISSUES) -log:$(PROFILE).log -il:ver-il-$(PROFILE).xml $(DEFINES) $(TOPTIONS)
|
||||
|
||||
gen-mt-tests:
|
||||
$(TESTER) -mode:nunit -files:'v2' -compiler:$(COMPILER) -issues:known-issues-mt -compiler-options:"-lib:$(topdir)/class/lib/monotouch projects/MonoTouch/ivt.cs"
|
||||
|
||||
|
||||
TESTERVERBOSE=$(if $(V),-verbose,)
|
||||
|
||||
test-local:
|
||||
@:
|
||||
|
||||
run-test-local: $(TEST_ILS:.il=.dll) setup qcheck
|
||||
compile-all: $(TEST_ILS:.il=.dll)
|
||||
|
||||
run-test-local: compile-all setup qcheck
|
||||
|
||||
check: run-test-local
|
||||
|
||||
|
22
mcs/tests/known-issues-interp-net_4_x
Normal file
22
mcs/tests/known-issues-interp-net_4_x
Normal file
@ -0,0 +1,22 @@
|
||||
# This file contains test files which cause any type of error.
|
||||
|
||||
# This file supports extended syntax
|
||||
# csXXXX.cs : test case causes error
|
||||
# csXXXX.cs IGNORE : adds test to ignore list
|
||||
|
||||
gtest-230.cs
|
||||
test-pattern-02.cs
|
||||
test-pattern-04.cs
|
||||
test-pattern-05.cs
|
||||
test-pattern-07.cs
|
||||
|
||||
gtest-etree-01.cs
|
||||
gtest-etree-09.cs
|
||||
test-269.cs
|
||||
test-270.cs
|
||||
test-399.cs
|
||||
test-704.cs
|
||||
test-811.cs
|
||||
test-async-17.cs
|
||||
test-ref-08.cs IGNORE
|
||||
test-ref-09.cs IGNORE
|
52
mcs/tests/test-default-01.cs
Normal file
52
mcs/tests/test-default-01.cs
Normal file
@ -0,0 +1,52 @@
|
||||
// Compiler options: -langversion:latest
|
||||
|
||||
static class X
|
||||
{
|
||||
const int c1 = default;
|
||||
const int c2 = default (int);
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
int a = default;
|
||||
var b = (int) default;
|
||||
const int c = default;
|
||||
var d = new[] { 1, default };
|
||||
dynamic e = default;
|
||||
int f = checked (default);
|
||||
(int a, int b) g = (1, default);
|
||||
var h = 1 != default;
|
||||
var i = default == M4 ();
|
||||
}
|
||||
|
||||
static int M1 ()
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
static void M2 ()
|
||||
{
|
||||
try {
|
||||
throw new System.Exception ();
|
||||
} catch (System.Exception) when (default) {
|
||||
}
|
||||
|
||||
if (default) {
|
||||
}
|
||||
}
|
||||
|
||||
static void M3 (int x = default)
|
||||
{
|
||||
}
|
||||
|
||||
static System.Func<int> M4 ()
|
||||
{
|
||||
return () => default;
|
||||
}
|
||||
}
|
||||
/*
|
||||
enum E
|
||||
{
|
||||
A = default,
|
||||
B = default + 1
|
||||
}
|
||||
*/
|
21
mcs/tests/test-default-02.cs
Normal file
21
mcs/tests/test-default-02.cs
Normal file
@ -0,0 +1,21 @@
|
||||
// Compiler options: -langversion:latest
|
||||
|
||||
class C
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
M (default, 1);
|
||||
|
||||
M2 (default);
|
||||
M2 (null);
|
||||
}
|
||||
|
||||
|
||||
static void M<T> (T x, T y)
|
||||
{
|
||||
}
|
||||
|
||||
static void M2 (params object[] x)
|
||||
{
|
||||
}
|
||||
}
|
13
mcs/tests/test-named-11.cs
Normal file
13
mcs/tests/test-named-11.cs
Normal file
@ -0,0 +1,13 @@
|
||||
// Compiler options: -langversion:7.2
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Test (arg: 1, "");
|
||||
}
|
||||
|
||||
static void Test (int arg, string str)
|
||||
{
|
||||
}
|
||||
}
|
31
mcs/tests/test-pattern-10.cs
Normal file
31
mcs/tests/test-pattern-10.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
class X
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
Test (null);
|
||||
if (Test ((long) 0) != 1)
|
||||
return 1;
|
||||
|
||||
object o = "aa";
|
||||
if (o != null) {
|
||||
if (o is long s) {
|
||||
Console.WriteLine (s);
|
||||
}
|
||||
} else if (o is string s) {
|
||||
Console.WriteLine (s);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Test (object o)
|
||||
{
|
||||
if (o is long s) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
15
mcs/tests/test-pattern-11.cs
Normal file
15
mcs/tests/test-pattern-11.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
class X
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
object o = null;
|
||||
for (o = "abcd"; o is String s; o = null) {
|
||||
Console.WriteLine (s);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
38
mcs/tests/test-pattern-12.cs
Normal file
38
mcs/tests/test-pattern-12.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
class X
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
foreach (var x in Test1 ("2"))
|
||||
{
|
||||
Console.WriteLine (x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
foreach (var x in Test2 (2))
|
||||
{
|
||||
Console.WriteLine (x);
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static IEnumerable<object> Test1 (object expr)
|
||||
{
|
||||
if (expr is short list)
|
||||
{
|
||||
yield return "list.Length";
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<object> Test2 (object expr)
|
||||
{
|
||||
if (expr is string list)
|
||||
{
|
||||
yield return "list.Length";
|
||||
}
|
||||
}
|
||||
}
|
16
mcs/tests/test-readonly-01.cs
Normal file
16
mcs/tests/test-readonly-01.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// Compiler options: -langversion:latest
|
||||
|
||||
using System;
|
||||
|
||||
readonly struct S
|
||||
{
|
||||
readonly int field;
|
||||
|
||||
static int sf;
|
||||
static event Action e;
|
||||
static int Prop { get; set; }
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
38
mcs/tests/test-ref-01.cs
Normal file
38
mcs/tests/test-ref-01.cs
Normal file
@ -0,0 +1,38 @@
|
||||
// Compiler options: -unsafe
|
||||
|
||||
public unsafe class X
|
||||
{
|
||||
int field;
|
||||
int* ufield;
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
int i = 5;
|
||||
ref int j = ref i;
|
||||
|
||||
var x = new X ();
|
||||
ref var v = ref x.TestMethod ();
|
||||
}
|
||||
|
||||
ref int TestMethod ()
|
||||
{
|
||||
return ref field;
|
||||
}
|
||||
|
||||
ref int TestProperty {
|
||||
get {
|
||||
return ref field;
|
||||
}
|
||||
}
|
||||
|
||||
ref int this [long arg] {
|
||||
get {
|
||||
return ref field;
|
||||
}
|
||||
}
|
||||
|
||||
unsafe ref int* Foo ()
|
||||
{
|
||||
return ref ufield;
|
||||
}
|
||||
}
|
35
mcs/tests/test-ref-02.cs
Normal file
35
mcs/tests/test-ref-02.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
class X
|
||||
{
|
||||
int field;
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
var x = new X ();
|
||||
x.Run ();
|
||||
}
|
||||
|
||||
void Run ()
|
||||
{
|
||||
Test (ref this[0]);
|
||||
Test (ref Prop);
|
||||
}
|
||||
|
||||
static int Test (ref int y)
|
||||
{
|
||||
return y;
|
||||
}
|
||||
|
||||
ref int this [int y] {
|
||||
get {
|
||||
return ref field;
|
||||
}
|
||||
}
|
||||
|
||||
ref int Prop {
|
||||
get {
|
||||
return ref field;
|
||||
}
|
||||
}
|
||||
}
|
33
mcs/tests/test-ref-03.cs
Normal file
33
mcs/tests/test-ref-03.cs
Normal file
@ -0,0 +1,33 @@
|
||||
class X
|
||||
{
|
||||
int x;
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
var x = new X ();
|
||||
Foo (ref x.Wrap (1));
|
||||
Foo (ref x.Prop);
|
||||
Foo (ref x[""]);
|
||||
}
|
||||
|
||||
ref int Wrap (int arg)
|
||||
{
|
||||
return ref x;
|
||||
}
|
||||
|
||||
ref int Prop {
|
||||
get {
|
||||
return ref x;
|
||||
}
|
||||
}
|
||||
|
||||
ref int this [string arg] {
|
||||
get {
|
||||
return ref x;
|
||||
}
|
||||
}
|
||||
|
||||
static void Foo (ref int arg)
|
||||
{
|
||||
}
|
||||
}
|
45
mcs/tests/test-ref-04.cs
Normal file
45
mcs/tests/test-ref-04.cs
Normal file
@ -0,0 +1,45 @@
|
||||
class X
|
||||
{
|
||||
int field;
|
||||
|
||||
public static int Main ()
|
||||
{
|
||||
var x = new X ();
|
||||
|
||||
x.field = 5;
|
||||
if (!x.Test1 ())
|
||||
return 1;
|
||||
|
||||
x.Test2 ();
|
||||
|
||||
if (x.Test3 ()++ != 6)
|
||||
return 2;
|
||||
|
||||
if (x.field != 7)
|
||||
return 3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Test1 ()
|
||||
{
|
||||
ref var x = ref field;
|
||||
int v = x;
|
||||
++x;
|
||||
|
||||
return x == 6;
|
||||
}
|
||||
|
||||
void Test2 ()
|
||||
{
|
||||
ref int x = ref field;
|
||||
x.ToString ();
|
||||
}
|
||||
|
||||
ref int Test3 ()
|
||||
{
|
||||
ref int l = ref field;
|
||||
ref int v = ref l;
|
||||
return ref l;
|
||||
}
|
||||
}
|
46
mcs/tests/test-ref-05.cs
Normal file
46
mcs/tests/test-ref-05.cs
Normal file
@ -0,0 +1,46 @@
|
||||
class X
|
||||
{
|
||||
static int field;
|
||||
|
||||
public static int Main ()
|
||||
{
|
||||
Test () = 3;
|
||||
|
||||
if (field != (byte) 3)
|
||||
return 1;
|
||||
|
||||
G<string>.Test (ref field) = 6;
|
||||
if (field != 6)
|
||||
return 2;
|
||||
|
||||
--Test ();
|
||||
if (field != 5)
|
||||
return 3;
|
||||
|
||||
Test (ref Test (), ref Test ());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ref int Test ()
|
||||
{
|
||||
return ref field;
|
||||
}
|
||||
|
||||
static void Test<T> (ref T a, ref int b)
|
||||
{
|
||||
}
|
||||
|
||||
static void Test2<T> (ref T arg)
|
||||
{
|
||||
Test (ref arg, ref Test ());
|
||||
}
|
||||
}
|
||||
|
||||
class G<U>
|
||||
{
|
||||
public static ref T Test<T> (ref T arg)
|
||||
{
|
||||
return ref arg;
|
||||
}
|
||||
}
|
24
mcs/tests/test-ref-06.cs
Normal file
24
mcs/tests/test-ref-06.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
class X
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
var x = new X ();
|
||||
x [0] = 3;
|
||||
if (x.field != 3)
|
||||
return 1;
|
||||
x.Prop = 5;
|
||||
if (x.field != 5)
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int field;
|
||||
|
||||
ref int this [int idx] => ref field;
|
||||
|
||||
ref int Prop => ref field;
|
||||
|
||||
}
|
30
mcs/tests/test-ref-07.cs
Normal file
30
mcs/tests/test-ref-07.cs
Normal file
@ -0,0 +1,30 @@
|
||||
// Compiler options: -langversion:latest
|
||||
|
||||
public readonly partial ref struct Test
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
var m = new Test ();
|
||||
m.Method ();
|
||||
}
|
||||
|
||||
Test Method ()
|
||||
{
|
||||
return new Test ();
|
||||
}
|
||||
}
|
||||
|
||||
ref struct Second
|
||||
{
|
||||
Test field;
|
||||
}
|
||||
|
||||
public abstract class P
|
||||
{
|
||||
public abstract Test Span { get; }
|
||||
}
|
||||
|
||||
public interface II
|
||||
{
|
||||
Test Span { get; }
|
||||
}
|
101
mcs/tests/test-ref-08.cs
Normal file
101
mcs/tests/test-ref-08.cs
Normal file
@ -0,0 +1,101 @@
|
||||
using System;
|
||||
|
||||
namespace ClassLibrary1
|
||||
{
|
||||
public class C
|
||||
{
|
||||
|
||||
class B
|
||||
{
|
||||
int v;
|
||||
public ref int this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Gen<T> where T : struct
|
||||
{
|
||||
T v;
|
||||
public ref T this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Val
|
||||
{
|
||||
}
|
||||
|
||||
class BB
|
||||
{
|
||||
Val v;
|
||||
public ref Val this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return ref v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MM ()
|
||||
{
|
||||
var bbb = new BB();
|
||||
Val v1 = bbb[0];
|
||||
bbb[1] = v1;
|
||||
|
||||
ref Val v2 = ref bbb[2];
|
||||
bbb[2] = v2;
|
||||
}
|
||||
|
||||
static int[] a = new int[1];
|
||||
public static void Main()
|
||||
{
|
||||
var bb = new B();
|
||||
int b = 1;
|
||||
bb[0] = b;
|
||||
a[0] = Add2(ref b, 2);
|
||||
|
||||
var bbb = new BB();
|
||||
bbb[0] = new Val();
|
||||
|
||||
var v = new Val();
|
||||
bbb[1] = v;
|
||||
|
||||
var v2 = bbb[2];
|
||||
|
||||
bbb[3] = v2;
|
||||
|
||||
|
||||
bbb[3] = bbb[2];
|
||||
|
||||
|
||||
|
||||
var ggg = new Gen<Val>();
|
||||
ggg[0] = new Val();
|
||||
|
||||
var g = new Val();
|
||||
ggg[1] = v;
|
||||
|
||||
var g2 = ggg[2];
|
||||
|
||||
ggg[3] = v2;
|
||||
|
||||
|
||||
ggg[3] = ggg[2];
|
||||
}
|
||||
|
||||
public static ref int Add2(ref int a, int b)
|
||||
{
|
||||
return ref a;
|
||||
}
|
||||
}
|
||||
}
|
12
mcs/tests/test-ref-09.cs
Normal file
12
mcs/tests/test-ref-09.cs
Normal file
@ -0,0 +1,12 @@
|
||||
struct rigidbody { public float x; }
|
||||
|
||||
class Program
|
||||
{
|
||||
static rigidbody a;
|
||||
static ref rigidbody property_returning_struct_by_ref => ref a;
|
||||
|
||||
static void Main()
|
||||
{
|
||||
System.Console.WriteLine (property_returning_struct_by_ref.x);
|
||||
}
|
||||
}
|
16
mcs/tests/test-tuple-07.cs
Normal file
16
mcs/tests/test-tuple-07.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Parser tests
|
||||
|
||||
class ParserTest
|
||||
{
|
||||
IEnumerable<(Object vertex, int distance)> Test ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
db5bfbd387c5090a47e7c7e01c8813a6cec6540e
|
||||
5adff6190605aca793479b15f0d101080c53ab9a
|
Reference in New Issue
Block a user