Imported Upstream version 4.4.0.40

Former-commit-id: 6427cc082e74df30afc535fd906a3494b74b0817
This commit is contained in:
Xamarin Public Jenkins
2016-03-16 12:38:19 -04:00
parent f3e3aab35a
commit a632333cc7
110 changed files with 1496 additions and 556 deletions

View File

@@ -98,6 +98,35 @@ class C
if ((null | b4) != true)
return 103;
bool? x_n = null;
bool? x_f = false;
bool? x_t = true;
bool? res;
res = null & x_n;
if (res.HasValue)
return 201;
res = null & x_t;
if (res.HasValue)
return 202;
res = null & x_f;
if (res.Value != false)
return 203;
res = null | x_n;
if (res.HasValue)
return 204;
res = null | x_t;
if (res.Value != true)
return 205;
res = null | x_f;
if (res.HasValue)
return 206;
return 0;
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Threading.Tasks;
class X
{
public static int Main ()
{
if (new X ().Test (false).Result != true)
return 1;
if (new X ().Test (true).Result != true)
return 2;
return 0;
}
public async Task<bool> Test(bool TrueOrFalse)
{
if (TrueOrFalse)
return true;
try {
return true;
}
finally
{
await Task.Yield ();
}
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Threading.Tasks;
class MainClass
{
public static int Main ()
{
var t = GetSomeStrings (null);
try {
var s = t.Result;
return 1;
} catch (AggregateException e) {
if (e.InnerException is NullReferenceException)
return 0;
return 2;
}
}
public static async Task<string> GetSomeStrings (AsyncStringFactory myFactory)
{
var res = await myFactory?.GetSomeStringAsync ();
return res;
}
}
public class AsyncStringFactory
{
public async Task<string> GetSomeStringAsync ()
{
await Task.Yield();
return "foo";
}
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Threading.Tasks;
struct S
{
public int value;
public string str;
}
public class Program
{
async Task<S> Foo ()
{
return new S {
value = 1,
str = await DoAsync ()
};
}
static async Task<string> DoAsync ()
{
await Task.Yield ();
return "asdafs";
}
static int Main ()
{
var res = new Program ().Foo ().Result;
if (res.value != 1)
return 1;
return 0;
}
}

View File

@@ -0,0 +1,16 @@
using System;
class EscapedQuotedInterpolatedFormatSpecifier
{
public static int Main ()
{
string ss = "ss";
var t = $@"\4{ss:\u007B}\5";
Console.WriteLine (t);
if (t != @"\4ss\5")
return 1;
return 0;
}
}

View File

@@ -0,0 +1,66 @@
// Compiler options: -warnaserror
using System;
public class Person
{
public Car MyCar { get; set; }
}
public class Car
{
public int Year { get; set; }
}
enum EE
{
K
}
public class MainClass
{
class Nested
{
}
public static Person MyPerson1 { get; } = new Person();
public static Person MyPerson2 = new Person();
public const Person MyPerson3 = null;
public static event Action Act = null;
public static dynamic BBB = null;
public static int Main ()
{
string name;
name = nameof (MyPerson1.MyCar.Year);
if (name != "Year")
return 1;
name = nameof (MyPerson2.MyCar.Year);
if (name != "Year")
return 2;
name = nameof (MyPerson3.MyCar.Year);
if (name != "Year")
return 3;
name = nameof (Act.Method.MemberType);
if (name != "MemberType")
return 4;
name = nameof (BBB.A.B.C);
if (name != "C")
return 5;
name = nameof (EE.K.ToString);
if (name != "ToString")
return 6;
name = nameof (int.ToString);
if (name != "ToString")
return 7;
return 0;
}
}

View File

@@ -1 +1 @@
dcd5f610003bf7b72bb83316c5aeefb95f9e64ce
55a55a8ce00b5f19846f2a4e0df099c17d0799cd