[arm64] Add the full neon regs to the context
[mono.git] / mcs / tests / test-297.cs
1 using System;
2
3 [My((long)1)]
4 [My(TypeCode.Empty)]
5 [My(typeof(System.Enum))]
6 class T {
7         public static int Main() {
8                 object[] a = Attribute.GetCustomAttributes (typeof (T), false);
9                 if (a.Length != 3)
10                         return 1;
11                 foreach (object o in a) {
12                         My attr = (My)o;
13                         if (attr.obj.GetType () == typeof (long)) {
14                                 long val = (long) attr.obj;
15                                 if (val != 1)
16                                         return 2;
17                         } else if (attr.obj.GetType () == typeof (TypeCode)) {
18                                 TypeCode val = (TypeCode) attr.obj;
19                                 if (val != TypeCode.Empty)
20                                         return 3;
21                         } else if (attr.obj.GetType ().IsSubclassOf (typeof (Type))) {
22                                 Type val = (Type) attr.obj;
23                                 if (val != typeof (System.Enum))
24                                         return 4;
25                         } else
26                                 return 5;
27                         
28                 }
29                 
30                 object[] ats = typeof(T).GetMethod("Login").GetCustomAttributes (typeof(My), true);
31                 My at = (My) ats[0];
32                 if (at.Val != AnEnum.a)
33                     return 6;
34                 
35                 return 0;
36         }
37         
38         [My(1, Val=AnEnum.a)]
39         public void Login(string a)     {}        
40 }
41
42 [AttributeUsage(AttributeTargets.All,AllowMultiple=true)]
43 class My : Attribute {
44         public object obj;
45         public My (object o) {
46                 obj = o;
47         }
48         
49         public AnEnum Val; 
50 }
51
52 public enum AnEnum
53 {
54         a,b,c
55 }
56