5 // big enough that it won't be returned in registers
9 public Result (int val
) {
18 static int AddABunchOfInts (__arglist
)
22 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
23 int argCount
= iter
.GetRemainingCount();
25 for (int i
= 0; i
< argCount
; i
++) {
26 System
.TypedReference typedRef
= iter
.GetNextArg();
27 result
+= (int)TypedReference
.ToObject( typedRef
);
33 static int AddASecondBunchOfInts (int a
, __arglist
)
37 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
38 int argCount
= iter
.GetRemainingCount();
40 for (int i
= 0; i
< argCount
; i
++) {
41 System
.TypedReference typedRef
= iter
.GetNextArg();
42 result
+= (int)TypedReference
.ToObject( typedRef
);
48 static Result
VtAddABunchOfInts (__arglist
)
52 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
53 int argCount
= iter
.GetRemainingCount();
55 for (int i
= 0; i
< argCount
; i
++) {
56 System
.TypedReference typedRef
= iter
.GetNextArg();
57 result
+= (int)TypedReference
.ToObject( typedRef
);
60 return new Result (result
);
63 static Result
VtAddASecondBunchOfInts (int a
, __arglist
)
67 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
68 int argCount
= iter
.GetRemainingCount();
70 for (int i
= 0; i
< argCount
; i
++) {
71 System
.TypedReference typedRef
= iter
.GetNextArg();
72 result
+= (int)TypedReference
.ToObject( typedRef
);
75 return new Result (result
);
78 int InstAddABunchOfInts (__arglist
)
82 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
83 int argCount
= iter
.GetRemainingCount();
85 for (int i
= 0; i
< argCount
; i
++) {
86 System
.TypedReference typedRef
= iter
.GetNextArg();
87 result
+= (int)TypedReference
.ToObject( typedRef
);
93 int InstAddASecondBunchOfInts (int a
, __arglist
)
97 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
98 int argCount
= iter
.GetRemainingCount();
100 for (int i
= 0; i
< argCount
; i
++) {
101 System
.TypedReference typedRef
= iter
.GetNextArg();
102 result
+= (int)TypedReference
.ToObject( typedRef
);
108 Result
InstVtAddABunchOfInts (__arglist
)
112 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
113 int argCount
= iter
.GetRemainingCount();
115 for (int i
= 0; i
< argCount
; i
++) {
116 System
.TypedReference typedRef
= iter
.GetNextArg();
117 result
+= (int)TypedReference
.ToObject( typedRef
);
120 return new Result (result
);
123 Result
InstVtAddASecondBunchOfInts (int a
, __arglist
)
127 System
.ArgIterator iter
= new System
.ArgIterator (__arglist
);
128 int argCount
= iter
.GetRemainingCount();
130 for (int i
= 0; i
< argCount
; i
++) {
131 System
.TypedReference typedRef
= iter
.GetNextArg();
132 result
+= (int)TypedReference
.ToObject( typedRef
);
135 return new Result (result
);
138 static int Main (string[] args
)
140 int result
= AddABunchOfInts (__arglist ( 2, 3, 4 ));
141 Console
.WriteLine ("Answer: {0}", result
);
146 result
= AddASecondBunchOfInts (16, __arglist ( 2, 3, 4 ));
147 Console
.WriteLine ("Answer: {0}", result
);
152 Class1 s
= new Class1 ();
154 result
= s
.InstAddABunchOfInts (__arglist ( 2, 3, 4, 5 ));
155 Console
.WriteLine ("Answer: {0}", result
);
160 result
= s
.InstAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 ));
161 Console
.WriteLine ("Answer: {0}", result
);
166 result
= s
.InstVtAddABunchOfInts (__arglist ( 2, 3, 4, 5 )).res
;
167 Console
.WriteLine ("Answer: {0}", result
);
172 result
= s
.InstVtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 )).res
;
173 Console
.WriteLine ("Answer: {0}", result
);
178 result
= VtAddABunchOfInts (__arglist ( 2, 3, 4, 5, 1 )).res
;
179 Console
.WriteLine ("Answer: {0}", result
);
184 result
= VtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6, 1 )).res
;
185 Console
.WriteLine ("Answer: {0}", result
);
190 result
= s
.InstAddABunchOfInts (__arglist ( ));