Remove the mono-profiler- prefix from all source files in the profiler subdir.
[mono.git] / mcs / tests / test-decl-expr-01.cs
1 // Compiler options: -langversion:experimental
2 using System;
3
4 class DeclarationExpression
5 {
6         public static int Main ()
7         {
8                 Out (out int o);
9                 if (o != 3)
10                         return 1;
11
12                 if (Out (out int o1)) {
13                         if (o1 != 3)
14                                 return 2;
15                 }
16
17                 Out (out int o2 = 2);
18                 if (o2 != 3)
19                         return 3;
20
21                 Out (out var o3);
22                 if (o3 != 3)
23                         return 4;
24
25                 Ref (ref int r = 2);
26                 if (r != 7)
27                         return 5;
28
29                 Ref (ref ((var r2 = 3)));
30                 if (r2 != 8)
31                         return 6;
32
33 //              Out2 (str: "b", v: out var o5);
34 //              if (o5 != 9)
35 //                      return 7;
36
37                 Out3 (out var o6 = 9m);
38                 if (o6.GetType () != typeof (decimal))
39                         return 8;
40
41                 Console.WriteLine ("ok");
42                 return 0;
43         }
44
45         static bool Out (out int value)
46         {
47                 value = 3;
48                 return true;
49         }
50
51         static bool Out2 (out int v, string str)
52         {
53                 v = 9;
54                 return true;
55         }
56
57         static void Out3<T> (out T t)
58         {
59                 t = default (T);
60         }
61
62         static void Ref (ref int arg)
63         {
64                 arg += 5;
65         }
66 }