do not check order sequence if option /order was not used
[mono.git] / mcs / tests / test-59.cs
1 //
2 // Tests the varios type conversions.
3 //
4 using System;
5
6 class X {
7
8         static int test_explicit ()
9         {
10                 object x_int = 1;
11                 object x_uint_1 = 1u;
12                 object x_uint_2 = 1U;
13                 object x_long_1 = 1l;
14                 object x_long_2 = 1L;
15                 object x_ulong_1 = 1ul;
16                 object x_ulong_2 = 1UL;
17                 object x_ulong_3 = 1lu;
18                 object x_ulong_4 = 1Lu;
19                 object x_ulong_5 = 1LU;
20
21                 if (!(x_int is int))
22                         return 1;
23
24                 if (!(x_uint_1 is uint))
25                         return 2;
26
27                 if (!(x_uint_2 is uint))
28                         return 3;
29
30                 if (!(x_long_1 is long))
31                         return 5;
32
33                 if (!(x_long_2 is long))
34                         return 6;
35
36                 if (!(x_ulong_1 is ulong))
37                         return 7;
38
39                 if (!(x_ulong_2 is ulong))
40                         return 8;
41                 
42                 if (!(x_ulong_3 is ulong))
43                         return 9;
44
45                 if (!(x_ulong_4 is ulong))
46                         return 10;
47
48                 if (!(x_ulong_5 is ulong))
49                         return 11;
50
51                 return 0;
52
53         }
54
55         static int test_implicit ()
56         {
57                 object i_int = 1;
58                 object i_uint = 0x80000000;
59                 object i_long = 0x100000000;
60                 object i_ulong = 0x8000000000000000;
61
62                 if (!(i_int is int))
63                         return 1;
64                 if (!(i_uint is uint))
65                         return 2;
66                 if (!(i_long is long))
67                         return 3;
68                 if (!(i_ulong is ulong))
69                         return 4;
70
71                 return 0;
72         }
73         
74         static int Main ()
75         {
76                 int v;
77                 v = test_explicit ();
78
79                 if (v != 0)
80                         return v;
81
82                 v = test_implicit ();
83                 if (v != 0)
84                         return 20 + v;
85
86                 //
87                 // Just a compilation fix: 21418
88                 //
89                 ulong l = 1;
90                 if (l != 0L)
91                         ;
92
93
94                 // This was a compilation bug, error: 57522
95                 ulong myulog = 0L;
96
97                 Console.WriteLine ("Tests pass");
98                 return 0;
99         }
100 }