2004-12-09 Marek Safar <marek.safar@seznam.cz>
authorMarek Safar <marek.safar@gmail.com>
Thu, 9 Dec 2004 17:39:54 +0000 (17:39 -0000)
committerMarek Safar <marek.safar@gmail.com>
Thu, 9 Dec 2004 17:39:54 +0000 (17:39 -0000)
* test-329.cs: New test for #67412 (needs runtime update)

svn path=/trunk/mcs/; revision=37503

mcs/tests/ChangeLog
mcs/tests/Makefile
mcs/tests/test-329.cs [new file with mode: 0644]

index d6d2dc6a971b1793878d3182ded1eef10fb29dac..a9de90af2a85b1c8f20d20690fc055f20bc080ee 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-09  Marek Safar <marek.safar@seznam.cz>
+
+       * test-329.cs: New test for #67412.
+
 2004-12-09  Martin Baulig  <martin@ximian.com>
 
        * Makefile: Disabled xml-022.cs and xml-028.cs.
index 77dca7aed56a98ad5919e9b405545938e03d42f1..81451ac315ddf5a7a8b47ac5846a36970d949efd 100644 (file)
@@ -27,7 +27,7 @@ USE_MCS_FLAGS :=
 # Martin Baulig will manually move them into TEST_SOURCES_common after merging the code into GMCS.
 # He may also move some to TEST_EXCLUDE_net_2_0 if some of the merges are inappropriate for GMCS.
 #
-NEW_TEST_SOURCES_common = xml-033
+NEW_TEST_SOURCES_common = xml-033 test-329
 
 #
 # Please do _not_ add any tests here - all new tests should go into NEW_TEST_SOURCES_common
diff --git a/mcs/tests/test-329.cs b/mcs/tests/test-329.cs
new file mode 100644 (file)
index 0000000..3ef1647
--- /dev/null
@@ -0,0 +1,25 @@
+using System;
+
+[X (null)]
+class X : Attribute {
+       int ID;
+       public X () {}
+       public X (object o)
+       { 
+               if (o == null)
+                       ID = 55;
+       }
+       
+       static int Main () {
+               object[] attrs = typeof(X).GetCustomAttributes(typeof (X),false);
+               if (attrs.Length != 1)
+                       return 2;
+           
+               X x = attrs [0] as X;
+               if (x.ID != 55)
+                       return 2;
+           
+               Console.WriteLine("OK");
+               return 0;
+       }
+}