Merge pull request #5636 from BrzVlad/fix-xmm-scan
[mono.git] / mcs / tests / gtest-380.cs
1 using System.Reflection;
2 using System;
3
4 class GTest<T>
5 {
6         public static volatile string str = "Hello";
7 }
8
9 class Test
10 {
11         public volatile int field;
12
13         public static int Main ()
14         {
15                 FieldInfo fi = typeof (Test).GetField ("field");
16                 if (fi.GetCustomAttributes (true).Length != 0)
17                         return 1;
18                 
19                 Type[] t = fi.GetRequiredCustomModifiers ();
20                 if (t.Length != 1)
21                         return 2;
22                 
23                 if (t [0] != typeof (System.Runtime.CompilerServices.IsVolatile))
24                         return 3;
25
26                 fi = typeof (GTest<>).GetField ("str");
27                 if (fi.GetCustomAttributes (true).Length != 0)
28                         return 10;
29                 
30                 t = fi.GetRequiredCustomModifiers ();
31                 if (t.Length != 1)
32                         return 11;
33                 
34                 if (t [0] != typeof (System.Runtime.CompilerServices.IsVolatile))
35                         return 12;
36
37                 Console.WriteLine ("OK");
38                 return 0;
39         }
40 }