[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / test-849.cs
1 using System;
2
3 class ConditionalPromotions
4 {
5         public static int Test (bool condition, short value)
6         {
7                 return condition ? -1 : value;
8         }
9
10         public static int Main(string[] args)
11         {
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;
17
18                 if (r1.GetType () != typeof (int))
19                         return 1;
20
21                 if (r2.GetType () != typeof (int))
22                         return 2;
23                 
24                 if (r3.GetType () != typeof (uint))
25                         return 3;
26
27                 if (r4.GetType () != typeof (uint))
28                         return 4;
29
30                 if (r5.GetType () != typeof (uint))
31                         return 5;
32                 
33                 byte x = 4;
34                 byte a = (byte)(true ? x : 0);
35                 
36                 return 0;
37         }
38 }