* test-269.cs: New test for varargs methods.
svn path=/trunk/mcs/; revision=29004
+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.
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
#!/usr/bin/perl -w
-my $gmcs = "mono ../gmcs/gmcs.exe";
+my $gmcs = "gmcs2";
my $monodis = "monodis";
my $mono = "mono";
--- /dev/null
+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;
+ }
+}