Merged into single file, added assertions
[mono.git] / mcs / tests / test-849.cs
1 using System;
2
3 class ConditionalPromotions
4 {
5         public static int Main(string[] args)
6         {
7                 var r1 = args.Length > 0 ? 1 : (short)1;
8                 var r2 = args.Length > 0 ? (short)1 : 1;
9                 var r3 = args.Length > 0 ? 1 : (uint)1;
10                 var r4 = args.Length > 0 ? (uint)1 : 1;
11                 var r5 = args.Length > 0 ? 0 : (uint)1;
12
13                 if (r1.GetType () != typeof (int))
14                         return 1;
15
16                 if (r2.GetType () != typeof (int))
17                         return 2;
18                 
19                 if (r3.GetType () != typeof (uint))
20                         return 3;
21
22                 if (r4.GetType () != typeof (uint))
23                         return 4;
24
25                 if (r5.GetType () != typeof (uint))
26                         return 5;
27                 
28                 byte x = 4;
29                 byte a = (byte)(true ? x : 0);
30                 
31                 return 0;
32         }
33 }