Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-399.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d800b4f702ff3e47f98e9debbd002c5edd5ae868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Compiler options: -r:test-399-lib.dll

using System;

class TestVararg
{
	static void F (RuntimeArgumentHandle rah)
	{
	}
	
	static void G (__arglist)
	{
		F (new RuntimeArgumentHandle ());
		F (__arglist);
	}
	
	public static int Main ()
	{
		int result = Vararg.AddABunchOfInts (__arglist ( 2, 3, 4 ));
		Console.WriteLine ("Answer: {0}", result);

		if (result != 9)
			return 1;

		result = Vararg.AddASecondBunchOfInts (16, __arglist ( 2, 3, 4 ));
		Console.WriteLine ("Answer: {0}", result);

		if (result != 9)
			return 2;

		Vararg s = new Vararg ();

		result = s.InstAddABunchOfInts (__arglist ( 2, 3, 4, 5 ));
		Console.WriteLine ("Answer: {0}", result);

		if (result != 14)
			return 3;

		result = s.InstAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 ));
		Console.WriteLine ("Answer: {0}", result);

		if (result != 20)
			return 4;

		result = s.InstVtAddABunchOfInts (__arglist ( 2, 3, 4, 5 )).res;
		Console.WriteLine ("Answer: {0}", result);

		if (result != 14)
			return 5;

		result = s.InstVtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 )).res;
		Console.WriteLine ("Answer: {0}", result);

		if (result != 20)
			return 6;

		result = Vararg.VtAddABunchOfInts (__arglist ( 2, 3, 4, 5, 1 )).res;
		Console.WriteLine ("Answer: {0}", result);

		if (result != 15)
			return 7;

		result = Vararg.VtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6, 1 )).res;
		Console.WriteLine ("Answer: {0}", result);

		if (result != 21)
			return 8;

		return 0;
	}
}