Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / test-41.cs
blobfaf2e19bbf82153436c961ef1d1e904ffb7182aa
1 //
2 // This tests the ref access to parameters
3 //
4 using System;
6 class X {
8 static void A (ref int a, ref uint b, ref sbyte c, ref byte d, ref long e, ref ulong f,
9 ref short g, ref ushort h, ref char i, ref X x, ref float j, ref double k)
11 if (a == 1)
12 a = 2;
14 if (b == 1)
15 b = 2;
17 if (c == 1)
18 c = 2;
20 if (d == 1)
21 d = 2;
23 if (e == 1)
24 e = 2;
26 if (f == 1)
27 f = 2;
29 if (g == 1)
30 g = 2;
32 if (h == 1)
33 h = 2;
35 if (i == 'a')
36 i = 'b';
38 if (x == null)
39 x = new X ();
41 if (j == 1.0)
42 j = 2.0F;
43 if (k == 1.0)
44 k = 2.0;
47 public static int Main ()
49 int a = 1;
50 uint b = 1;
51 sbyte c = 1;
52 byte d = 1;
53 long e = 1;
54 ulong f = 1;
55 short g = 1;
56 ushort h = 1;
57 char i = 'a';
58 float j = 1.0F;
59 double k = 1.0;
60 X x = null;
62 A (ref a, ref b, ref c, ref d, ref e, ref f, ref g, ref h, ref i, ref x, ref j, ref k);
64 if (a != 2)
65 return 1;
66 if (b != 2)
67 return 2;
68 if (c != 2)
69 return 3;
70 if (d != 2)
71 return 4;
72 if (e != 2)
73 return 5;
74 if (f != 2)
75 return 6;
76 if (g != 2)
77 return 7;
78 if (h != 2)
79 return 8;
80 if (i != 'b')
81 return 9;
82 if (j != 2.0)
83 return 10;
84 if (k != 2.0)
85 return 11;
86 if (x == null)
87 return 12;
89 Console.WriteLine ("Test passed");
90 return 0;