2010-04-07 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-716.cs
blobdea199c276d16ede9859923f203db972d305fa91
1 using System;
2 using System.Reflection;
4 struct S
8 struct SS
10 static int i = 9;
13 struct SSS
15 static SSS Empty;
17 static SSS ()
19 Empty = new SSS ();
23 class C
27 class CC
29 static int i = 9;
32 class CCC
34 static CCC Empty;
36 static CCC ()
38 Empty = new CCC ();
42 class X
44 static int Main ()
46 Type t = typeof (S);
47 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
48 return 1;
50 t = typeof (SS);
51 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
52 return 2;
54 t = typeof (SSS);
55 if ((t.Attributes & TypeAttributes.BeforeFieldInit) != 0)
56 return 3;
58 t = typeof (C);
59 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
60 return 4;
62 t = typeof (CC);
63 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
64 return 5;
66 t = typeof (CCC);
67 if ((t.Attributes & TypeAttributes.BeforeFieldInit) != 0)
68 return 6;
70 Console.WriteLine ("OK");
71 return 0;