Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-158.cs
1 using System;
2 using System.Reflection;
3
4 [AttributeUsage (AttributeTargets.All)]
5 public class My : Attribute {
6         public object o;
7
8         public My (object o) {
9                 this.o = o;
10         }
11         
12         [My(TypeCode.Empty)]
13         public class Test {
14                 public static int Main() {
15                         System.Reflection.MemberInfo info = typeof (Test);
16                         object[] attributes = info.GetCustomAttributes (false);
17                         for (int i = 0; i < attributes.Length; i ++) {
18                                 System.Console.WriteLine(attributes[i]);
19                         }
20                         if (attributes.Length != 1)
21                                 return 1;
22                         My attr = (My) attributes [0];
23                         if ((TypeCode) attr.o != TypeCode.Empty)
24                                 return 2;
25                         return 0;
26                 }
27         }
28 }