Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / custom-modifiers.2.cs
1 //
2 // This should be part of the mscorlib tests but there is no way to generate custom
3 // modifiers with C#.
4 //
5 using System;
6 using System.Reflection;
7
8 public class Tests {
9
10         public static int Main () {
11                 Type[] arr;
12
13                 arr = typeof (CustomModifiers).GetField ("field_1").GetRequiredCustomModifiers ();
14                 if (arr.Length != 1)
15                         return 1;
16                 if (arr [0] != typeof (System.Runtime.CompilerServices.IsBoxed))
17                         return 2;
18
19                 arr = typeof (CustomModifiers).GetField ("field_1").GetOptionalCustomModifiers ();
20                 if (arr.Length != 0)
21                         return 3;
22
23                 arr = typeof (CustomModifiers).GetField ("field_2").GetRequiredCustomModifiers ();
24                 if (arr.Length != 0)
25                         return 4;
26
27                 arr = typeof (CustomModifiers).GetField ("field_2").GetOptionalCustomModifiers ();
28                 if (arr.Length != 1)
29                         return 5;
30                 if (arr [0] != typeof (System.Runtime.CompilerServices.IsVolatile))
31                         return 6;
32                 
33                 return 0;
34         }
35 }