Mercurial > projects > ldc
comparison tests/mini/vararg2.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | test/vararg2.d@a9d29e9f1fed |
children | 4ac97ec7c18e |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module vararg2; | |
2 | |
3 void func(...) | |
4 { | |
5 assert(_arguments.length == 2); | |
6 assert(_arguments[0] is typeid(int)); | |
7 int a = *cast(int*)_argptr; | |
8 _argptr += int.sizeof; | |
9 assert(_arguments[1] is typeid(int)); | |
10 a += *cast(int*)_argptr; | |
11 _argptr += int.sizeof; | |
12 assert(a == 3); | |
13 } | |
14 | |
15 void main() | |
16 { | |
17 func(1,2); | |
18 } |