[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tests / gtest-etree-04.cs
blobd40bc9636d952ab34e08658c794aee43128d93b8
1 using System;
2 using System.Linq.Expressions;
4 struct Foo
6 public static bool operator > (Foo d1, Foo d2)
8 throw new ApplicationException ();
11 public static bool operator < (Foo d1, Foo d2)
13 throw new ApplicationException ();
16 public static bool operator == (Foo d1, Foo d2)
18 throw new ApplicationException ();
21 public static bool operator != (Foo d1, Foo d2)
23 throw new ApplicationException ();
26 public static Foo operator + (Foo d1, Foo d2)
28 throw new ApplicationException ();
32 class C
34 public static int Main()
36 Foo f;
37 Expression<Func<bool>> e = () => f > null;
38 if (e.Compile ().Invoke ())
39 return 1;
41 e = () => f < null;
42 if (e.Compile ().Invoke ())
43 return 2;
45 e = () => f == null;
46 if (e.Compile ().Invoke ())
47 return 3;
49 e = () => f != null;
50 if (!e.Compile ().Invoke ())
51 return 4;
53 Expression<Func<Foo?>> e2 = () => f + null;
54 if (e2.Compile ().Invoke () != null)
55 return 5;
57 Console.WriteLine ("OK");
58 return 0;