[mono/tests] Fix out of tree build.
[mono-project.git] / mcs / tests / test-849.cs
blob83310f20dcdf9b72bcfae533b0da4e6a9900373c
1 using System;
3 class ConditionalPromotions
5 public static int Test (bool condition, short value)
7 return condition ? -1 : value;
10 public static int Main(string[] args)
12 var r1 = args.Length > 0 ? 1 : (short)1;
13 var r2 = args.Length > 0 ? (short)1 : 1;
14 var r3 = args.Length > 0 ? 1 : (uint)1;
15 var r4 = args.Length > 0 ? (uint)1 : 1;
16 var r5 = args.Length > 0 ? 0 : (uint)1;
18 if (r1.GetType () != typeof (int))
19 return 1;
21 if (r2.GetType () != typeof (int))
22 return 2;
24 if (r3.GetType () != typeof (uint))
25 return 3;
27 if (r4.GetType () != typeof (uint))
28 return 4;
30 if (r5.GetType () != typeof (uint))
31 return 5;
33 byte x = 4;
34 byte a = (byte)(true ? x : 0);
36 return 0;