[corlib] Fix a few NSLogWriter issues. (#13799)
[mono-project.git] / mcs / tests / test-567.cs
blob424c7ff11db8f135eb8ac995dfb2a1fa90526e83
1 using System;
2 using System.Reflection;
3 using System.Runtime.InteropServices;
5 namespace preservesig_test
7 class Class1
9 public static int Main(string[] args)
11 MethodInfo dofoo = typeof(TestClass).GetMethod("DoFoo");
12 if ((dofoo.GetMethodImplementationFlags() & MethodImplAttributes.PreserveSig) == 0)
13 return 1;
15 dofoo = typeof(TestClass).GetProperty("Foo").GetGetMethod ();
16 if ((dofoo.GetMethodImplementationFlags() & MethodImplAttributes.PreserveSig) == 0)
17 return 1;
19 dofoo = typeof(TestClass).GetEvent("e").GetAddMethod (true);
20 if ((dofoo.GetMethodImplementationFlags() & MethodImplAttributes.PreserveSig) == 0)
21 return 1;
23 Console.WriteLine("Has PreserveSig");
24 return 0;
28 public class TestClass
30 public delegate void D ();
32 [method:PreserveSig]
33 public event D e;
35 [PreserveSig()]
36 public int DoFoo()
38 return 0;
41 public int Foo {
42 [PreserveSig]
43 get {
44 return 2;