2004-06-08 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Tue, 8 Jun 2004 02:34:51 +0000 (02:34 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 8 Jun 2004 02:34:51 +0000 (02:34 -0000)
* test-269.cs: New test for varargs methods.

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

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

index ededb48a9ebacda95ac94f6adf1157d1798e7f3b..6595c944d8ef9b2904b43c1f5909708586e4b219 100755 (executable)
@@ -1,3 +1,7 @@
+2004-06-08  Martin Baulig  <martin@ximian.com>
+
+       * test-269.cs: New test for varargs methods.
+
 2004-06-01  Marek Safar <marek.safar@seznam.cz>
 
        * test-267.cs: New test.
index 1ebea0409b8f87fef79c88dcb245c85a99b1f012..c112bdd7e079f4aecde4b7fc52e7916d55fec089 100644 (file)
@@ -42,7 +42,7 @@ TEST_SOURCES = \
        test-231 test-232 test-233 test-234 test-235 test-236 test-237 test-238 test-239 test-240 \
        test-241 test-242 test-243 test-244 test-245 test-246 test-247 test-248 test-249 test-250 \
        test-251 test-252 test-253 test-254 test-255 test-256 test-257 test-258 test-259 test-260 \
-       test-260 test-261 test-262 test-263 test-264 test-265 test-266 test-267 \
+       test-260 test-261 test-262 test-263 test-264 test-265 test-266 test-267          test-269 \
        cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-6 cls-test-7 cls-test-10  \
        cls-test-11 cls-test-14 cls-test-15 cls-test-16
 
index 0d9378db4321004f8e31cb25d5960e4a85019495..72a0b1c8e9d4cec19773d9678da37c1f19f798f4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-my $gmcs = "mono ../gmcs/gmcs.exe";
+my $gmcs = "gmcs2";
 my $monodis = "monodis";
 my $mono = "mono";
 
diff --git a/mcs/tests/test-269.cs b/mcs/tests/test-269.cs
new file mode 100644 (file)
index 0000000..b192cf0
--- /dev/null
@@ -0,0 +1,30 @@
+using System;
+
+class Class1
+{
+       static int AddABunchOfInts (__arglist)
+       {
+               int result = 0;
+
+               System.ArgIterator iter = new System.ArgIterator (__arglist);
+               int argCount = iter.GetRemainingCount();
+
+               for (int i = 0; i < argCount; i++) {
+                       System.TypedReference typedRef = iter.GetNextArg();
+                       result += (int)TypedReference.ToObject( typedRef );
+               }
+               
+               return result;
+       }
+
+       static int Main (string[] args)
+       {
+               int result = AddABunchOfInts ( __arglist ( 2, 3, 4 ));
+               Console.WriteLine ("Answer: {0}", result);
+
+               if (result != 9)
+                       return 1;
+
+               return 0;
+       }
+}