Merged into single file, added assertions
[mono.git] / mcs / tests / test-704.cs
1 // Compiler options: -unsafe
2
3 using System;
4 using System.Runtime.InteropServices;
5
6 namespace NObjective
7 {
8         public class Program
9         {
10                 static volatile bool ProcessExiting = false;
11
12                 [DllImport ("libc.dylib")]
13                 public extern static void printf (string format, __arglist);
14
15                 private static void ArglistMethod (__arglist)
16                 {
17                         var iter = new ArgIterator (__arglist);
18
19                         for (int n = iter.GetRemainingCount (); n > 0; n--)
20                                 Console.WriteLine (TypedReference.ToObject (iter.GetNextArg ()));
21                 }
22
23                 static unsafe void Main (string[] args)
24                 {
25                         ArglistMethod (__arglist (1, 2, 3));
26                 }
27         }
28 }