[configure] Add new target.
[mono-project.git] / mcs / tests / test-65.cs
blob4ba623a1c6f1abb68080c3b6b9d1a11b956ad42b
1 //
2 // This exercises the various ways in which the new operator works
3 // with value types.
4 //
6 using System;
8 struct S {
9 int v;
12 class X {
13 static bool receive, create, create_and_box;
15 static void receiver (S x)
17 receive = true;
20 static object BoxS ()
22 create_and_box = true;
23 return new S ();
26 static S Plain ()
28 create = true;
29 return new S ();
32 public static int Main ()
34 object a = new S ();
35 receiver (new S ());
36 S s = Plain ();
37 object o = BoxS ();
39 if (a == null)
40 return 1;
41 if (receive == false)
42 return 2;
43 if (create == false)
44 return 3;
45 if (create_and_box == false)
46 return 4;
48 Console.WriteLine ("Test pass");
49 return 0;