[Wasm] Fix memory override in mono_wasm_add_assembly
[mono-project.git] / mcs / tests / test-399.cs
blobd800b4f702ff3e47f98e9debbd002c5edd5ae868
1 // Compiler options: -r:test-399-lib.dll
3 using System;
5 class TestVararg
7 static void F (RuntimeArgumentHandle rah)
11 static void G (__arglist)
13 F (new RuntimeArgumentHandle ());
14 F (__arglist);
17 public static int Main ()
19 int result = Vararg.AddABunchOfInts (__arglist ( 2, 3, 4 ));
20 Console.WriteLine ("Answer: {0}", result);
22 if (result != 9)
23 return 1;
25 result = Vararg.AddASecondBunchOfInts (16, __arglist ( 2, 3, 4 ));
26 Console.WriteLine ("Answer: {0}", result);
28 if (result != 9)
29 return 2;
31 Vararg s = new Vararg ();
33 result = s.InstAddABunchOfInts (__arglist ( 2, 3, 4, 5 ));
34 Console.WriteLine ("Answer: {0}", result);
36 if (result != 14)
37 return 3;
39 result = s.InstAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 ));
40 Console.WriteLine ("Answer: {0}", result);
42 if (result != 20)
43 return 4;
45 result = s.InstVtAddABunchOfInts (__arglist ( 2, 3, 4, 5 )).res;
46 Console.WriteLine ("Answer: {0}", result);
48 if (result != 14)
49 return 5;
51 result = s.InstVtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 )).res;
52 Console.WriteLine ("Answer: {0}", result);
54 if (result != 20)
55 return 6;
57 result = Vararg.VtAddABunchOfInts (__arglist ( 2, 3, 4, 5, 1 )).res;
58 Console.WriteLine ("Answer: {0}", result);
60 if (result != 15)
61 return 7;
63 result = Vararg.VtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6, 1 )).res;
64 Console.WriteLine ("Answer: {0}", result);
66 if (result != 21)
67 return 8;
69 return 0;