[mono/tests] Fix out of tree build.
[mono-project.git] / mcs / tests / test-880.cs
blobacb4a4d5a862c1fde5915d163dfa9b7f3149387e
1 using System;
3 public class A
5 public static void Main ()
9 static void Test1 ()
11 int a;
12 bool r = false;
14 if (r && (a = 1) > 0 && r) {
15 System.Console.WriteLine (a);
19 static void Test2 ()
21 int a;
22 var res = (a = 1) > 0 || Call (a);
25 static void Test3 ()
27 int a;
28 if ((a = 1) > 0 || Call (a))
29 return;
32 static void Test4 ()
34 int version1;
35 bool r = false;
36 if (r || !OutCall (out version1) || version1 == 0 || version1 == -1)
38 throw new ArgumentException();
42 static void Test5 ()
44 bool r = false;
45 int t1;
46 if (Foo (r ? Call (1) : Call (4), OutCall (out t1)))
47 Console.WriteLine (t1);
50 static void Test6 ()
52 int b = 0;
53 var res = b != 0 && b.ToString () != null;
56 static bool Test7 ()
58 int f = 1;
59 int g;
60 return f > 1 && OutCall (out g) && g > 1;
63 static void Test8 ()
65 bool x = true;
67 int a;
68 if (x ? OutCall (out a) : OutCall (out a))
69 System.Console.WriteLine (a);
70 else
71 System.Console.WriteLine (a);
74 static bool OutCall (out int arg)
76 arg = 1;
77 return false;
80 static bool Call (int arg)
82 return false;
85 static bool Foo (params object[] arg)
87 return false;