2010-04-13 Sebastien Pouliot <sebastien@ximian.com>
[mono-project.git] / mcs / tests / gtest-180.cs
blob4bd1176e33727805d83debf2697632cc7ed6acad
1 using System;
2 using System.Runtime.InteropServices;
4 [module: DefaultCharSet (CharSet.Unicode)]
6 struct foo1 {
9 enum E {
12 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
13 struct foo2 {
16 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
17 delegate void D ();
19 class C {
20 public class CC {
24 class Program {
26 [DllImport("bah")]
27 public static extern void test ();
29 static int Main ()
31 DllImportAttribute dia = Attribute.GetCustomAttribute (typeof (Program).GetMethod ("test"), typeof (DllImportAttribute)) as DllImportAttribute;
32 if (dia == null)
33 return 1;
35 if (dia.CharSet != CharSet.Unicode)
36 return 2;
38 if (!typeof (C).IsUnicodeClass )
39 return 3;
41 if (!typeof (C.CC).IsUnicodeClass )
42 return 4;
44 if (!typeof (D).IsUnicodeClass )
45 return 5;
47 if (!typeof (E).IsUnicodeClass )
48 return 6;
50 if (!typeof (foo1).IsUnicodeClass )
51 return 7;
53 if (!typeof (foo2).IsAutoClass )
54 return 8;
56 return 0;