[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / test-540.cs
1 class A
2 {
3         public static implicit operator byte (A mask)
4         {
5                 return 22;
6         }
7 }
8
9 public class Constraint
10 {
11         const A lm = null;
12
13         enum E1 : int { A }
14         enum E2 : byte { A }
15
16         public static Constraint operator !(Constraint m)
17         {
18                 return null;
19         }
20
21         public static Constraint operator +(Constraint m)
22         {
23                 return null;
24         }
25
26         public static Constraint operator ~(Constraint m)
27         {
28                 return null;
29         }
30
31         public static Constraint operator -(Constraint m)
32         {
33                 return null;
34         }
35         
36         static void Foo (object o)
37         {
38         }
39         
40         public static int Main ()
41         {
42                 
43                 Foo (!(Constraint)null);
44                 Foo (~(Constraint)null);
45                 Foo (+(Constraint)null);
46                 Foo (-(Constraint)null);
47                 
48                 const byte b1 = +0;
49                 const byte b2 = +b1;
50                 const byte b3 = (byte)0;
51                 const int a = -2147483648;
52                 const long l = -9223372036854775808;
53                 const long l2 = -uint.MaxValue;
54                 const E1 e = (E1)~E2.A;
55                 
56                 unchecked {
57                         if (-int.MinValue != int.MinValue)
58                                 return 1;
59                 }
60
61                 int b = -lm;
62                 if (b != -22)
63                         return 2;
64                 
65                 uint ua = 2;
66                 if (-ua != -2)
67                         return 3;
68
69                 System.Console.WriteLine ("OK");
70                 return 0;
71         }
72         
73 }