do not check order sequence if option /order was not used
[mono.git] / mcs / tests / test-716.cs
1 using System;
2 using System.Reflection;
3
4 struct S
5 {
6 }
7
8 struct SS
9 {
10         static int i = 9;
11 }
12
13 struct SSS
14 {
15         static SSS Empty;
16         
17         static SSS ()
18         {
19                 Empty = new SSS ();
20         }
21 }
22
23 class C
24 {
25 }
26
27 class CC
28 {
29         static int i = 9;
30 }
31
32 class CCC
33 {
34         static CCC Empty;
35         
36         static CCC ()
37         {
38                 Empty = new CCC ();
39         }
40 }
41
42 class X
43 {
44         static int Main ()
45         {
46                 Type t = typeof (S);
47                 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
48                         return 1;
49
50                 t = typeof (SS);
51                 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
52                         return 2;
53                 
54                 t = typeof (SSS);
55                 if ((t.Attributes & TypeAttributes.BeforeFieldInit) != 0)
56                         return 3;
57                 
58                 t = typeof (C);
59                 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
60                         return 4;
61
62                 t = typeof (CC);
63                 if ((t.Attributes & TypeAttributes.BeforeFieldInit) == 0)
64                         return 5;
65                 
66                 t = typeof (CCC);
67                 if ((t.Attributes & TypeAttributes.BeforeFieldInit) != 0)
68                         return 6;
69                 
70                 Console.WriteLine ("OK");
71                 return 0;
72         }
73 }