annotate 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
rev   line source
lindquist@57 1 module vararg2;
lindquist@57 2
lindquist@57 3 void func(...)
lindquist@57 4 {
lindquist@57 5 assert(_arguments.length == 2);
lindquist@57 6 assert(_arguments[0] is typeid(int));
lindquist@57 7 int a = *cast(int*)_argptr;
lindquist@57 8 _argptr += int.sizeof;
lindquist@57 9 assert(_arguments[1] is typeid(int));
lindquist@57 10 a += *cast(int*)_argptr;
lindquist@57 11 _argptr += int.sizeof;
lindquist@57 12 assert(a == 3);
lindquist@57 13 }
lindquist@57 14
lindquist@57 15 void main()
lindquist@57 16 {
lindquist@57 17 func(1,2);
lindquist@57 18 }