Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

51
mcs/tests/test-65.cs Normal file
View File

@@ -0,0 +1,51 @@
//
// This exercises the various ways in which the new operator works
// with value types.
//
using System;
struct S {
int v;
}
class X {
static bool receive, create, create_and_box;
static void receiver (S x)
{
receive = true;
}
static object BoxS ()
{
create_and_box = true;
return new S ();
}
static S Plain ()
{
create = true;
return new S ();
}
public static int Main ()
{
object a = new S ();
receiver (new S ());
S s = Plain ();
object o = BoxS ();
if (a == null)
return 1;
if (receive == false)
return 2;
if (create == false)
return 3;
if (create_and_box == false)
return 4;
Console.WriteLine ("Test pass");
return 0;
}
}