Merge pull request #4185 from BrzVlad/fix-arm64-finally-abort
[mono.git] / mcs / tests / test-454.cs
index 9032303ae42bb46d940dcbf48d4e0cb2875690dc..f0a3e6bf5439f3874408b4fd2d19b48aec3f1aa1 100644 (file)
@@ -1,10 +1,16 @@
-// string array initializer is allowed as a parameter type.
+// Test various kinds of arrays as custom attribute parameters
 using System;
 
+enum EnumType {
+       X,
+       Y
+};
+
 class FooAttribute : Attribute
 {
        public string [] StringValues;
        public object [] ObjectValues;
+       public EnumType [] EnumValues;
        public Type [] Types;
 
        public FooAttribute ()
@@ -14,11 +20,12 @@ class FooAttribute : Attribute
 
 [Foo (StringValues = new string [] {"foo", "bar", "baz"},
        ObjectValues = new object [] {1, 'A', "B"},
+       EnumValues = new EnumType [] { EnumType.X, EnumType.Y },
        Types = new Type [] {typeof (int), typeof (Type)}
        )]
 class Test
 {
-       public static void Main () 
+       public static int Main () 
        {
                FooAttribute foo = (FooAttribute) typeof (Test)
                        .GetCustomAttributes (false) [0];
@@ -28,9 +35,13 @@ class Test
                        || 1 != (int) foo.ObjectValues [0]
                        || 'A' != (char) foo.ObjectValues [1]
                        || "B" != (string) foo.ObjectValues [2]
+                       || EnumType.X != foo.EnumValues [0]
+                       || EnumType.Y != foo.EnumValues [1]
                        || foo.Types [0] != typeof (int)
                        || foo.Types [1] != typeof (Type)
                        )
-                       throw new ApplicationException ();
+                       return 1;
+               
+               return 0;
        }
-}
+}
\ No newline at end of file