Fix LLVM linker flags for 6.0.
[mono-project.git] / mcs / tests / gtest-358.cs
blob631dfb89c55ab89e312a5e0fb2e8d69395adb35a
1 // Tests broken equality and inequality operators
3 using System;
5 struct Foo
7 public static bool operator == (Foo d1, Foo d2)
9 throw new ApplicationException ();
12 public static bool operator != (Foo d1, Foo d2)
14 throw new ApplicationException ();
18 struct S2
20 public static bool operator == (S2 d1, S2? d2)
22 throw new ApplicationException ();
25 public static bool operator != (S2 d1, S2? d2)
27 throw new ApplicationException ();
31 public struct S3
33 public static decimal operator != (S3 a, object b)
35 return -1;
38 public static decimal operator == (S3 a, object b)
40 return 1;
45 public class Test
47 static Foo ctx;
48 static S2? s2;
49 static S3? s3;
51 public static int Main ()
53 if (ctx == null)
54 return 1;
56 bool b = ctx != null;
57 if (!b)
58 return 2;
60 if (s2 != null)
61 return 3;
63 s3 = new S3 ();
64 decimal d = s3.Value == null;
65 if (d != 1)
66 return 4;
68 Console.WriteLine ("ok");
69 return 0;