* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / tests / gtest-180.cs
1 using System;
2 using System.Runtime.InteropServices;
3
4 [module: DefaultCharSet (CharSet.Unicode)]
5
6 struct foo1 {
7 }
8
9 enum E {
10 }
11
12 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
13 struct foo2 {
14 }
15
16 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
17 delegate void D ();
18
19 class C {
20     public class CC {
21     }
22 }
23
24 class Program {
25
26         [DllImport("bah")]
27         public static extern void test ();
28     
29         static int Main ()
30         {
31                 DllImportAttribute dia = Attribute.GetCustomAttribute (typeof (Program).GetMethod ("test"), typeof (DllImportAttribute)) as DllImportAttribute;
32                 if (dia == null)
33                         return 1;
34
35                 if (dia.CharSet != CharSet.Unicode)
36                         return 2;
37
38                 if (!typeof (C).IsUnicodeClass )
39                         return 3;
40
41                 if (!typeof (C.CC).IsUnicodeClass )
42                         return 4;
43
44                 if (!typeof (D).IsUnicodeClass )
45                         return 5;
46
47                 if (!typeof (E).IsUnicodeClass )
48                         return 6;
49
50                 if (!typeof (foo1).IsUnicodeClass )
51                         return 7;
52
53                 if (!typeof (foo2).IsAutoClass )
54                         return 8;
55
56                 return 0;
57         }
58 }