Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-801.cs
1 using System;
2
3 class C
4 {
5         public enum E
6         {
7                 V_0 = 10,
8                 V_1     = 50,
9                 V_2 = 80
10         }
11         
12         public static implicit operator E (C x)
13         {
14                 return E.V_2;
15         }
16
17         public static implicit operator int (C x)
18         {
19                 return 1;
20         }
21
22         public static int Main ()
23         {
24                 var v = new C ();
25                 int i = E.V_1 - v;
26                 if (i != -30)
27                         return 1;
28                 
29                 i = v - E.V_1;
30                 if (i != 30)
31                         return 10;
32                 
33                 E e = E.V_1 + v;
34                 if (e != (E) 51)
35                         return 2;
36                 
37                 e = v + E.V_0;
38                 if (e != (E) 11)
39                         return 3;
40                 
41                 bool b = E.V_2 > v;
42                 if (b)
43                         return 4;
44                 
45                 int iv = 900;
46                 e = iv - E.V_1;
47                 if (e != (E)850)
48                         return 5;
49                 
50                 i = v - E.V_1;
51                 if (i != (int) 30)
52                         return 6;
53
54                 return 0;
55         }
56 }