You've already forked linux-packaging-mono
Imported Upstream version 5.12.0.220
Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
parent
8bd104cef2
commit
8fc30896db
34
mcs/tests/gtest-647.cs
Normal file
34
mcs/tests/gtest-647.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
int B = default (MyStruct?);
|
||||
if (MyStruct.counter != 1)
|
||||
return 1;
|
||||
|
||||
switch (default (MyStruct?)) {
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (MyStruct.counter != 2)
|
||||
return 4;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public struct MyStruct
|
||||
{
|
||||
public static int counter;
|
||||
|
||||
public static implicit operator int (MyStruct? s)
|
||||
{
|
||||
++counter;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -19,5 +19,3 @@ test-404.cs
|
||||
test-704.cs
|
||||
test-811.cs
|
||||
test-async-17.cs
|
||||
test-ref-08.cs IGNORE
|
||||
test-ref-09.cs IGNORE
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Compiler options: -langversion:7.2 -unsafe
|
||||
// Compiler options: -langversion:7.2 /unsafe
|
||||
|
||||
using System;
|
||||
|
||||
@@ -7,10 +7,16 @@ class X
|
||||
public static void Main ()
|
||||
{
|
||||
Span<int> stackSpan = stackalloc int[100];
|
||||
|
||||
bool b = false;
|
||||
|
||||
var r1 = !b ? stackalloc char[1] : throw null;
|
||||
var r2 = b ? throw null : stackalloc char[1];
|
||||
var r3 = b ? stackalloc char[1] : stackalloc char[2];
|
||||
}
|
||||
|
||||
// Disables verifier
|
||||
unsafe void Foo ()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
mcs/tests/test-950.cs
Normal file
12
mcs/tests/test-950.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
public class B
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
int a = 1_0_3;
|
||||
double b = 0__0e+1_1;
|
||||
int c = 0b__1_0;
|
||||
int d = 0x__F_0;
|
||||
}
|
||||
}
|
20
mcs/tests/test-960.cs
Normal file
20
mcs/tests/test-960.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
// Compiler options: -langversion:7.2
|
||||
|
||||
public class B
|
||||
{
|
||||
private protected enum E
|
||||
{
|
||||
}
|
||||
|
||||
public int Index { get; protected private set; }
|
||||
|
||||
internal string S1 { get; private protected set; }
|
||||
|
||||
protected string S2 { get; private protected set; }
|
||||
|
||||
private protected int field;
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
57
mcs/tests/test-binaryliteral.cs
Normal file
57
mcs/tests/test-binaryliteral.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
class Demo {
|
||||
static int Main ()
|
||||
{
|
||||
if (0b1 != 1)
|
||||
return 1;
|
||||
var hex1 = 0x123ul;
|
||||
var bin1 = 0b100100011ul;
|
||||
var bin11 = 0b100100011lu;
|
||||
if (hex1 != bin1)
|
||||
return 2;
|
||||
if (hex1 != bin11)
|
||||
return 3;
|
||||
if (hex1.GetType () != bin1.GetType ())
|
||||
return 4;
|
||||
if (hex1.GetType () != bin11.GetType ())
|
||||
return 5;
|
||||
|
||||
var hex2 = 0x7FFFFFFF;
|
||||
var bin2 = 0b1111111111111111111111111111111;
|
||||
|
||||
if (hex2 != bin2)
|
||||
return 6;
|
||||
if (hex2.GetType () != bin2.GetType ())
|
||||
return 7;
|
||||
|
||||
var hex3 = 0xFFFFFFFF;
|
||||
var bin3 = 0b11111111111111111111111111111111;
|
||||
if (hex3 != bin3)
|
||||
return 8;
|
||||
if (hex3.GetType () != bin3.GetType ())
|
||||
return 9;
|
||||
|
||||
var hex4 = 0xFFFFFFFFu;
|
||||
var bin4 = 0b11111111111111111111111111111111u;
|
||||
if (hex4 != bin4)
|
||||
return 10;
|
||||
if (hex4.GetType () != bin4.GetType ())
|
||||
return 11;
|
||||
|
||||
var hex5 = 0x7FFFFFFFFFFFFFFF;
|
||||
var bin5 = 0b111111111111111111111111111111111111111111111111111111111111111;
|
||||
if (hex5 != bin5)
|
||||
return 12;
|
||||
if (hex5.GetType () != bin5.GetType ())
|
||||
return 13;
|
||||
|
||||
var hex6 = 0xFFFFFFFFFFFFFFFF;
|
||||
var bin6 = 0b1111111111111111111111111111111111111111111111111111111111111111;
|
||||
if (hex6 != bin6)
|
||||
return 14;
|
||||
if (hex6.GetType () != bin6.GetType ())
|
||||
return 15;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
17
mcs/tests/test-decl-expr-06.cs
Normal file
17
mcs/tests/test-decl-expr-06.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
public class C
|
||||
{
|
||||
Func<bool> f = () => Foo (out int arg);
|
||||
|
||||
static bool Foo (out int arg)
|
||||
{
|
||||
arg = 2;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
new C ();
|
||||
}
|
||||
}
|
@@ -41,7 +41,11 @@ static class X
|
||||
static System.Func<int> M4 ()
|
||||
{
|
||||
return () => default;
|
||||
}
|
||||
}
|
||||
|
||||
static void Foo (II a = default (II), II b = default, II c = (II) null)
|
||||
{
|
||||
}
|
||||
}
|
||||
/*
|
||||
enum E
|
||||
@@ -49,4 +53,10 @@ enum E
|
||||
A = default,
|
||||
B = default + 1
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
interface II
|
||||
{
|
||||
|
||||
}
|
19
mcs/tests/test-pattern-13.cs
Normal file
19
mcs/tests/test-pattern-13.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
class C : B
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class B
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
C c = new C ();
|
||||
|
||||
if (c is B b)
|
||||
{
|
||||
Console.WriteLine (b == null);
|
||||
}
|
||||
}
|
||||
}
|
13
mcs/tests/test-ref-11.cs
Normal file
13
mcs/tests/test-ref-11.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
class Program
|
||||
{
|
||||
static int x;
|
||||
static int y;
|
||||
|
||||
public static int Main ()
|
||||
{
|
||||
bool b = false;
|
||||
ref int targetBucket = ref b ? ref x : ref y;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
24
mcs/tests/test-tuple-08.cs
Normal file
24
mcs/tests/test-tuple-08.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
var x = new X ();
|
||||
x.Test ().Wait ();
|
||||
}
|
||||
|
||||
int a, b;
|
||||
|
||||
async Task Test ()
|
||||
{
|
||||
(a, b) = await Waiting ();
|
||||
}
|
||||
|
||||
Task<(int, int)> Waiting ()
|
||||
{
|
||||
return Task.FromResult ((1, 3));
|
||||
}
|
||||
}
|
@@ -1 +1 @@
|
||||
4dbc7042a8a8252f26b40788a5460fbf138e5b46
|
||||
b9f7e8f159b0400a597cc46e59c1ab2f32b9d4e8
|
Reference in New Issue
Block a user