2009-07-11 Michael Barker <mike@middlesoft.co.uk>
[mono.git] / mono / tests / metadata-verifier / assembly-with-methods.cs
1 using System;
2 using System.Runtime.InteropServices;
3 using System.Runtime.CompilerServices;
4
5 public class TypeOne
6 {
7         static int z;
8         public void GenericMethod<T> () {
9                 int foo = 10;
10                 z = foo;
11         }
12
13         public void SimpleMethod () { //thin EH table 
14                 int foo = 10;
15                 z = foo;
16                 try {
17                         z = 10;
18                 } catch (Exception e) {}
19         }
20 }
21
22 public interface IFace
23 {
24         void MyMethod ();
25 }
26
27
28 public abstract class TypeTwo
29 {
30         public TypeTwo () { //2 simple EH entries
31                 try {
32                         new TypeOne ();
33                 } catch (Exception) {}
34
35                 try {
36                         new TypeOne ();
37                 } finally {}
38                 
39         }
40         [DllImport ("bla.dll")]
41         public static extern void PInvoke ();
42 }
43
44 public abstract class AbsClass
45 {
46         public AbsClass () { //fat EH table
47                 int z = 99;
48                 int foo = 10;
49                 z = foo;
50                 try {
51                         //make this bigger than 256 bytes, each entry is 25 bytes
52                         z = typeof(int).GetHashCode ();
53                         z = typeof(int).GetHashCode ();
54                         z = typeof(int).GetHashCode ();
55                         z = typeof(int).GetHashCode ();
56                         z = typeof(int).GetHashCode ();
57                         z = typeof(int).GetHashCode ();
58                         z = typeof(int).GetHashCode ();
59                         z = typeof(int).GetHashCode ();
60                         z = typeof(int).GetHashCode ();
61                         z = typeof(int).GetHashCode ();
62                         z = typeof(int).GetHashCode ();
63                         z = typeof(int).GetHashCode ();
64                 } finally {}
65         }
66         public abstract void AbsBla ();
67 }
68
69 public static class InternalCall
70 {
71                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
72                 public static extern int ICall (object o);
73 }
74
75
76 public class ClassWithCCtor
77 {
78         static ClassWithCCtor () {
79         
80         }
81 }
82
83 public class MethodWithLostsOfParams
84 {
85         static void Foo(int a, int b, int c) {}
86         static void Foo2(int a, int b, int c) {}
87         static void Foo3(int a, int b, int c) {}
88 }
89
90 public class LastClass
91 {
92         public static void Main ()
93         {
94         }
95 }