[wasm] Improve virtualenv installation script (#18470)
[mono-project.git] / mono / tests / custom-modifiers.2.cs
blobd708817a7b9fe70805e657a8f1dfcae208106c49
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;
8 public class Tests {
10 public static int Main () {
11 Type[] arr;
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;
19 arr = typeof (CustomModifiers).GetField ("field_1").GetOptionalCustomModifiers ();
20 if (arr.Length != 0)
21 return 3;
23 arr = typeof (CustomModifiers).GetField ("field_2").GetRequiredCustomModifiers ();
24 if (arr.Length != 0)
25 return 4;
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;
34 /* Check that if there's more than one modifier, we get them in the expected order. */
35 arr = typeof (CustomModifiers).GetField ("field_3").GetOptionalCustomModifiers ();
36 if (arr.Length != 2)
37 return 7;
38 if (arr [0] != typeof (System.Runtime.CompilerServices.IsLong))
39 return 8;
40 if (arr [1] != typeof (System.Runtime.CompilerServices.IsConst))
41 return 9;
43 return 0;