[configure] Add new target.
[mono-project.git] / mcs / tests / gtest-380.cs
blob8e27fa894f51bb9e0f73d15da6c212ee962f431d
1 using System.Reflection;
2 using System;
4 class GTest<T>
6 public static volatile string str = "Hello";
9 class Test
11 public volatile int field;
13 public static int Main ()
15 FieldInfo fi = typeof (Test).GetField ("field");
16 if (fi.GetCustomAttributes (true).Length != 0)
17 return 1;
19 Type[] t = fi.GetRequiredCustomModifiers ();
20 if (t.Length != 1)
21 return 2;
23 if (t [0] != typeof (System.Runtime.CompilerServices.IsVolatile))
24 return 3;
26 fi = typeof (GTest<>).GetField ("str");
27 if (fi.GetCustomAttributes (true).Length != 0)
28 return 10;
30 t = fi.GetRequiredCustomModifiers ();
31 if (t.Length != 1)
32 return 11;
34 if (t [0] != typeof (System.Runtime.CompilerServices.IsVolatile))
35 return 12;
37 Console.WriteLine ("OK");
38 return 0;